Go to the documentation of this file.
16 #ifndef SURGSIM_DATASTRUCTURES_LOCATION_H
17 #define SURGSIM_DATASTRUCTURES_LOCATION_H
28 namespace DataStructures
121 bool isApprox(
const Location& other,
double precision = std::numeric_limits<double>::epsilon())
const
130 result = (vector1.isZero(precision) && vector2.isZero(precision)) || vector1.isApprox(vector2, precision);
164 template <
typename charT,
typename traits,
typename T>
165 std::basic_ostream<charT, traits>&
operator << (std::basic_ostream<charT, traits>& out,
179 template <
typename charT,
typename traits>
180 std::basic_ostream<charT, traits>&
operator << (std::basic_ostream<charT, traits>& out,
195 template <
typename charT,
typename traits>
196 std::basic_ostream<charT, traits>&
operator << (std::basic_ostream<charT, traits>& out,
199 out <<
"[ " << val.
index <<
" : " << val.
coordinate.transpose() <<
" ]";
204 template <
typename charT,
typename traits>
205 std::basic_ostream<charT, traits>&
operator << (std::basic_ostream<charT, traits>& out,
208 out <<
"ElementMesh: " << loc.elementMeshLocalCoordinate << std::endl;
209 out <<
"Index: " << loc.index << std::endl;
210 out <<
"RigidLocal: " << loc.rigidLocalPosition << std::endl;
211 out <<
"TriangleMeshLocal: " << loc.triangleMeshLocalCoordinate << std::endl;
218 #endif // SURGSIM_DATASTRUCTURES_LOCATION_H
Definitions of small fixed-size vector types.
@ ELEMENT
Definition: Location.h:42
SurgSim::DataStructures::OptionalValue< SurgSim::Math::Vector3d > rigidLocalPosition
Definition: Location.h:156
void setValue(const T &val)
Set the value of this object, and mark it as valid.
Definition: OptionalValue.h:69
Eigen::Matrix< double, 3, 1 > Vector3d
A 3D vector of doubles.
Definition: Vector.h:57
#define SURGSIM_FAILURE()
Report that something very bad has happened and abort program execution.
Definition: Assert.h:95
Definition: CompoundShapeToGraphics.cpp:30
SurgSim::DataStructures::OptionalValue< SurgSim::DataStructures::IndexedLocalCoordinate > triangleMeshLocalCoordinate
Definition: Location.h:159
std::vector< size_t > OctreePath
Typedef of octree path The path is a vector of children indexes (each within 0 to 7) that lead to the...
Definition: OctreeNode.h:43
bool isApprox(const Location &other, double precision=std::numeric_limits< double >::epsilon()) const
Definition: Location.h:121
A generic (size_t index, Vector coordinate) pair.
Definition: IndexedLocalCoordinate.h:30
@ TRIANGLE
Definition: Location.h:42
bool hasValue() const
Query if this object has been assigned a value.
Definition: OptionalValue.h:56
Location(const SurgSim::Math::Vector3d &localPosition)
Constructor for rigid local position.
Definition: Location.h:61
Location()
Default constructor.
Definition: Location.h:45
Location(const SurgSim::DataStructures::OctreePath &nodePath)
Constructor for octree node path.
Definition: Location.h:68
Location(const Location &other)
Copy constructor.
Definition: Location.h:51
const T & getValue() const
Gets the value.
Definition: OptionalValue.h:78
A Location defines a local position w.r.t.
Definition: Location.h:40
size_t index
Numeric index to indicate the entity w.r.t which the barycentricCoordinate is defined.
Definition: IndexedLocalCoordinate.h:41
std::basic_ostream< charT, traits > & operator<<(std::basic_ostream< charT, traits > &out, const SurgSim::DataStructures::OptionalValue< T > &val)
Definition: Location.h:165
Location(const SurgSim::DataStructures::IndexedLocalCoordinate &localCoordinate, Type meshType)
Constructor for mesh-based location.
Definition: Location.h:83
SurgSim::DataStructures::OptionalValue< size_t > index
Definition: Location.h:158
Location(const size_t val)
Constructor for an index.
Definition: Location.h:75
SurgSim::Math::Vector coordinate
Coordinates with respect to the entity identified by the index.
Definition: IndexedLocalCoordinate.h:44
SurgSim::DataStructures::OptionalValue< SurgSim::DataStructures::OctreePath > octreeNodePath
Definition: Location.h:157
const SurgSim::DataStructures::OptionalValue< SurgSim::DataStructures::IndexedLocalCoordinate > & get(Type meshType)
Gives access to the coordinates via enum rather than '.
Definition: Location.h:103
bool isApprox(const IndexedLocalCoordinate &other, double precision=std::numeric_limits< double >::epsilon()) const
Comparison method 'isApprox'.
Definition: IndexedLocalCoordinate.cpp:33
Type
Definition: Location.h:42
SurgSim::DataStructures::OptionalValue< SurgSim::DataStructures::IndexedLocalCoordinate > elementMeshLocalCoordinate
Definition: Location.h:160