opensurgsim
Public Member Functions | List of all members
SurgSim::Math::ParticlesShape Class Reference

Particles Shape: A shape consisting of a group of particles of equal radius. More...

#include <ParticlesShape.h>

Inheritance diagram for SurgSim::Math::ParticlesShape:
SurgSim::Math::VerticesShape SurgSim::DataStructures::Vertices< DataStructures::EmptyData > SurgSim::Math::Shape SurgSim::Framework::Accessible SurgSim::Framework::FactoryBase< Shape >

Public Member Functions

 ParticlesShape (double radius=0.0)
 Constructor. More...
 
 ParticlesShape (const ParticlesShape &other)
 Copy constructor. More...
 
template<class V >
 ParticlesShape (const SurgSim::DataStructures::Vertices< V > &other)
 Copy constructor from another Vertices type. More...
 
template<class V >
ParticlesShapeoperator= (const Vertices< V > &other)
 Assignment when the template data is a different type. More...
 
 SURGSIM_CLASSNAME (SurgSim::Math::ParticlesShape)
 
const std::shared_ptr< const SurgSim::DataStructures::AabbTreegetAabbTree () const
 Get the AabbTree. More...
 
void setRadius (double radius)
 Set the particles' radius. More...
 
double getRadius () const
 Get the radius of the particles. More...
 
int getType () const override
 
double getVolume () const override
 Get the volume of the shape. More...
 
Vector3d getCenter () const override
 Get the volumetric center of the shape. More...
 
Matrix33d getSecondMomentOfVolume () const override
 Get the second central moment of the volume, commonly used to calculate the moment of inertia matrix. More...
 
std::shared_ptr< ShapegetTransformed (const RigidTransform3d &pose) const override
 Get a copy of this shape with an applied rigid transform. More...
 
bool isValid () const override
 Check if the shape is valid. More...
 
const Math::Aabbd & getBoundingBox () const override
 
void setPose (const RigidTransform3d &pose) override
 Set the pose on a transformable shape. More...
 
void updateShape () override
 Update the internals of a transformable shape.
 
void updateShapePartial () override
 Update some of the internals of a transformable shape. More...
 
template<class V >
ParticlesShapeoperator= (const SurgSim::DataStructures::Vertices< V > &other)
 
- Public Member Functions inherited from SurgSim::Math::VerticesShape
bool isTransformable () const override
 
void setInitialVertices (const DataStructures::Vertices< DataStructures::EmptyData > &vertices)
 Set the initial Vertices. More...
 
void setInitialVertices (DataStructures::Vertices< DataStructures::EmptyData > &&vertices)
 Set the initial Vertices via r-value. More...
 
const DataStructures::Vertices< DataStructures::EmptyData > & getInitialVertices () const
 Get the initial Vertices. More...
 
- Public Member Functions inherited from SurgSim::Math::Shape
 Shape ()
 Constructor.
 
virtual ~Shape ()
 Destructor.
 
virtual std::string getClassName () const
 Get class name.
 
- Public Member Functions inherited from SurgSim::Framework::Accessible
 Accessible ()
 Default Constructor.
 
 ~Accessible ()
 Destructor.
 
template<class T >
getValue (const std::string &name) const
 Retrieves the value with the name by executing the getter if it is found and tries to convert it to the given type. More...
 
boost::any getValue (const std::string &name) const
 Retrieves the value with the name by executing the getter if it is found. More...
 
template<class T >
bool getValue (const std::string &name, T *value) const
 Retrieves the value with the name by executing the getter if it is found, and converts it to the type of the output parameter. More...
 
void setValue (const std::string &name, const boost::any &value)
 Sets a value of a property that has setter. More...
 
bool isReadable (const std::string &name) const
 Check whether a property is readable. More...
 
bool isWriteable (const std::string &name) const
 Check whether a property is writable. More...
 
void setGetter (const std::string &name, GetterType func)
 Sets a getter for a given property. More...
 
void setSetter (const std::string &name, SetterType func)
 Sets a setter for a given property. More...
 
void setAccessors (const std::string &name, GetterType getter, SetterType setter)
 Sets the accessors getter and setter in one function. More...
 
void removeAccessors (const std::string &name)
 Removes all the accessors (getter and setter) for a given property. More...
 
