SurgSim::DataStructures::Location Struct Reference

A Location defines a local position w.r.t. More...

`#include <SurgSim/DataStructures/Location.h>`

## Public Types

enum | Type { TRIANGLE, ELEMENT }

## Public Member Functions

| Location ()
| Default constructor. More...
| Location (const Location &other)
| Copy constructor. More...
| Location (const SurgSim::Math::Vector3d &localPosition)
| Constructor for rigid local position. More...
| Location (const SurgSim::DataStructures::OctreePath &nodePath)
| Constructor for octree node path. More...
| Location (const size_t val)
| Constructor for an index. More...
| Location (const SurgSim::DataStructures::IndexedLocalCoordinate &localCoordinate, Type meshType)
| Constructor for mesh-based location. More...
const SurgSim::DataStructures::OptionalValue< SurgSim::DataStructures::IndexedLocalCoordinate > & | get (Type meshType)
| Gives access to the coordinates via enum rather than '. More...
bool | isApprox (const Location &other, double precision=std::numeric_limits< double >::epsilon()) const

## Public Attributes

SurgSim::DataStructures::OptionalValue< SurgSim::Math::Vector3d > | rigidLocalPosition
SurgSim::DataStructures::OptionalValue< SurgSim::DataStructures::OctreePath > | octreeNodePath
SurgSim::DataStructures::OptionalValue< size_t > | index
SurgSim::DataStructures::OptionalValue< SurgSim::DataStructures::IndexedLocalCoordinate > | triangleMeshLocalCoordinate
SurgSim::DataStructures::OptionalValue< SurgSim::DataStructures::IndexedLocalCoordinate > | elementMeshLocalCoordinate

## Detailed Description

A Location defines a local position w.r.t.

any shape. Depending on the type of shape, different data is needed to specify a location on it. This structure supports:

- Any rigid shape (location identified by a local position)
- Octree (location identified by an octree path)
- Index (location indentified by an index)
- A triangle mesh (location identified by the triangle id, and the barycentric coordinate of a point in it)
- A node in a mesh (location identified by the node id)
- An element in a mesh (location identified by the element id, and the barycentric coordinate of a point in it)

## Member Enumeration Documentation

## Type

enum SurgSim::DataStructures::Location::Type

Enumerator
TRIANGLE |
ELEMENT |

## Constructor & Destructor Documentation

## Location() [1/6]

SurgSim::DataStructures::Location::Location | ( |  | ) |

inline

Default constructor.

## Location() [2/6]

SurgSim::DataStructures::Location::Location | ( | const Location & | other | ) |

inline

Copy constructor.

Parameters

  other | The location to be copied while constructing.

## Location() [3/6]

SurgSim::DataStructures::Location::Location | ( | const SurgSim::Math::Vector3d & | localPosition | ) |

inline explicit

Constructor for rigid local position.

Parameters

  localPosition | The 3D local position to set this location to

## Location() [4/6]

SurgSim::DataStructures::Location::Location | ( | const SurgSim::DataStructures::OctreePath & | nodePath | ) |

inline explicit

Constructor for octree node path.

Parameters

  nodePath | The octree node path to set this location to

## Location() [5/6]

SurgSim::DataStructures::Location::Location | ( | const size_t | val | ) |

inline explicit

Constructor for an index.

Parameters

  val | The index to set this location to

## Location() [6/6]

SurgSim::DataStructures::Location::Location | ( | const SurgSim::DataStructures::IndexedLocalCoordinate & | localCoordinate,
|  | Type | meshType
| ) |  |

inline

Constructor for mesh-based location.

Parameters

  localCoordinate | index-based local coordinate
  meshType | the type of location (a node, a triangle or an element)

## Member Function Documentation

## get()

const SurgSim::DataStructures::OptionalValue<SurgSim::DataStructures::IndexedLocalCoordinate>& SurgSim::DataStructures::Location::get | ( | Type | meshType | ) |

inline

Gives access to the coordinates via enum rather than '.

' public member access, this can reduce complexity in the calling code

Parameters

  meshType | (TRIANGLE or ELEMENT)

Returns
  the appropriate coordinate for the type of mesh

## isApprox()

bool SurgSim::DataStructures::Location::isApprox | ( | const Location & | other,
|  | double | precision = `std::numeric_limits<double>::epsilon()`
| ) |  | const

inline

## Member Data Documentation

## elementMeshLocalCoordinate

SurgSim::DataStructures::OptionalValue<SurgSim::DataStructures::IndexedLocalCoordinate> SurgSim::DataStructures::Location::elementMeshLocalCoordinate

## index

SurgSim::DataStructures::OptionalValue<size_t> SurgSim::DataStructures::Location::index

## octreeNodePath

SurgSim::DataStructures::OptionalValue<SurgSim::DataStructures::OctreePath> SurgSim::DataStructures::Location::octreeNodePath

## rigidLocalPosition

SurgSim::DataStructures::OptionalValue<SurgSim::Math::Vector3d> SurgSim::DataStructures::Location::rigidLocalPosition

## triangleMeshLocalCoordinate

SurgSim::DataStructures::OptionalValue<SurgSim::DataStructures::IndexedLocalCoordinate> SurgSim::DataStructures::Location::triangleMeshLocalCoordinate

The documentation for this struct was generated from the following file:

- SurgSim/DataStructures/Location.h