Image Component Library (ICL)
|
Base implementation of the SceneObjectBase interface for compability with common icl::SceneObjects. More...
#include <PointCloudObject.h>
Public Member Functions | |
PointCloudObject (bool withNormals=false, bool withColors=false, bool withLabels=false) | |
creates an empty point cloud with with optionally initialized featuers | |
PointCloudObject (int numPoints, bool withNormals=false, bool withColors=true, bool withLabels=false) | |
create an un-organizied point cloud with N points | |
PointCloudObject (int width, int height, bool organized=true, bool withNormals=false, bool withColors=true, bool withLabels=false) | |
creates a new organized or un-organized SimplePointCloudObject instance | |
virtual bool | supports (FeatureType t) const |
returns which features are supported (only XYZ and RGBA32f) | |
virtual bool | isOrganized () const |
returns whether the points are 2D-ordered | |
virtual utils::Size | getSize () const throw (utils::ICLException) |
returns the 2D size of the pointcloud (throws exception if not ordered) | |
virtual int | getDim () const |
return the linearily ordered number of point in the point cloud | |
virtual void | setSize (const utils::Size &size) |
adapts the point cloud size | |
virtual core::DataSegment < float, 3 > | selectXYZ () |
returns XYZ data segment | |
virtual core::DataSegment < float, 4 > | selectXYZH () |
returns XYZH data segment | |
virtual core::DataSegment < float, 4 > | selectRGBA32f () |
returns the RGBA data segment (4-floats) | |
virtual core::DataSegment < float, 4 > | selectNormal () |
returns the Normals data segment (4-floats) | |
virtual core::DataSegment < icl32s, 1 > | selectLabel () |
returns the label data segment (32-bit signed integer) | |
virtual void | customRender () |
important, this is again, reimplemented in order to NOT draw the stuff manually here | |
virtual bool | canAddFeature (FeatureType t) const |
only normals and color can be added in hindsight | |
virtual void | addFeature (FeatureType t) throw (utils::ICLException) |
adds normals or colors in hindsight | |
virtual PointCloudObject * | copy () const |
deep copy function | |
void | push_back (const Vec &point) |
just a simple wrapper for top-top level classe's addVertex method | |
void | push_back (const Vec &point, const GeomColor &color) |
adds xyz point with given color | |
void | push_back (const Vec &point, const Vec &normal, const GeomColor &color) |
adds xyz point with given normal and color | |
Protected Attributes | |
bool | m_organized |
internal 2D organized flag | |
utils::Size | m_dim2D |
2D dimension | |
bool | m_hasNormals |
flag whether normals are given | |
bool | m_hasColors |
flag whether the point cloud has colors | |
bool | m_hasLabels |
flag indicating whether labels are supported | |
std::vector< int > | m_labels |
label mask (activated in constructor) |
Base implementation of the SceneObjectBase interface for compability with common icl::SceneObjects.
This class replaces the former implementations
The PointCloudObject can be set up to have also normals in the constructor.
icl::geom::PointCloudObject::PointCloudObject | ( | bool | withNormals = false , |
bool | withColors = false , |
||
bool | withLabels = false |
||
) |
creates an empty point cloud with with optionally initialized featuers
icl::geom::PointCloudObject::PointCloudObject | ( | int | numPoints, |
bool | withNormals = false , |
||
bool | withColors = true , |
||
bool | withLabels = false |
||
) |
create an un-organizied point cloud with N points
icl::geom::PointCloudObject::PointCloudObject | ( | int | width, |
int | height, | ||
bool | organized = true , |
||
bool | withNormals = false , |
||
bool | withColors = true , |
||
bool | withLabels = false |
||
) |
creates a new organized or un-organized SimplePointCloudObject instance
width | number of points per line (if unordered, number of points) |
height | number of points per row (if unordered, height is not used) |
organized | specifies whether there is a 2D data order or not withNormals if true, also normals will be created for each point |
virtual void icl::geom::PointCloudObject::addFeature | ( | FeatureType | t | ) | throw (utils::ICLException) [virtual] |
adds normals or colors in hindsight
If the given feature is already contained, calling this function has no effect. The function calls lock() and unlock() internally
Reimplemented from icl::geom::PointCloudObjectBase.
virtual bool icl::geom::PointCloudObject::canAddFeature | ( | FeatureType | t | ) | const [virtual] |
only normals and color can be added in hindsight
Reimplemented from icl::geom::PointCloudObjectBase.
virtual PointCloudObject* icl::geom::PointCloudObject::copy | ( | ) | const [inline, virtual] |
deep copy function
Reimplemented from icl::geom::PointCloudObjectBase.
virtual void icl::geom::PointCloudObject::customRender | ( | ) | [virtual] |
important, this is again, reimplemented in order to NOT draw the stuff manually here
Reimplemented from icl::geom::PointCloudObjectBase.
virtual int icl::geom::PointCloudObject::getDim | ( | ) | const [virtual] |
return the linearily ordered number of point in the point cloud
Implements icl::geom::PointCloudObjectBase.
virtual utils::Size icl::geom::PointCloudObject::getSize | ( | ) | const throw (utils::ICLException) [virtual] |
returns the 2D size of the pointcloud (throws exception if not ordered)
Implements icl::geom::PointCloudObjectBase.
virtual bool icl::geom::PointCloudObject::isOrganized | ( | ) | const [virtual] |
returns whether the points are 2D-ordered
Implements icl::geom::PointCloudObjectBase.
void icl::geom::PointCloudObject::push_back | ( | const Vec & | point | ) | [inline] |
just a simple wrapper for top-top level classe's addVertex method
This method does not work for organized point cloud objects. The organized flag is not checked for performance reason. The behaviour of calling push_back on ordered point clouds is undefined
void icl::geom::PointCloudObject::push_back | ( | const Vec & | point, |
const GeomColor & | color | ||
) | [inline] |
adds xyz point with given color
void icl::geom::PointCloudObject::push_back | ( | const Vec & | point, |
const Vec & | normal, | ||
const GeomColor & | color | ||
) | [inline] |
adds xyz point with given normal and color
virtual core::DataSegment<icl32s,1> icl::geom::PointCloudObject::selectLabel | ( | ) | [virtual] |
returns the label data segment (32-bit signed integer)
Only available if the the Label feature was explicitly enabled
Reimplemented from icl::geom::PointCloudObjectBase.
virtual core::DataSegment<float,4> icl::geom::PointCloudObject::selectNormal | ( | ) | [virtual] |
returns the Normals data segment (4-floats)
Only available if the constructor was called with "withNormals" set to true
Reimplemented from icl::geom::PointCloudObjectBase.
virtual core::DataSegment<float,4> icl::geom::PointCloudObject::selectRGBA32f | ( | ) | [virtual] |
returns the RGBA data segment (4-floats)
Reimplemented from icl::geom::PointCloudObjectBase.
virtual core::DataSegment<float,3> icl::geom::PointCloudObject::selectXYZ | ( | ) | [virtual] |
returns XYZ data segment
Reimplemented from icl::geom::PointCloudObjectBase.
virtual core::DataSegment<float,4> icl::geom::PointCloudObject::selectXYZH | ( | ) | [virtual] |
returns XYZH data segment
Reimplemented from icl::geom::PointCloudObjectBase.
virtual void icl::geom::PointCloudObject::setSize | ( | const utils::Size & | size | ) | [virtual] |
adapts the point cloud size
if the sizes height is smaller than 1, the cloud becomes un-organized
Implements icl::geom::PointCloudObjectBase.
virtual bool icl::geom::PointCloudObject::supports | ( | FeatureType | t | ) | const [virtual] |
returns which features are supported (only XYZ and RGBA32f)
Implements icl::geom::PointCloudObjectBase.
utils::Size icl::geom::PointCloudObject::m_dim2D [protected] |
2D dimension
bool icl::geom::PointCloudObject::m_hasColors [protected] |
flag whether the point cloud has colors
bool icl::geom::PointCloudObject::m_hasLabels [protected] |
flag indicating whether labels are supported
bool icl::geom::PointCloudObject::m_hasNormals [protected] |
flag whether normals are given
std::vector<int> icl::geom::PointCloudObject::m_labels [protected] |
label mask (activated in constructor)
bool icl::geom::PointCloudObject::m_organized [protected] |
internal 2D organized flag