dart
|
The PointCloudShape represents point cloud data. More...
#include <PointCloudShape.hpp>
Public Types | |
enum | ColorMode { USE_SHAPE_COLOR = 0, BIND_OVERALL, BIND_PER_POINT } |
enum | PointShapeType { BOX = 0, BILLBOARD_SQUARE, BILLBOARD_CIRCLE, POINT } |
![]() | |
enum | ShapeType { SPHERE, BOX, ELLIPSOID, CYLINDER, CAPSULE, CONE, PYRAMID, RECTANGULAR_PYRAMID, PLANE, MULTISPHERE, MESH, SOFT_MESH, LINE_SEGMENT, HEIGHTMAP, UNSUPPORTED } |
enum | DataVariance { STATIC = 0, DYNAMIC_TRANSFORM = 1 << 1, DYNAMIC_PRIMITIVE = 1 << 2, DYNAMIC_COLOR = 1 << 3, DYNAMIC_VERTICES = 1 << 4, DYNAMIC_ELEMENTS = 1 << 5, DYNAMIC = 0xFF } |
DataVariance can be used by renderers to determine whether it should expect data for this shape to change during each update. More... | |
using | VersionChangedSignal = common::Signal< void(Shape *shape, std::size_t version)> |
Public Member Functions | |
PointCloudShape (double visualSize=0.01) | |
Constructor. More... | |
~PointCloudShape () override=default | |
Destructor. | |
const std::string & | getType () const override |
Returns a string representing the shape type. More... | |
Eigen::Matrix3d | computeInertia (double mass) const override |
Computes the inertia. | |
void | reserve (std::size_t size) |
Reserves the point list by size . | |
void | addPoint (const Eigen::Vector3d &point) |
Adds a point to this point cloud. | |
void | addPoint (const std::vector< Eigen::Vector3d > &points) |
Adds points to this point cloud. | |
void | setPoint (const std::vector< Eigen::Vector3d > &points) |
Replaces points with points . | |
const std::vector< Eigen::Vector3d > & | getPoints () const |
Returns the list of points. | |
std::size_t | getNumPoints () const |
Returns the number of points. | |
void | removeAllPoints () |
Removes all the points. | |
void | setPointShapeType (PointShapeType type) |
Sets the point shape type. | |
PointShapeType | getPointShapeType () const |
Returns the point shape type. | |
void | setColorMode (ColorMode mode) |
Sets the color mode. | |
ColorMode | getColorMode () const |
Returns the color mode. | |
void | setOverallColor (const Eigen::Vector4d &color) |
Sets the overall color. More... | |
Eigen::Vector4d | getOverallColor () const |
Returns the overall color. | |
void | setColors (const std::vector< Eigen::Vector4d, Eigen::aligned_allocator< Eigen::Vector4d >> &colors) |
Sets the point cloud colors. More... | |
const std::vector< Eigen::Vector4d, Eigen::aligned_allocator< Eigen::Vector4d > > & | getColors () const |
Returns the point cloud colors. | |
void | setVisualSize (double size) |
Sets size of visual object that represents each point. | |
double | getVisualSize () const |
Returns size of visual object that represents each point. | |
void | notifyColorUpdated (const Eigen::Vector4d &color) override |
Notify that the color (rgba) of this shape has updated. | |
![]() | |
Shape (ShapeType _type) | |
Constructor. More... | |
Shape () | |
Constructor. | |
virtual | ~Shape () |
Destructor. | |
template<typename ShapeT > | |
bool | is () const |
Get true if the types of this Shape and the template parameter (a shape class) are identical. More... | |
const math::BoundingBox & | getBoundingBox () const |
Get the bounding box of the shape in its local coordinate frame. More... | |
Eigen::Matrix3d | computeInertiaFromDensity (double density) const |
Eigen::Matrix3d | computeInertiaFromMass (double mass) const |
double | getVolume () const |
Returns volume of this shape. More... | |
std::size_t | getID () const |
ShapeType | getShapeType () const |
void | setDataVariance (unsigned int _variance) |
Set the data variance of this shape. More... | |
void | addDataVariance (unsigned int _variance) |
Add a type of variance to this shape. More... | |
void | removeDataVariance (unsigned int _variance) |
Remove a type of variance from this shape. More... | |
unsigned int | getDataVariance () const |
Get the data variance of this shape. | |
bool | checkDataVariance (DataVariance type) const |
True iff this Shape has the specified type of DataVariance. | |
virtual void | refreshData () |
Instruct this shape to update its data. | |
virtual void | notifyAlphaUpdate (double alpha) |
Notify that the alpha of this shape has updated. | |
virtual void | notifyAlphaUpdated (double alpha) |
Notify that the alpha of this shape has updated. | |
virtual void | notifyColorUpdate (const Eigen::Vector4d &color) |
Notify that the color (rgba) of this shape has updated. | |
std::size_t | incrementVersion () override final |
Increment the version of this Shape and notify its subscribers. | |
![]() | |
virtual | ~Subject () |
Destructor will notify all Observers that it is destructing. | |
![]() | |
VersionCounter () | |
Default constructor. | |
virtual std::size_t | getVersion () const |
Get the version number of this object. | |
Static Public Member Functions | |
static const std::string & | getStaticType () |
Returns shape type for this class. | |
Protected Member Functions | |
void | updateVolume () const override |
Updates volume. | |
void | updateBoundingBox () const override |
Updates bounding box. | |
![]() | |
void | sendDestructionNotification () const |
Send a destruction notification to all Observers. More... | |
void | addObserver (Observer *_observer) const |
Add an Observer to the list of Observers. | |
void | removeObserver (Observer *_observer) const |
Remove an Observer from the list of Observers. | |
![]() | |
void | setVersionDependentObject (VersionCounter *dependent) |
Protected Attributes | |
std::vector< Eigen::Vector3d > | mPoints |
List of points. | |
PointShapeType | mPointShapeType |
The point shape type. | |
ColorMode | mColorMode |
The color mode. | |
std::vector< Eigen::Vector4d, Eigen::aligned_allocator< Eigen::Vector4d > > | mColors |
List of colors. | |
double | mVisualSize |
The size of visual object that represents each point. | |
![]() | |
math::BoundingBox | mBoundingBox |
The bounding box (in the local coordinate frame) of the shape. | |
bool | mIsBoundingBoxDirty |
Whether bounding box needs update. | |
double | mVolume |
Volume enclosed by the geometry. | |
bool | mIsVolumeDirty |
Whether volume needs update. | |
const std::size_t | mID |
Unique id. | |
unsigned int | mVariance |
The DataVariance of this Shape. | |
ShapeType | mType |
![]() | |
std::set< Observer * > | mObservers |
List of current Observers. | |
![]() | |
std::size_t | mVersion |
Additional Inherited Members | |
![]() | |
common::SlotRegister< VersionChangedSignal > | onVersionChanged |
Use this to subscribe to version change signals. | |
![]() | |
static std::atomic_int | mCounter {PRIMITIVE_MAGIC_NUMBER} |
The PointCloudShape represents point cloud data.
|
explicit |
Constructor.
[in] | visualSize | The size of cube that represents each point. |
|
overridevirtual |
void dart::dynamics::PointCloudShape::setColors | ( | const std::vector< Eigen::Vector4d, Eigen::aligned_allocator< Eigen::Vector4d >> & | colors | ) |
Sets the point cloud colors.
The count of colors should be the same with points. It's undefined behavior, otherwise.
void dart::dynamics::PointCloudShape::setOverallColor | ( | const Eigen::Vector4d & | color | ) |
Sets the overall color.
This function resizes the colors to one.