Location.h
Go to the documentation of this file.
1 // This file is a part of the OpenSurgSim project.
2 // Copyright 2013, SimQuest Solutions Inc.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 
16 #ifndef SURGSIM_DATASTRUCTURES_LOCATION_H
17 #define SURGSIM_DATASTRUCTURES_LOCATION_H
18 
19 #include <vector>
20 
24 #include "SurgSim/Math/Vector.h"
25 
26 namespace SurgSim
27 {
28 namespace DataStructures
29 {
30 
31 struct Location
32 {
33 public:
36  {
37  }
38 
41  explicit Location(const SurgSim::Math::Vector3d& localPosition)
42  {
43  rigidLocalPosition.setValue(localPosition);
44  }
45 
49  {
50  octreeNodePath.setValue(nodePath);
51  }
52 
56  {
57  meshLocalCoordinate.setValue(localCoordinate);
58  }
59 
63 };
64 
65 }; // namespace DataStructures
66 }; // namespace SurgSim
67 
68 #endif // SURGSIM_DATASTRUCTURES_LOCATION_H
Definition: DriveElementFromInputBehavior.cpp:27
A generic (size_t index, Vector coordinate) pair.
Definition: IndexedLocalCoordinate.h:29
Location(const SurgSim::Math::Vector3d &localPosition)
Constructor for rigid local position.
Definition: Location.h:41
Definition: Location.h:31
SurgSim::DataStructures::OptionalValue< SurgSim::DataStructures::OctreePath > octreeNodePath
Definition: Location.h:61
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
Location()
Default constructor.
Definition: Location.h:35
SurgSim::DataStructures::OptionalValue< SurgSim::DataStructures::IndexedLocalCoordinate > meshLocalCoordinate
Definition: Location.h:62
Definitions of small fixed-size vector types.
Location(const SurgSim::DataStructures::OctreePath &nodePath)
Constructor for octree node path.
Definition: Location.h:48
void setValue(const T &val)
Set the value of this object, and mark it as valid.
Definition: OptionalValue.h:69
Location(const SurgSim::DataStructures::IndexedLocalCoordinate &localCoordinate)
Constructor for mesh local coordinate.
Definition: Location.h:55
Eigen::Matrix< double, 3, 1 > Vector3d
A 3D vector of doubles.
Definition: Vector.h:56
SurgSim::DataStructures::OptionalValue< SurgSim::Math::Vector3d > rigidLocalPosition
Definition: Location.h:60