Public Member Functions | Private Member Functions | Private Attributes | List of all members
SurgSim::Physics::MassSpringRepresentationLocalization Class Reference

Implementation of Localization for MassSpringRepresentation. More...

#include <SurgSim/Physics/MassSpringRepresentationLocalization.h>

Inheritance diagram for SurgSim::Physics::MassSpringRepresentationLocalization:
SurgSim::Physics::Localization

Public Member Functions

 MassSpringRepresentationLocalization ()
 Default constructor. More...
 
 MassSpringRepresentationLocalization (std::shared_ptr< Representation > representation)
 Constructor. More...
 
virtual ~MassSpringRepresentationLocalization ()
 Destructor. More...
 
void setLocalNode (size_t nodeID)
 Sets the local node. More...
 
const size_t & getLocalNode () const
 Gets the local node. More...
 
virtual bool isValidRepresentation (std::shared_ptr< Representation > representation) override
 Queries whether Representation can be assigned to this class. More...
 
- Public Member Functions inherited from SurgSim::Physics::Localization
 Localization ()
 Default constructor. More...
 
 Localization (std::shared_ptr< Representation > representation)
 Constructor. More...
 
virtual ~Localization ()
 Destructor. More...
 
void setRepresentation (std::shared_ptr< Representation > representation)
 Sets the representation. More...
 
std::shared_ptr< RepresentationgetRepresentation () const
 Gets the representation. More...
 
SurgSim::Math::Vector3d calculatePosition (double time=1.0)
 Calculates the global position of this localization. More...
 

Private Member Functions

virtual SurgSim::Math::Vector3d doCalculatePosition (double time) override
 Calculates the global position of this localization. More...
 

Private Attributes

size_t m_nodeID
 Node defining the localization. More...
 

Detailed Description

Implementation of Localization for MassSpringRepresentation.

MassSpringRepresentationLocalization tracks the global coordinates of a node contained in an associated MassSpringRepresentation. It is used, for example, as a helper class for filling out the MlcpPhysicsProblem in MassSpringRepresentationContact::doBuild, which constrains the motion of MassSpringRepresentation at a frictionless contact.

MassSpringRepresentationLocalization stores a pointer to a MassSpringRepresentation in an abstract Representation object. It tracks the ID of a node contained within the associated MassSpringRepresentation, and it provides a helper function MassSpringRepresentationLocalization::calculatePosition to find the node's position in global coordinates in the current state.

Constructor & Destructor Documentation

SurgSim::Physics::MassSpringRepresentationLocalization::MassSpringRepresentationLocalization ( )

Default constructor.

SurgSim::Physics::MassSpringRepresentationLocalization::MassSpringRepresentationLocalization ( std::shared_ptr< Representation representation)
explicit

Constructor.

Parameters
representationThe representation to assign to this localization.
SurgSim::Physics::MassSpringRepresentationLocalization::~MassSpringRepresentationLocalization ( )
virtual

Destructor.

Member Function Documentation

SurgSim::Math::Vector3d SurgSim::Physics::MassSpringRepresentationLocalization::doCalculatePosition ( double  time)
overrideprivatevirtual

Calculates the global position of this localization.

Parameters
timeInterpolation parameter [0..1] for calcuting position between the previous state (0.0) and current state (1.0).
Returns
The global position of the localization using an interpolation between the previous and current states.
Note
The time parameter can useful when dealing with Continuous Collision Detection.

Implements SurgSim::Physics::Localization.

const size_t & SurgSim::Physics::MassSpringRepresentationLocalization::getLocalNode ( ) const

Gets the local node.

Returns
Node set for this localization.
bool SurgSim::Physics::MassSpringRepresentationLocalization::isValidRepresentation ( std::shared_ptr< Representation representation)
overridevirtual

Queries whether Representation can be assigned to this class.

Parameters
representationRepresentation to check.
Returns
true if Representation is valid.

Reimplemented from SurgSim::Physics::Localization.

void SurgSim::Physics::MassSpringRepresentationLocalization::setLocalNode ( size_t  nodeID)

Sets the local node.

Parameters
nodeIDNode set for this localization.

Member Data Documentation

size_t SurgSim::Physics::MassSpringRepresentationLocalization::m_nodeID
private

Node defining the localization.


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