void forwardProperty (const std::string &name, const Accessible &target, const std::string &targetProperty)
 Adds a property with the given name that uses the targets accessors, in effect forwarding the value to the target. More...
 
void setSerializable (const std::string &name, EncoderType encoder, DecoderType decoder)
 Sets the functions used to convert data from and to a YAML::Node. More...
 
void setDecoder (const std::string &name, DecoderType decoder)
 Sets the functions used to convert data from a YAML::Node. More...
 
YAML::Node encode () const
 Encode this Accessible to a YAML::Node. More...
 
void decode (const YAML::Node &node, const std::vector< std::string > &ignoredProperties=std::vector< std::string >())
 Decode this Accessible from a YAML::Node, will throw an exception if the data type cannot be converted. More...
 
std::vector< std::string > getProperties ()
 
template<>
boost::any getValue (const std::string &name) const
 
- Public Member Functions inherited from SurgSim::DataStructures::Vertices< DataStructures::EmptyData >
 Vertices ()
 Constructor.
 
 Vertices (const Vertices< V > &other)
 Copy constructor when the template data is a different type In this case, no data will be copied. More...
 
Vertices< DataStructures::EmptyData > & operator= (const Vertices< V > &other)
 Assignment when the template data is a different type In this case, no data will be copied. More...
 
virtual ~Vertices ()
 Destructor.
 
void clear ()
 Clear mesh to return to an empty state (no vertices).
 
bool update ()
 Performs any updates that are required when the vertices are modified. More...
 
size_t addVertex (const VertexType &vertex)
 Adds a vertex to the mesh. More...
 
size_t getNumVertices () const
 Returns the number of vertices in this mesh.
 
const VertexTypegetVertex (size_t id) const
 Returns the specified vertex.
 
VertexTypegetVertex (size_t id)
 Returns the specified vertex (non const version).
 
const std::vector< VertexType > & getVertices () const
 Returns a vector containing the position of each vertex.
 
std::vector< VertexType > & getVertices ()
 Returns a vector containing the position of each vertex (non const version).
 
void setVertexPosition (size_t id, const SurgSim::Math::Vector3d &position)
 Sets the position of a vertex. More...
 
const SurgSim::Math::Vector3dgetVertexPosition (size_t id) const
 Returns the position of a vertex. More...
 
void setVertexPositions (const std::vector< SurgSim::Math::Vector3d > &positions, bool doUpdate=true)
 Sets the position of each vertex. More...
 
void transform (const Math::RigidTransform3d &pose)
 Apply a rigid transform to each vertex. More...
 
bool operator== (const Vertices &mesh) const
 Compares the mesh with another one (equality) More...
 
bool operator!= (const Vertices &mesh) const
 Compares the mesh with another one (inequality) More...
 

Additional Inherited Members

- Public Types inherited from SurgSim::Math::Shape
typedef ::SurgSim::Math::Vector3d Vector3d
 
typedef ::SurgSim::Math::Matrix33d Matrix33d
 
- Public Types inherited from SurgSim::Framework::Accessible
typedef std::function< boost::any(void)> GetterType
 
typedef std::function< void(boost::any)> SetterType
 
typedef std::function< YAML::Node(void)> EncoderType
 
typedef std::function< void(const YAML::Node *)> DecoderType
 
- Public Types inherited from SurgSim::Framework::FactoryBase< Shape >
typedef ObjectFactory< Shape > FactoryType
 
- Public Types inherited from SurgSim::DataStructures::Vertices< DataStructures::EmptyData >
typedef Vertex< DataStructures::EmptyDataVertexType
 Vertex type for convenience.
 
- Static Public Member Functions inherited from SurgSim::Framework::FactoryBase< Shape >
static FactoryTypegetFactory ()
 
- Protected Member Functions inherited from SurgSim::DataStructures::Vertices< DataStructures::EmptyData >
virtual void doClearVertices ()
 Remove all vertices from the mesh.
 
virtual bool isEqual (const Vertices &mesh) const
 Internal comparison of meshes of the same type: returns true if equal, false if not equal. More...
 
- Protected Attributes inherited from SurgSim::Math::VerticesShape
DataStructures::Vertices< DataStructures::EmptyDatam_initialVertices
 The initial vertex positions.
 
