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 
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:
215 
218 
221 
224 
227 
230 
233 
236 
239 };
240 
241 }; // namespace DataStructures
242 }; // namespace SurgSim
243 
244 #endif // SURGSIM_DATASTRUCTURES_DATAGROUP_H
NamedVariantData.h
SurgSim::DataStructures::DataGroup::DynamicMatrixType
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > DynamicMatrixType
The type used for matrices.
Definition: DataGroup.h:76
SurgSim::DataStructures::DataGroup::integers
NamedData< IntegerType > & integers()
Return the integer data structure.
Definition: DataGroup.cpp:111
SurgSim::DataStructures::DataGroup::isEmpty
bool isEmpty() const
An empty DataGroup can be assigned to by any DataGroup with only valid NamedData.
Definition: DataGroup.cpp:174
SurgSim::DataStructures::DataGroup::m_strings
NamedData< StringType > m_strings
The string values.
Definition: DataGroup.h:232
SurgSim::DataStructures::DataGroup::matrices
NamedData< DynamicMatrixType > & matrices()
Return the matrix data structure.
Definition: DataGroup.cpp:90
SurgSim::DataStructures::DataGroup::vectors
NamedData< VectorType > & vectors()
Return the vector data structure.
Definition: DataGroup.cpp:80
Vector.h
SurgSim::DataStructures::DataGroup::images
NamedData< ImageType > & images()
Return the image data structure.
Definition: DataGroup.cpp:141
SurgSim::DataStructures::DataGroup::m_images
NamedData< ImageType > m_images
The string values.
Definition: DataGroup.h:235
NamedData.h
SurgSim::Math::RigidTransform3d
Eigen::Transform< double, 3, Eigen::Isometry > RigidTransform3d
A 3D rigid (isometric) transform, represented as doubles.
Definition: RigidTransform.h:46
SurgSim::DataStructures::DataGroup::PoseType
SurgSim::Math::RigidTransform3d PoseType
The type used for poses.
Definition: DataGroup.h:72
SurgSim::DataStructures::DataGroup::BooleanType
bool BooleanType
The type used for booleans.
Definition: DataGroup.h:82
SurgSim::DataStructures::DataGroup::m_customData
NamedVariantData m_customData
The custom data values.
Definition: DataGroup.h:238
SurgSim::DataStructures::DataGroup::operator=
DataGroup & operator=(const DataGroup &dataGroup)
Copy the data from another object.
Definition: DataGroup.cpp:40
SurgSim::Math::Vector3d
Eigen::Matrix< double, 3, 1 > Vector3d
A 3D vector of doubles.
Definition: Vector.h:57
SurgSim::DataStructures::DataGroup::m_poses
NamedData< PoseType > m_poses
The pose values.
Definition: DataGroup.h:214
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::DataStructures::DataGroup::StringType
std::string StringType
The type used for strings.
Definition: DataGroup.h:84
SurgSim::DataStructures::DataGroup::booleans
NamedData< BooleanType > & booleans()
Return the boolean data structure.
Definition: DataGroup.cpp:121
SurgSim::DataStructures::DataGroup::IntegerType
int IntegerType
The type used for integers.
Definition: DataGroup.h:80
SurgSim::DataStructures::DataGroup
A collection of NamedData objects.
Definition: DataGroup.h:68
SurgSim::DataStructures::DataGroup::m_scalars
NamedData< ScalarType > m_scalars
The scalar values.
Definition: DataGroup.h:223
SurgSim::DataStructures::DataGroup::m_vectors
NamedData< VectorType > m_vectors
The vector values.
Definition: DataGroup.h:217
SurgSim::DataStructures::DataGroup::resetAll
void resetAll()
Mark all data as not current.
Definition: DataGroup.cpp:161
SurgSim::DataStructures::NamedData< PoseType >
SurgSim::DataStructures::DataGroup::DataGroup
DataGroup()
Construct an empty object, with no associated names and indices yet.
Definition: DataGroup.cpp:23
SurgSim::DataStructures::DataGroup::m_booleans
NamedData< BooleanType > m_booleans
The boolean values.
Definition: DataGroup.h:229
RigidTransform.h
Image.h
SurgSim::DataStructures::DataGroup::ScalarType
double ScalarType
The type used for scalars.
Definition: DataGroup.h:78
SurgSim::DataStructures::DataGroup::strings
NamedData< StringType > & strings()
Return the string data structure.
Definition: DataGroup.cpp:131
SurgSim::DataStructures::DataGroup::poses
NamedData< PoseType > & poses()
Return the pose data structure.
Definition: DataGroup.cpp:70
SurgSim::DataStructures::DataGroup::customData
NamedVariantData & customData()
Return the custom data structure.
Definition: DataGroup.cpp:151
SurgSim::DataStructures::NamedVariantData
A NamedData collection of variant data type.
Definition: NamedVariantData.h:39
SurgSim::DataStructures::DataGroup::scalars
NamedData< ScalarType > & scalars()
Return the scalar data structure.
Definition: DataGroup.cpp:101
SurgSim::DataStructures::DataGroup::VectorType
SurgSim::Math::Vector3d VectorType
The type used for vectors.
Definition: DataGroup.h:74
SurgSim::DataStructures::DataGroup::m_matrices
NamedData< DynamicMatrixType > m_matrices
The matrix values.
Definition: DataGroup.h:220
SurgSim::DataStructures::DataGroup::ImageType
Image< float > ImageType
The type used for images.
Definition: DataGroup.h:86
SurgSim::DataStructures::Image
A templated Image class.
Definition: Image.h:33
SurgSim::DataStructures::DataGroup::m_integers
NamedData< IntegerType > m_integers
The integer values.
Definition: DataGroup.h:226