All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DataGroup.h
Go to the documentation of this file.
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 
24 #include "SurgSim/Math/Vector.h"
25 
26 namespace SurgSim
27 {
28 namespace DataStructures
29 {
30 
66 class DataGroup
67 {
68 public:
74  typedef Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> DynamicMatrixType;
76  typedef double ScalarType;
78  typedef int IntegerType;
80  typedef bool BooleanType;
82  typedef std::string StringType;
83 
85  DataGroup();
86 
89  DataGroup(const DataGroup& dataGroup);
90 
118  DataGroup& operator=(const DataGroup& dataGroup);
119 
127  DataGroup& operator=(DataGroup&& dataGroup);
128 
132 
135  const NamedData<PoseType>& poses() const;
136 
140 
143  const NamedData<VectorType>& vectors() const;
144 
148 
151  const NamedData<DynamicMatrixType>& matrices() const;
152 
156 
159  const NamedData<ScalarType>& scalars() const;
160 
164 
167  const NamedData<IntegerType>& integers() const;
168 
172 
175  const NamedData<BooleanType>& booleans() const;
176 
180 
183  const NamedData<StringType>& strings() const;
184 
188 
191  const NamedVariantData& customData() const;
192 
194  void resetAll();
195 
198  bool isEmpty() const;
199 
200 private:
203 
206 
209 
212 
215 
218 
221 
224 };
225 
226 }; // namespace DataStructures
227 }; // namespace SurgSim
228 
229 #endif // SURGSIM_DATASTRUCTURES_DATAGROUP_H
NamedData< DynamicMatrixType > & matrices()
Return the matrix data structure.
Definition: DataGroup.cpp:87
A NamedData collection of variant data type.
Definition: NamedVariantData.h:39
void resetAll()
Mark all data as not current.
Definition: DataGroup.cpp:148
NamedData< ScalarType > & scalars()
Return the scalar data structure.
Definition: DataGroup.cpp:98
SurgSim::Math::RigidTransform3d PoseType
The type used for poses.
Definition: DataGroup.h:70
double ScalarType
The type used for scalars.
Definition: DataGroup.h:76
SurgSim::Math::Vector3d VectorType
The type used for vectors.
Definition: DataGroup.h:72
NamedData< BooleanType > & booleans()
Return the boolean data structure.
Definition: DataGroup.cpp:118
NamedData< IntegerType > & integers()
Return the integer data structure.
Definition: DataGroup.cpp:108
DataGroup & operator=(const DataGroup &dataGroup)
Copy the data from another object.
Definition: DataGroup.cpp:39
NamedData< PoseType > m_poses
The pose values.
Definition: DataGroup.h:202
NamedData< VectorType > & vectors()
Return the vector data structure.
Definition: DataGroup.cpp:77
NamedData< StringType > m_strings
The string values.
Definition: DataGroup.h:220
NamedData< DynamicMatrixType > m_matrices
The matrix values.
Definition: DataGroup.h:208
NamedData< StringType > & strings()
Return the string data structure.
Definition: DataGroup.cpp:128
NamedData< IntegerType > m_integers
The integer values.
Definition: DataGroup.h:214
NamedData< ScalarType > m_scalars
The scalar values.
Definition: DataGroup.h:211
NamedData< VectorType > m_vectors
The vector values.
Definition: DataGroup.h:205
A collection of NamedData objects.
Definition: DataGroup.h:66
NamedData< PoseType > & poses()
Return the pose data structure.
Definition: DataGroup.cpp:67
Definitions of 2x2 and 3x3 rigid (isometric) transforms.
NamedData< BooleanType > m_booleans
The boolean values.
Definition: DataGroup.h:217
Eigen::Transform< double, 3, Eigen::Isometry > RigidTransform3d
A 3D rigid (isometric) transform, represented as doubles.
Definition: RigidTransform.h:46
bool BooleanType
The type used for booleans.
Definition: DataGroup.h:80
NamedVariantData m_customData
The custom data values.
Definition: DataGroup.h:223
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:82
bool isEmpty() const
An empty DataGroup can be assigned to by any DataGroup with only valid NamedData. ...
Definition: DataGroup.cpp:160
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > DynamicMatrixType
The type used for matrices.
Definition: DataGroup.h:74
int IntegerType
The type used for integers.
Definition: DataGroup.h:78
Eigen::Matrix< double, 3, 1 > Vector3d
A 3D vector of doubles.
Definition: Vector.h:56
NamedVariantData & customData()
Return the custom data structure.
Definition: DataGroup.cpp:138