33 #ifndef DART_DYNAMICS_POINTCLOUDSHAPE_HPP_
34 #define DART_DYNAMICS_POINTCLOUDSHAPE_HPP_
39 # include <octomap/Pointcloud.h>
78 const std::string&
getType()
const override;
90 void addPoint(
const Eigen::Vector3d& point);
93 void addPoint(
const std::vector<Eigen::Vector3d>& points);
96 void setPoint(
const std::vector<Eigen::Vector3d>& points);
100 void setPoints(::octomap::Pointcloud& pointCloud);
103 void addPoints(::octomap::Pointcloud& pointCloud);
107 const std::vector<Eigen::Vector3d>&
getPoints()
const;
141 Eigen::aligned_allocator<Eigen::Vector4d>>& colors);
144 const std::vector<Eigen::Vector4d, Eigen::aligned_allocator<Eigen::Vector4d>>&
173 std::vector<Eigen::Vector4d, Eigen::aligned_allocator<Eigen::Vector4d>>
std::string type
Definition: SdfParser.cpp:82
The PointCloudShape represents point cloud data.
Definition: PointCloudShape.hpp:47
PointShapeType getPointShapeType() const
Returns the point shape type.
Definition: PointCloudShape.cpp:161
double mVisualSize
The size of visual object that represents each point.
Definition: PointCloudShape.hpp:177
Eigen::Vector4d getOverallColor() const
Returns the overall color.
Definition: PointCloudShape.cpp:186
const std::vector< Eigen::Vector4d, Eigen::aligned_allocator< Eigen::Vector4d > > & getColors() const
Returns the point cloud colors.
Definition: PointCloudShape.cpp:217
PointCloudShape(double visualSize=0.01)
Constructor.
Definition: PointCloudShape.cpp:55
void setPointShapeType(PointShapeType type)
Sets the point shape type.
Definition: PointCloudShape.cpp:151
PointShapeType mPointShapeType
The point shape type.
Definition: PointCloudShape.hpp:167
ColorMode
Definition: PointCloudShape.hpp:50
@ BIND_PER_POINT
Use one color per point.
Definition: PointCloudShape.hpp:58
@ BIND_OVERALL
Use one color for all the points.
Definition: PointCloudShape.hpp:55
@ USE_SHAPE_COLOR
Use the color specified by the ShapeAspect. This is the default.
Definition: PointCloudShape.hpp:52
void setColorMode(ColorMode mode)
Sets the color mode.
Definition: PointCloudShape.cpp:167
std::vector< Eigen::Vector3d > mPoints
List of points.
Definition: PointCloudShape.hpp:164
std::size_t getNumPoints() const
Returns the number of points.
Definition: PointCloudShape.cpp:139
void setColors(const std::vector< Eigen::Vector4d, Eigen::aligned_allocator< Eigen::Vector4d >> &colors)
Sets the point cloud colors.
Definition: PointCloudShape.cpp:207
double getVisualSize() const
Returns size of visual object that represents each point.
Definition: PointCloudShape.cpp:230
void addPoint(const Eigen::Vector3d &point)
Adds a point to this point cloud.
Definition: PointCloudShape.cpp:90
Eigen::Matrix3d computeInertia(double mass) const override
Computes the inertia.
Definition: PointCloudShape.cpp:71
PointShapeType
Definition: PointCloudShape.hpp:62
@ POINT
Vertex.
Definition: PointCloudShape.hpp:66
@ BILLBOARD_CIRCLE
2D circle always facing the screen
Definition: PointCloudShape.hpp:65
@ BILLBOARD_SQUARE
2D square always facing the screen
Definition: PointCloudShape.hpp:64
@ BOX
3D volumetric box
Definition: PointCloudShape.hpp:63
void removeAllPoints()
Removes all the points.
Definition: PointCloudShape.cpp:145
~PointCloudShape() override=default
Destructor.
ColorMode mColorMode
The color mode.
Definition: PointCloudShape.hpp:170
void reserve(std::size_t size)
Reserves the point list by size.
Definition: PointCloudShape.cpp:84
const std::string & getType() const override
Returns a string representing the shape type.
Definition: PointCloudShape.cpp:65
void setOverallColor(const Eigen::Vector4d &color)
Sets the overall color.
Definition: PointCloudShape.cpp:179
void updateBoundingBox() const override
Updates bounding box.
Definition: PointCloudShape.cpp:249
std::vector< Eigen::Vector4d, Eigen::aligned_allocator< Eigen::Vector4d > > mColors
List of colors.
Definition: PointCloudShape.hpp:174
ColorMode getColorMode() const
Returns the color mode.
Definition: PointCloudShape.cpp:173
void notifyColorUpdated(const Eigen::Vector4d &color) override
Notify that the color (rgba) of this shape has updated.
Definition: PointCloudShape.cpp:236
void setPoint(const std::vector< Eigen::Vector3d > &points)
Replaces points with points.
Definition: PointCloudShape.cpp:106
void updateVolume() const override
Updates volume.
Definition: PointCloudShape.cpp:242
const std::vector< Eigen::Vector3d > & getPoints() const
Returns the list of points.
Definition: PointCloudShape.cpp:133
void setVisualSize(double size)
Sets size of visual object that represents each point.
Definition: PointCloudShape.cpp:223
static const std::string & getStaticType()
Returns shape type for this class.
Definition: PointCloudShape.cpp:77
Definition: BulletCollisionDetector.cpp:65