CGAL 6.1 - Classification
|
#include <CGAL/Classification/Cluster.h>
Class that represent a cluster of items to be classified as a single atomic object.
A cluster is a set of indices of items inside an input range with random access.
ItemRange | model of ConstRange . Its iterator type is RandomAccessIterator . Its value type depends on the data that is classified (for example, CGAL::Point_3 or CGAL::Triangle_3 ). |
ItemMap | model of ReadablePropertyMap whose key type is the value type of the iterator of ItemRange and value type is the type of item to classify (for example, CGAL::Point_3 ). |
Public Types | |
using | Item = typename boost::property_traits< ItemMap >::value_type |
Constructor | |
Cluster (const ItemRange &range, ItemMap item_map) | |
Constructs an empty cluster of items. | |
Modifications | |
void | clear () |
Clears the cluster. | |
void | insert (std::size_t idx) |
inserts element of index idx in the cluster. | |
Access | |
std::size_t | size () const |
returns the number of items in the cluster. | |
std::size_t | index (std::size_t i) const |
returns the index (in the input range) of the i^{th} element of the cluster. | |
const Item & | operator[] (std::size_t i) const |
returns the i^{th} item of the cluster. | |
const CGAL::Bbox_3 & | bbox () const |
returns the bounding box of the cluster. | |
Classification | |
int | training () const |
returns the input classification value used for training. | |
int & | training () |
returns a reference to the input classification value used for training. | |
int | label () const |
returns the output classification value. | |
int & | label () |
returns a reference to the output classification value. | |
using CGAL::Classification::Cluster< ItemRange, ItemMap >::Item = typename boost::property_traits<ItemMap>::value_type |
CGAL::Classification::Cluster< ItemRange, ItemMap >::Cluster | ( | const ItemRange & | range, |
ItemMap | item_map | ||
) |
Constructs an empty cluster of items.
Items in the clusters will be subsets of range
.
range | input range. |
item_map | property map to access the input items. |
const CGAL::Bbox_3 & CGAL::Classification::Cluster< ItemRange, ItemMap >::bbox | ( | ) | const |
returns the bounding box of the cluster.
void CGAL::Classification::Cluster< ItemRange, ItemMap >::clear | ( | ) |
Clears the cluster.
std::size_t CGAL::Classification::Cluster< ItemRange, ItemMap >::index | ( | std::size_t | i | ) | const |
returns the index (in the input range) of the i^{th} element of the cluster.
void CGAL::Classification::Cluster< ItemRange, ItemMap >::insert | ( | std::size_t | idx | ) |
inserts element of index idx
in the cluster.
int & CGAL::Classification::Cluster< ItemRange, ItemMap >::label | ( | ) |
returns a reference to the output classification value.
int CGAL::Classification::Cluster< ItemRange, ItemMap >::label | ( | ) | const |
returns the output classification value.
const Item & CGAL::Classification::Cluster< ItemRange, ItemMap >::operator[] | ( | std::size_t | i | ) | const |
returns the i^{th} item of the cluster.
std::size_t CGAL::Classification::Cluster< ItemRange, ItemMap >::size | ( | ) | const |
returns the number of items in the cluster.
int & CGAL::Classification::Cluster< ItemRange, ItemMap >::training | ( | ) |
returns a reference to the input classification value used for training.