Voxel Class Reference

Map of labels (object IDs) to number of points. More...

#include <VisionX/libraries/VoxelGrids/LabelDensity/VoxelGrid.h>

+ Inheritance diagram for Voxel:

Public Member Functions

std::map< Label, floatgetDensity () const
 Get the relative frequency of labels, so that the sum is 1.0. More...
 
std::pair< Label, std::size_t > getMax () const
 Get the label with most points and the number of points. More...
 
Label getMaxLabel () const
 Get the label with most points. More...
 
std::size_t getTotal () const
 Get the total number of points in this voxel. More...
 
bool isFree () const
 Indicate whether this voxel is free, i.e. it contains no points. More...
 
bool operator!= (const Voxel &rhs) const
 
bool operator== (const Voxel &rhs) const
 Equality operator. More...
 

Friends

std::ostream & operator<< (std::ostream &os, const Voxel &voxel)
 Outstream operator. More...
 

Detailed Description

Map of labels (object IDs) to number of points.

Definition at line 27 of file VoxelGrid.h.

Member Function Documentation

◆ getDensity()

std::map< Label, float > getDensity ( ) const

Get the relative frequency of labels, so that the sum is 1.0.

If getTotal() is 0, the total of the returned density is also 0.0.

Definition at line 30 of file VoxelGrid.cpp.

+ Here is the call graph for this function:

◆ getMax()

std::pair< Label, std::size_t > getMax ( ) const

Get the label with most points and the number of points.

Definition at line 47 of file VoxelGrid.cpp.

+ Here is the caller graph for this function:

◆ getMaxLabel()

Label getMaxLabel ( ) const

Get the label with most points.

Definition at line 42 of file VoxelGrid.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTotal()

std::size_t getTotal ( ) const

Get the total number of points in this voxel.

Definition at line 20 of file VoxelGrid.cpp.

+ Here is the caller graph for this function:

◆ isFree()

bool isFree ( ) const

Indicate whether this voxel is free, i.e. it contains no points.

Definition at line 15 of file VoxelGrid.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator!=()

bool operator!= ( const Voxel rhs) const

Definition at line 79 of file VoxelGrid.cpp.

◆ operator==()

bool operator== ( const Voxel rhs) const

Equality operator.

Considers a non-existent label and a label with count 0 equal.

Definition at line 52 of file VoxelGrid.cpp.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const Voxel voxel 
)
friend

Outstream operator.

Definition at line 84 of file VoxelGrid.cpp.


The documentation for this class was generated from the following files: