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. More...
 
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. More...
 
Label_handle operator[] (std::size_t i) const
 Returns the \(i^{th}\) label. More...
 
void clear ()
 Removes all labels. More...
 

Constructor & Destructor Documentation

◆ Label_set() [1/2]

CGAL::Classification::Label_set::Label_set ( )

◆ Label_set() [2/2]

CGAL::Classification::Label_set::Label_set ( const std::initializer_list< const char * > &  labels)

Initializes the set with the provided labels names.

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.

◆ clear()

void CGAL::Classification::Label_set::clear ( )

Removes all labels.

◆ operator[]()

Label_handle CGAL::Classification::Label_set::operator[] ( std::size_t  i) const

Returns the \(i^{th}\) 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.

◆ size()

std::size_t CGAL::Classification::Label_set::size ( ) const

Returns how many labels are defined.