SurgSim::Physics::Localization Class Referenceabstract

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

`#include <SurgSim/Physics/Localization.h>`

Inheritance diagram for SurgSim::Physics::Localization:

## Public Member Functions

| 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< Representation > | getRepresentation () 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)

## Private Member Functions

virtual SurgSim::Math::Vector3d | doCalculatePosition (double time) const =0
| Calculates the global position of this localization. More...
virtual SurgSim::Math::Vector3d | doCalculateVelocity (double time) const =0
| Calculates the global velocity of this localization. More...

## Private Attributes

std::shared_ptr< Representation > | m_representation
| The representation on which the localization is defined. More...

## Detailed Description

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

## Constructor & Destructor Documentation

## Localization() [1/2]

SurgSim::Physics::Localization::Localization | ( |  | ) |

Default constructor.

## Localization() [2/2]

SurgSim::Physics::Localization::Localization | ( | std::shared_ptr< Representation > | representation | ) |

explicit

Constructor.

Parameters

  representation | The representation on which the localization is defined

## ~Localization()

SurgSim::Physics::Localization::~Localization | ( |  | ) |

virtual

Destructor.

## Member Function Documentation

## calculatePosition()

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

Calculates the global position of this localization.

Parameters

  time | The 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::AssertionFailure | if 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

  time | The 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::AssertionFailure | if time is out-of-range [0..1]

## doCalculatePosition()

virtual SurgSim::Math::Vector3d SurgSim::Physics::Localization::doCalculatePosition | ( | double | time | ) | const

private pure virtual

Calculates the global position of this localization.

Parameters

  time | The 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

Implemented in SurgSim::Physics::MassSpringLocalization, SurgSim::Physics::RigidLocalization, and SurgSim::Physics::FemLocalization.

## doCalculateVelocity()

virtual SurgSim::Math::Vector3d SurgSim::Physics::Localization::doCalculateVelocity | ( | double | time | ) | const

private pure virtual

Calculates the global velocity of this localization.

Parameters

  time | The 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

Implemented in SurgSim::Physics::MassSpringLocalization, SurgSim::Physics::RigidLocalization, and SurgSim::Physics::FemLocalization.

## 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

## isValidRepresentation()

bool SurgSim::Physics::Localization::isValidRepresentation | ( | std::shared_ptr< Representation > | representation | ) |

virtual

Reimplemented in SurgSim::Physics::MassSpringLocalization, SurgSim::Physics::RigidLocalization, SurgSim::Physics::Fem3DLocalization, SurgSim::Physics::Fem2DLocalization, and SurgSim::Physics::Fem1DLocalization.

## moveClosestTo()

bool SurgSim::Physics::Localization::moveClosestTo | ( | const Math::Vector3d & | point,
|  | bool * | hasReachedEnd
| ) |  |

virtual

Parameters

  point | Move 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::Fem1DLocalization.

## setRepresentation()

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

Sets the representation.

Parameters

  representation | The representation on which the localization is defined

## Member Data Documentation

## m_representation

std::shared_ptr<Representation> SurgSim::Physics::Localization::m_representation

private

The representation on which the localization is defined.

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

- SurgSim/Physics/Localization.h
- SurgSim/Physics/Localization.cpp