SurgSim::Physics::FemLocalization Class Reference

Implementation of Localization for Fem3DRepresentation. More...

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

Inheritance diagram for SurgSim::Physics::FemLocalization:

## Public Member Functions

| FemLocalization (std::shared_ptr< Representation > representation, const SurgSim::DataStructures::IndexedLocalCoordinate &localPosition)
| Constructor. More...
virtual | ~FemLocalization ()
| Destructor. More...
void | setLocalPosition (const SurgSim::DataStructures::IndexedLocalCoordinate &localPosition)
| Sets the local position. More...
const SurgSim::DataStructures::IndexedLocalCoordinate & | getLocalPosition () const
| Gets the local position. 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< 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

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

## Private Attributes

SurgSim::DataStructures::IndexedLocalCoordinate | m_position
| Barycentric position in local coordinates. More...

## Detailed Description

Implementation of Localization for Fem3DRepresentation.

FemLocalization tracks the global coordinates of an IndexedLocalCoordinate associated with an FemRepresentation. The IndexedLocalCoordinate must be related to an FemElement (the index is an FemElement id and the local coordinates are the barycentric coordinates of the nodes in this FemElement). It is used, for example, as a helper class for filling out the MlcpPhysicsProblem in Fem3DRepresentationContact::doBuild, which constrains the motion of Fem3DRepresentation at a frictionless contact.

## Constructor & Destructor Documentation

## FemLocalization()

SurgSim::Physics::FemLocalization::FemLocalization | ( | std::shared_ptr< Representation > | representation,
|  | const SurgSim::DataStructures::IndexedLocalCoordinate & | localPosition
| ) |  |

Constructor.

Parameters

  representation | The representation to assign to this localization.
  localPosition | The local position to set the localization at.

## ~FemLocalization()

SurgSim::Physics::FemLocalization::~FemLocalization | ( |  | ) |

virtual

Destructor.

## Member Function Documentation

## doCalculatePosition()

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

override private 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

Implements SurgSim::Physics::Localization.

## doCalculateVelocity()

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

override private 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

Implements SurgSim::Physics::Localization.

## getLocalPosition()

const SurgSim::DataStructures::IndexedLocalCoordinate & SurgSim::Physics::FemLocalization::getLocalPosition | ( |  | ) | const

Gets the local position.

Returns
  The local position set for this localization.

## setLocalPosition()

void SurgSim::Physics::FemLocalization::setLocalPosition | ( | const SurgSim::DataStructures::IndexedLocalCoordinate & | localPosition | ) |

Sets the local position.

Parameters

  localPosition | The local position to set the localization at.

## Member Data Documentation

## m_position

SurgSim::DataStructures::IndexedLocalCoordinate SurgSim::Physics::FemLocalization::m_position

private

Barycentric position in local coordinates.

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

- SurgSim/Physics/FemLocalization.h
- SurgSim/Physics/FemLocalization.cpp