opensurgsim
Public Member Functions | List of all members
SurgSim::Physics::Localization Class Referenceabstract

This class localize a point on a representation (representation specific) More...

#include <Localization.h>

Inheritance diagram for SurgSim::Physics::Localization:
SurgSim::Physics::FemLocalization SurgSim::Physics::MassSpringLocalization SurgSim::Physics::MockDeformableLocalization SurgSim::Physics::MockLocalization SurgSim::Physics::RigidLocalization SurgSim::Physics::Fem1DLocalization SurgSim::Physics::Fem2DLocalization SurgSim::Physics::Fem3DLocalization

Public Member Functions

 Localization ()
 Default constructor.
 
 Localization (std::shared_ptr< Representation > representation)
 Constructor. More...
 
virtual ~Localization ()
 Destructor.
 
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) const
 Calculates the global position of this localization. More...
 
SurgSim::Math::Vector3d calculateVelocity (double time=1.0) const
 Calculates the global velocity of this localization. More...
 
virtual bool isValidRepresentation (std::shared_ptr< Representation > representation)
 
virtual Math::RigidTransform3d getElementPose ()
 Find a pose that the localization is represented with respect to. More...
 
virtual bool moveClosestTo (const Math::Vector3d &point, bool *hasReachedEnd)
 
std::shared_ptr< Localizationcopy () const
 

Detailed Description

This class localize a point on a representation (representation specific)

Constructor & Destructor Documentation

§ Localization()

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

Constructor.

Parameters
representationThe representation on which the localization is defined

Member Function Documentation

§ calculatePosition()

Math::Vector3d SurgSim::Physics::Localization::calculatePosition ( double  time = 1.0) const

Calculates the global position of this localization.

Parameters
timeThe time in [0..1] at which the position should be calculated
Returns
The global position of the localization at the requested time
Note
time can useful when dealing with CCD
Exceptions
SurgSim::Framework::AssertionFailureif time is out-of-range [0..1]

§ calculateVelocity()

Math::Vector3d SurgSim::Physics::Localization::calculateVelocity ( double  time = 1.0) const

Calculates the global velocity of this localization.

Parameters
timeThe time in [0..1] at which the velocity should be calculated
Returns
The global velocity of the localization at the requested time
Note
time can useful when dealing with CCD
Exceptions
SurgSim::Framework::AssertionFailureif time is out-of-range [0..1]

§ copy()

std::shared_ptr< Localization > SurgSim::Physics::Localization::copy ( ) const
Returns
A copy.

§ getElementPose()

Math::RigidTransform3d SurgSim::Physics::Localization::getElementPose ( )
virtual

Find a pose that the localization is represented with respect to.

In the case of a rigid representation, the pose of the representation is the pose returned. In case of a fem representation, the pose is calculated from the fem element which this localization is a part of.

Returns
The pose that the localization is represented with respect to.

Reimplemented in SurgSim::Physics::Fem2DLocalization.

§ getRepresentation()

std::shared_ptr< Representation > SurgSim::Physics::Localization::getRepresentation ( ) const

Gets the representation.

Returns
The representation on which the localization is defined, nullptr if none has been defined

§ moveClosestTo()

bool SurgSim::Physics::Localization::moveClosestTo ( const Math::Vector3d point,
bool *  hasReachedEnd 
)
virtual
Parameters
pointMove this localization closest to this point
hasReachedEnd[out] Flag to set, when the localization reaches the end of the representation.
Returns
Whether the localization was moved or not.

Reimplemented in SurgSim::Physics::MassSpringLocalization, and SurgSim::Physics::Fem1DLocalization.

§ setRepresentation()

void SurgSim::Physics::Localization::setRepresentation ( std::shared_ptr< Representation representation)

Sets the representation.

Parameters
representationThe representation on which the localization is defined

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