- Protected Attributes inherited from SurgSim::Math::Shape
Math::Aabbd m_aabb
 

Detailed Description

Particles Shape: A shape consisting of a group of particles of equal radius.

Constructor & Destructor Documentation

§ ParticlesShape() [1/3]

SurgSim::Math::ParticlesShape::ParticlesShape ( double  radius = 0.0)
explicit

Constructor.

Parameters
radiusThe particles' radius (in m)

§ ParticlesShape() [2/3]

SurgSim::Math::ParticlesShape::ParticlesShape ( const ParticlesShape other)
explicit

Copy constructor.

Parameters
otherThe ParticleShape to be copied from

§ ParticlesShape() [3/3]

template<class V >
SurgSim::Math::ParticlesShape::ParticlesShape ( const SurgSim::DataStructures::Vertices< V > &  other)
explicit

Copy constructor from another Vertices type.

Template Parameters
Vtype of data stored in the other vertices
Parameters
otherThe vertices to be copied from. Vertex data will not be copied

Member Function Documentation

§ getAabbTree()

const std::shared_ptr< const SurgSim::DataStructures::AabbTree > SurgSim::Math::ParticlesShape::getAabbTree ( ) const

Get the AabbTree.

Returns
The object's associated AabbTree

§ getBoundingBox()

const Math::Aabbd & SurgSim::Math::ParticlesShape::getBoundingBox ( ) const
overridevirtual
Returns
the bounding box for the shape

Reimplemented from SurgSim::Math::Shape.

§ getCenter()

Vector3d SurgSim::Math::ParticlesShape::getCenter ( ) const
overridevirtual

Get the volumetric center of the shape.

Returns
The center of the shape

Implements SurgSim::Math::Shape.

§ getRadius()

double SurgSim::Math::ParticlesShape::getRadius ( ) const

Get the radius of the particles.

Returns
The particles' radius

§ getSecondMomentOfVolume()

Matrix33d SurgSim::Math::ParticlesShape::getSecondMomentOfVolume ( ) const
overridevirtual

Get the second central moment of the volume, commonly used to calculate the moment of inertia matrix.

Returns
The 3x3 symmetric second moment matrix

Implements SurgSim::Math::Shape.

§ getTransformed()

std::shared_ptr< Shape > SurgSim::Math::ParticlesShape::getTransformed ( const RigidTransform3d pose) const
overridevirtual

Get a copy of this shape with an applied rigid transform.

Parameters
poseThe pose to transform the shape by
Returns
the posed shape

Reimplemented from SurgSim::Math::Shape.

§ getType()

int SurgSim::Math::ParticlesShape::getType ( ) const
overridevirtual
Returns
the type of shape

Implements SurgSim::Math::Shape.

§ getVolume()

double SurgSim::Math::ParticlesShape::getVolume ( ) const
overridevirtual

Get the volume of the shape.

Returns
The volume of the shape (in m-3)

Implements SurgSim::Math::Shape.

§ isValid()

bool SurgSim::Math::ParticlesShape::isValid ( ) const
overridevirtual

Check if the shape is valid.

Returns
True if shape is valid; Otherwise, false.

Implements SurgSim::Math::Shape.

§ operator=()

template<class V >
ParticlesShape& SurgSim::Math::ParticlesShape::operator= ( const Vertices< V > &  other)

Assignment when the template data is a different type.

Template Parameters
Vtype of data stored in the other Vertices
Parameters
otherthe Vertices to copy from

§ setPose()

void SurgSim::Math::ParticlesShape::setPose ( const RigidTransform3d pose)
overridevirtual

Set the pose on a transformable shape.

Parameters
poseThe pose to transform the shape by.

Reimplemented from SurgSim::Math::Shape.

§ setRadius()

void SurgSim::Math::ParticlesShape::setRadius ( double  radius)

Set the particles' radius.

Parameters
radiusthe radius being set to all particles

§ updateShapePartial()

void SurgSim::Math::ParticlesShape::updateShapePartial ( )
overridevirtual

Update some of the internals of a transformable shape.

Only called if the AABB has not changed much.

Reimplemented from SurgSim::Math::Shape.


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