CGAL 5.1 - Classification
CGAL::Classification::Label_set Class Reference

#include <CGAL/Classification/Label_set.h>

Definition

Set of Label used as input by classification algorithms.

Public Member Functions

 Label_set ()
 
 Label_set (const std::initializer_list< const char *> &labels)
 Initializes the set with the provided labels names.
 
Label_handle add (const char *name)
 Adds a label. More...
 
bool remove (Label_handle label)
 Removes a label. More...
 
std::size_t size () const
 Returns how many labels are defined.
 
Label_handle operator[] (std::size_t i) const
 Returns the \(i^{th}\) label.
 
void clear ()
 Removes all labels.
 

Member Function Documentation

◆ add()

Label_handle CGAL::Classification::Label_set::add ( const char *  name)

Adds a label.

Note
Names are not used for identification: two labels in the same set can have the same name (but not the same handle).
Parameters
namename of the label.
Returns
a handle to the newly added label.

◆ remove()

bool CGAL::Classification::Label_set::remove ( Label_handle  label)

Removes a label.

Parameters
labelthe handle to the label that must be removed.
Returns
true if the label was correctly removed, false if its handle was not found.