opensurgsim
DataGroup.h
1 // This file is a part of the OpenSurgSim project.
2 // Copyright 2012-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_DATAGROUP_H
17 #define SURGSIM_DATASTRUCTURES_DATAGROUP_H
18 
19 #include <Eigen/Core>
20 
21 #include "SurgSim/DataStructures/Image.h"
22 #include "SurgSim/DataStructures/NamedData.h"
23 #include "SurgSim/DataStructures/NamedVariantData.h"
25 #include "SurgSim/Math/Vector.h"
26 
27 namespace SurgSim
28 {
29 namespace DataStructures
30 {
31 
68 class DataGroup
69 {
70 public:
76  typedef Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> DynamicMatrixType;
78  typedef double ScalarType;
80  typedef int IntegerType;
82  typedef bool BooleanType;
84  typedef std::string StringType;
87 
89  DataGroup();
90 
93  DataGroup(const DataGroup& dataGroup);
94 
122  DataGroup& operator=(const DataGroup& dataGroup);
123 
131  DataGroup& operator=(DataGroup&& dataGroup);
132 
136 
139  const NamedData<PoseType>& poses() const;
140 
144 
147  const NamedData<VectorType>& vectors() const;
148 
152 
155  const NamedData<DynamicMatrixType>& matrices() const;
156 
160 
163  const NamedData<ScalarType>& scalars() const;
164 
168 
171  const NamedData<IntegerType>& integers() const;
172 
176 
179  const NamedData<BooleanType>& booleans() const;
180 
184 
187  const NamedData<StringType>& strings() const;
188 
192 
195  const NamedData<ImageType>& images() const;
196 
200 
203  const NamedVariantData& customData() const;
204 
206  void resetAll();
207 
210  bool isEmpty() const;
211 
212 private:
214  NamedData<PoseType> m_poses;
215 
217  NamedData<VectorType> m_vectors;
218 
220  NamedData<DynamicMatrixType> m_matrices;
221 
223  NamedData<ScalarType> m_scalars;
224 
226  NamedData<IntegerType> m_integers;
227 
229  NamedData<BooleanType> m_booleans;
230 
232  NamedData<StringType> m_strings;
233 
235  NamedData<ImageType> m_images;
236 
238  NamedVariantData m_customData;
239 };
240 
241 }; // namespace DataStructures
242 }; // namespace SurgSim
243 
244 #endif // SURGSIM_DATASTRUCTURES_DATAGROUP_H
Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
NamedData< DynamicMatrixType > & matrices()
Return the matrix data structure.
Definition: DataGroup.cpp:90
A NamedData collection of variant data type.
Definition: NamedVariantData.h:39
A templated Image class.
Definition: Image.h:33
Eigen::Transform< double, 3, Eigen::Isometry > RigidTransform3d
A 3D rigid (isometric) transform, represented as doubles.
Definition: RigidTransform.h:46
void resetAll()
Mark all data as not current.
Definition: DataGroup.cpp:161
NamedData< ScalarType > & scalars()
Return the scalar data structure.
Definition: DataGroup.cpp:101
SurgSim::Math::RigidTransform3d PoseType
The type used for poses.
Definition: DataGroup.h:72
double ScalarType
The type used for scalars.
Definition: DataGroup.h:78
SurgSim::Math::Vector3d VectorType
The type used for vectors.
Definition: DataGroup.h:74
NamedData< BooleanType > & booleans()
Return the boolean data structure.
Definition: DataGroup.cpp:121
NamedData< IntegerType > & integers()
Return the integer data structure.
Definition: DataGroup.cpp:111
DataGroup & operator=(const DataGroup &dataGroup)
Copy the data from another object.
Definition: DataGroup.cpp:40
Eigen::Matrix< double, 3, 1 > Vector3d
A 3D vector of doubles.
Definition: Vector.h:57
Image< float > ImageType
The type used for images.
Definition: DataGroup.h:86
NamedData< VectorType > & vectors()
Return the vector data structure.
Definition: DataGroup.cpp:80
NamedData< StringType > & strings()
Return the string data structure.
Definition: DataGroup.cpp:131
A collection of NamedData objects.
Definition: DataGroup.h:68
NamedData< PoseType > & poses()
Return the pose data structure.
Definition: DataGroup.cpp:70
Definitions of 2x2 and 3x3 rigid (isometric) transforms.
bool BooleanType
The type used for booleans.
Definition: DataGroup.h:82
Definitions of small fixed-size vector types.
DataGroup()
Construct an empty object, with no associated names and indices yet.
Definition: DataGroup.cpp:23
std::string StringType
The type used for strings.
Definition: DataGroup.h:84
NamedData< ImageType > & images()
Return the image data structure.
Definition: DataGroup.cpp:141
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > DynamicMatrixType
The type used for matrices.
Definition: DataGroup.h:76
bool isEmpty() const
An empty DataGroup can be assigned to by any DataGroup with only valid NamedData. ...
Definition: DataGroup.cpp:174
int IntegerType
The type used for integers.
Definition: DataGroup.h:80
NamedVariantData & customData()
Return the custom data structure.
Definition: DataGroup.cpp:151