33 #ifndef DART_DYNAMICS_SHAPE_HPP_
34 #define DART_DYNAMICS_SHAPE_HPP_
38 #include <Eigen/Dense>
100 virtual const std::string&
getType()
const = 0;
114 template <
typename ShapeT>
136 std::size_t
getID()
const;
226 #include "dart/dynamics/detail/Shape.hpp"
#define DART_DEPRECATED(version)
Definition: Deprecated.hpp:51
std::string type
Definition: SdfParser.cpp:82
The Subject class is a base class for any object that wants to report when it gets destroyed.
Definition: Subject.hpp:58
VersionCounter is an interface for objects that count their versions.
Definition: VersionCounter.hpp:43
bool mIsBoundingBoxDirty
Whether bounding box needs update.
Definition: Shape.hpp:192
ShapeType mType
Definition: Shape.hpp:211
double mVolume
Volume enclosed by the geometry.
Definition: Shape.hpp:195
ShapeType getShapeType() const
Definition: Shape.cpp:111
math::BoundingBox mBoundingBox
The bounding box (in the local coordinate frame) of the shape.
Definition: Shape.hpp:189
static std::atomic_int mCounter
Definition: Shape.hpp:207
virtual void notifyAlphaUpdated(double alpha)
Notify that the alpha of this shape has updated.
Definition: Shape.cpp:162
bool mIsVolumeDirty
Whether volume needs update.
Definition: Shape.hpp:198
std::size_t incrementVersion() override final
Increment the version of this Shape and notify its subscribers.
Definition: Shape.cpp:180
bool checkDataVariance(DataVariance type) const
True iff this Shape has the specified type of DataVariance.
Definition: Shape.cpp:141
ShapeType
Definition: Shape.hpp:60
@ MESH
Definition: Shape.hpp:69
@ LINE_SEGMENT
Definition: Shape.hpp:71
@ CONE
Definition: Shape.hpp:66
@ CYLINDER
Definition: Shape.hpp:64
@ SPHERE
Definition: Shape.hpp:61
@ MULTISPHERE
Definition: Shape.hpp:68
@ ELLIPSOID
Definition: Shape.hpp:63
@ HEIGHTMAP
Definition: Shape.hpp:72
@ PLANE
Definition: Shape.hpp:67
@ BOX
Definition: Shape.hpp:62
@ SOFT_MESH
Definition: Shape.hpp:70
@ CAPSULE
Definition: Shape.hpp:65
@ UNSUPPORTED
Definition: Shape.hpp:73
std::size_t getID() const
Definition: Shape.cpp:105
Shape()
Constructor.
Definition: Shape.cpp:57
DataVariance
DataVariance can be used by renderers to determine whether it should expect data for this shape to ch...
Definition: Shape.hpp:78
@ DYNAMIC_VERTICES
The coloring or textures of the shape might change.
Definition: Shape.hpp:83
@ DYNAMIC_TRANSFORM
No data will ever change.
Definition: Shape.hpp:80
@ STATIC
Definition: Shape.hpp:79
@ DYNAMIC_PRIMITIVE
The relative transform of the Shape might change.
Definition: Shape.hpp:81
@ DYNAMIC_ELEMENTS
Vertex positions of a mesh might change (this does not include adding or removing vertices) (this enu...
Definition: Shape.hpp:84
@ DYNAMIC_COLOR
The primitive properties (such as x/y/z scaling) of the shape might change.
Definition: Shape.hpp:82
@ DYNAMIC
The number of elements and/or arrangement of elements might change (this includes adding and removing...
Definition: Shape.hpp:85
virtual void notifyAlphaUpdate(double alpha)
Notify that the alpha of this shape has updated.
Definition: Shape.cpp:156
virtual void updateBoundingBox() const =0
Updates bounding box.
Eigen::Matrix3d computeInertiaFromDensity(double density) const
Definition: Shape.cpp:84
Eigen::Matrix3d computeInertiaFromMass(double mass) const
Definition: Shape.cpp:90
virtual const std::string & getType() const =0
Returns a string representing the shape type.
virtual void notifyColorUpdated(const Eigen::Vector4d &color)
Notify that the color (rgba) of this shape has updated.
Definition: Shape.cpp:174
virtual void refreshData()
Instruct this shape to update its data.
Definition: Shape.cpp:150
void removeDataVariance(unsigned int _variance)
Remove a type of variance from this shape.
Definition: Shape.cpp:129
VersionChangedSignal mVersionChangedSignal
Triggered by incrementVersion()
Definition: Shape.hpp:215
unsigned int mVariance
The DataVariance of this Shape.
Definition: Shape.hpp:204
bool is() const
Get true if the types of this Shape and the template parameter (a shape class) are identical.
Definition: Shape.hpp:42
const math::BoundingBox & getBoundingBox() const
Get the bounding box of the shape in its local coordinate frame.
Definition: Shape.cpp:75
virtual void updateVolume() const =0
Updates volume.
const std::size_t mID
Unique id.
Definition: Shape.hpp:201
common::SlotRegister< VersionChangedSignal > onVersionChanged
Use this to subscribe to version change signals.
Definition: Shape.hpp:219
void addDataVariance(unsigned int _variance)
Add a type of variance to this shape.
Definition: Shape.cpp:123
virtual void notifyColorUpdate(const Eigen::Vector4d &color)
Notify that the color (rgba) of this shape has updated.
Definition: Shape.cpp:168
double getVolume() const
Returns volume of this shape.
Definition: Shape.cpp:96
void setDataVariance(unsigned int _variance)
Set the data variance of this shape.
Definition: Shape.cpp:117
unsigned int getDataVariance() const
Get the data variance of this shape.
Definition: Shape.cpp:135
virtual ~Shape()
Destructor.
Definition: Shape.cpp:69
virtual Eigen::Matrix3d computeInertia(double mass) const =0
Computes the inertia.
Definition: Geometry.hpp:578
Definition: Random-impl.hpp:92
Definition: BulletCollisionDetector.cpp:63
Definition: SharedLibraryManager.hpp:43