dart
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
dart::dynamics::ArrowShape Class Reference
Inheritance diagram for dart::dynamics::ArrowShape:
Inheritance graph
[legend]
Collaboration diagram for dart::dynamics::ArrowShape:
Collaboration graph
[legend]

Classes

struct  Properties
 

Public Member Functions

 ArrowShape (const Eigen::Vector3d &_tail, const Eigen::Vector3d &_head, const Properties &_properties=Properties(), const Eigen::Vector4d &_color=Eigen::Vector4d(0.5, 0.5, 1.0, 1.0), std::size_t _resolution=10)
 This will produce an arrow that reaches from _tail to _head with the given properties. More...
 
void setPositions (const Eigen::Vector3d &_tail, const Eigen::Vector3d &_head)
 Set the positions of the tail and head of the arrow without changing any settings.
 
const Eigen::Vector3d & getTail () const
 Get the location of the tail of this arrow.
 
const Eigen::Vector3d & getHead () const
 Get the location of the head of this arrow.
 
void setProperties (const Properties &_properties)
 Set the properties of this arrow.
 
void notifyColorUpdated (const Eigen::Vector4d &_color) override
 Set the color of this arrow.
 
const PropertiesgetProperties () const
 Get the properties of this arrow.
 
void configureArrow (const Eigen::Vector3d &_tail, const Eigen::Vector3d &_head, const Properties &_properties)
 
- Public Member Functions inherited from dart::dynamics::MeshShape
 MeshShape (const Eigen::Vector3d &scale, const aiScene *mesh, const common::Uri &uri="", common::ResourceRetrieverPtr resourceRetriever=nullptr)
 Constructor.
 
 ~MeshShape () override
 Destructor.
 
const std::string & getType () const override
 Returns a string representing the shape type. More...
 
const aiScene * getMesh () const
 
virtual void update ()
 Updates positions of the vertices or the elements. More...
 
void setMesh (const aiScene *mesh, const std::string &path="", common::ResourceRetrieverPtr resourceRetriever=nullptr)
 
void setMesh (const aiScene *mesh, const common::Uri &path, common::ResourceRetrieverPtr resourceRetriever=nullptr)
 
std::string getMeshUri () const
 Returns URI to the mesh as std::string; an empty string if unavailable.
 
const common::UrigetMeshUri2 () const
 Returns URI to the mesh; an empty string if unavailable.
 
const std::string & getMeshPath () const
 Returns path to the mesh on disk; an empty string if unavailable.
 
common::ResourceRetrieverPtr getResourceRetriever ()
 
void setScale (const Eigen::Vector3d &scale)
 
const Eigen::Vector3d & getScale () const
 
void setColorMode (ColorMode mode)
 Set how the color of this mesh should be determined.
 
ColorMode getColorMode () const
 Get the coloring mode that this mesh is using.
 
void setAlphaMode (AlphaMode mode)
 Sets how the alpha of this mesh should be determined.
 
AlphaMode getAlphaMode () const
 Returns the alpha mode that this mesh is using.
 
void setColorIndex (int index)
 Set which entry in aiMesh::mColor should be used when the color mode is COLOR_INDEX. More...
 
int getColorIndex () const
 Get the index that will be used when the ColorMode is set to COLOR_INDEX.
 
int getDisplayList () const
 
void setDisplayList (int index)
 
Eigen::Matrix3d computeInertia (double mass) const override
 Computes the inertia.
 
- Public Member Functions inherited from dart::dynamics::Shape
 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::BoundingBoxgetBoundingBox () 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.
 
- Public Member Functions inherited from dart::common::Subject
virtual ~Subject ()
 Destructor will notify all Observers that it is destructing.
 
- Public Member Functions inherited from dart::common::VersionCounter
 VersionCounter ()
 Default constructor.
 
virtual std::size_t getVersion () const
 Get the version number of this object.
 

Protected Member Functions

void instantiate (std::size_t resolution)
 
- Protected Member Functions inherited from dart::dynamics::MeshShape
void updateBoundingBox () const override
 Updates bounding box.
 
void updateVolume () const override
 Updates volume.
 
- Protected Member Functions inherited from dart::common::Subject
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.
 
- Protected Member Functions inherited from dart::common::VersionCounter
void setVersionDependentObject (VersionCounter *dependent)
 

Protected Attributes

Eigen::Vector3d mTail
 
Eigen::Vector3d mHead
 
Properties mProperties
 
- Protected Attributes inherited from dart::dynamics::MeshShape
const aiScene * mMesh
 
common::Uri mMeshUri
 URI the mesh, if available).
 
std::string mMeshPath
 Path the mesh on disk, if available.
 
common::ResourceRetrieverPtr mResourceRetriever
 Optional method of loading resources by URI.
 
int mDisplayList
 OpenGL DisplayList id for rendering.
 
Eigen::Vector3d mScale
 Scale.
 
ColorMode mColorMode
 Specifies how the color of this mesh should be determined.
 
AlphaMode mAlphaMode
 Specifies how the alpha of this mesh should be determined.
 
int mColorIndex
 Specifies which color index should be used when mColorMode is COLOR_INDEX.
 
- Protected Attributes inherited from dart::dynamics::Shape
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
 
- Protected Attributes inherited from dart::common::Subject
std::set< Observer * > mObservers
 List of current Observers.
 
- Protected Attributes inherited from dart::common::VersionCounter
std::size_t mVersion
 

Additional Inherited Members

- Public Types inherited from dart::dynamics::MeshShape
enum  ColorMode { MATERIAL_COLOR = 0, COLOR_INDEX, SHAPE_COLOR }
 
enum  AlphaMode { BLEND = 0, AUTO, SHAPE_ALPHA }
 Alpha mode to specify how the alpha of this mesh should be determined. More...
 
- Public Types inherited from dart::dynamics::Shape
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)>
 
- Static Public Member Functions inherited from dart::dynamics::MeshShape
static const std::string & getStaticType ()
 Returns shape type for this class.
 
static const aiScene * loadMesh (const std::string &filePath)
 
static const aiScene * loadMesh (const std::string &_uri, const common::ResourceRetrieverPtr &retriever)
 
static const aiScene * loadMesh (const common::Uri &uri, const common::ResourceRetrieverPtr &retriever)
 
- Public Attributes inherited from dart::dynamics::Shape
common::SlotRegister< VersionChangedSignalonVersionChanged
 Use this to subscribe to version change signals.
 
- Static Protected Attributes inherited from dart::dynamics::Shape
static std::atomic_int mCounter {PRIMITIVE_MAGIC_NUMBER}
 

Constructor & Destructor Documentation

◆ ArrowShape()

dart::dynamics::ArrowShape::ArrowShape ( const Eigen::Vector3d &  _tail,
const Eigen::Vector3d &  _head,
const Properties _properties = Properties(),
const Eigen::Vector4d &  _color = Eigen::Vector4d(0.5, 0.5, 1.0, 1.0),
std::size_t  _resolution = 10 
)

This will produce an arrow that reaches from _tail to _head with the given properties.


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