DataGroupBuilder.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_DATAGROUPBUILDER_H
17 #define SURGSIM_DATASTRUCTURES_DATAGROUPBUILDER_H
18 
22 #include <Eigen/Core>
23 
24 namespace SurgSim
25 {
26 namespace DataStructures
27 {
28 
39 {
40 public:
57 
60 
64  DataGroup createData() const;
65 
69  std::shared_ptr<DataGroup> createSharedData() const;
70 
74 
77  const NamedDataBuilder<PoseType>& poses() const;
78 
82 
86 
90 
94 
98 
101  const NamedDataBuilder<ScalarType>& scalars() const;
102 
106 
110 
114 
118 
122 
125  const NamedDataBuilder<StringType>& strings() const;
126 
130 
133  const NamedDataBuilder<ImageType>& images() const;
134 
138 
141  const NamedVariantDataBuilder& customData() const;
142 
145  void addPose(const std::string& name);
146 
149  void addVector(const std::string& name);
150 
153  void addMatrix(const std::string& name);
154 
157  void addScalar(const std::string& name);
158 
161  void addInteger(const std::string& name);
162 
165  void addBoolean(const std::string& name);
166 
169  void addString(const std::string& name);
170 
173  void addImage(const std::string& name);
174 
177  void addCustom(const std::string& name);
178 
181  void addEntriesFrom(const DataGroupBuilder& builder);
182 
185  void addEntriesFrom(const DataGroup& data);
186 
187 private:
188  // Prevent copy construction and copy assignment.
191 
194 
197 
200 
203 
206 
209 
212 
215 
218 };
219 
220 }; // namespace Input
221 }; // namespace SurgSim
222 
223 #endif // SURGSIM_DATASTRUCTURES_DATAGROUPBUILDER_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::DataGroupBuilder::addInteger
void addInteger(const std::string &name)
A shortcut for adding a named integer entry.
Definition: DataGroupBuilder.cpp:158
SurgSim::DataStructures::DataGroupBuilder::operator=
DataGroupBuilder & operator=(const DataGroupBuilder &)
SurgSim::DataStructures::DataGroupBuilder::vectors
NamedDataBuilder< VectorType > & vectors()
Provides access to the vector value entries.
Definition: DataGroupBuilder.cpp:58
SurgSim::DataStructures::DataGroupBuilder::addVector
void addVector(const std::string &name)
A shortcut for adding a named vector entry.
Definition: DataGroupBuilder.cpp:143
SurgSim::DataStructures::DataGroupBuilder::strings
NamedDataBuilder< StringType > & strings()
Provides access to the string value entries.
Definition: DataGroupBuilder.cpp:108
SurgSim::DataStructures::DataGroupBuilder::scalars
NamedDataBuilder< ScalarType > & scalars()
Provides access to the scalar value entries.
Definition: DataGroupBuilder.cpp:78
SurgSim::DataStructures::DataGroupBuilder::images
NamedDataBuilder< ImageType > & images()
Provides access to the image value entries.
Definition: DataGroupBuilder.cpp:118
SurgSim::DataStructures::DataGroupBuilder::addPose
void addPose(const std::string &name)
A shortcut for adding a named pose entry.
Definition: DataGroupBuilder.cpp:138
NamedDataBuilder.h
SurgSim::DataStructures::DataGroupBuilder::BooleanType
DataGroup::BooleanType BooleanType
The type used for booleans.
Definition: DataGroupBuilder.h:52
SurgSim::DataStructures::DataGroupBuilder::integers
NamedDataBuilder< IntegerType > & integers()
Provides access to the integer value entries.
Definition: DataGroupBuilder.cpp:88
SurgSim::DataStructures::DataGroup::PoseType
SurgSim::Math::RigidTransform3d PoseType
The type used for poses.
Definition: DataGroup.h:72
SurgSim::DataStructures::DataGroupBuilder::m_images
NamedDataBuilder< ImageType > m_images
The subsidiary builder used for image values.
Definition: DataGroupBuilder.h:214
SurgSim::DataStructures::DataGroup::BooleanType
bool BooleanType
The type used for booleans.
Definition: DataGroup.h:82
SurgSim::DataStructures::DataGroupBuilder::DynamicMatrixType
DataGroup::DynamicMatrixType DynamicMatrixType
The type used for matrices.
Definition: DataGroupBuilder.h:46
SurgSim::DataStructures::DataGroupBuilder::addMatrix
void addMatrix(const std::string &name)
A shortcut for adding a named matrix entry.
Definition: DataGroupBuilder.cpp:148
SurgSim::DataStructures::DataGroupBuilder::StringType
DataGroup::StringType StringType
The type used for strings.
Definition: DataGroupBuilder.h:54
SurgSim::DataStructures::DataGroupBuilder::poses
NamedDataBuilder< PoseType > & poses()
Provides access to the pose value entries.
Definition: DataGroupBuilder.cpp:48
SurgSim::DataStructures::DataGroupBuilder::m_vectors
NamedDataBuilder< VectorType > m_vectors
The subsidiary builder used for vector values.
Definition: DataGroupBuilder.h:196
SurgSim::DataStructures::DataGroupBuilder::m_integers
NamedDataBuilder< IntegerType > m_integers
The subsidiary builder used for integer values.
Definition: DataGroupBuilder.h:205
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::DataStructures::DataGroup::StringType
std::string StringType
The type used for strings.
Definition: DataGroup.h:84
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::DataGroupBuilder::VectorType
DataGroup::VectorType VectorType
The type used for vectors.
Definition: DataGroupBuilder.h:44
SurgSim::DataStructures::DataGroupBuilder::createSharedData
std::shared_ptr< DataGroup > createSharedData() const
Produce a shared pointer to an empty DataGroup object with an immutable set of names and indices.
Definition: DataGroupBuilder.cpp:43
SurgSim::DataStructures::NamedDataBuilder< PoseType >
SurgSim::DataStructures::DataGroupBuilder::m_booleans
NamedDataBuilder< BooleanType > m_booleans
The subsidiary builder used for boolean values.
Definition: DataGroupBuilder.h:208
SurgSim::DataStructures::DataGroupBuilder::m_strings
NamedDataBuilder< StringType > m_strings
The subsidiary builder used for string values.
Definition: DataGroupBuilder.h:211
SurgSim::DataStructures::DataGroupBuilder::matrices
NamedDataBuilder< DynamicMatrixType > & matrices()
Provides access to the matrix value entries.
Definition: DataGroupBuilder.cpp:68
SurgSim::DataStructures::DataGroupBuilder::IntegerType
DataGroup::IntegerType IntegerType
The type used for integers.
Definition: DataGroupBuilder.h:50
SurgSim::DataStructures::DataGroupBuilder::m_poses
NamedDataBuilder< PoseType > m_poses
The subsidiary builder used for pose values.
Definition: DataGroupBuilder.h:193
SurgSim::DataStructures::DataGroupBuilder::createData
DataGroup createData() const
Produces a DataGroup object with an immutable set of names and indices.
Definition: DataGroupBuilder.cpp:28
SurgSim::DataStructures::DataGroupBuilder::PoseType
DataGroup::PoseType PoseType
The type used for poses.
Definition: DataGroupBuilder.h:42
SurgSim::DataStructures::DataGroup::ScalarType
double ScalarType
The type used for scalars.
Definition: DataGroup.h:78
SurgSim::DataStructures::DataGroupBuilder::booleans
NamedDataBuilder< BooleanType > & booleans()
Provides access to the Boolean value entries.
Definition: DataGroupBuilder.cpp:98
SurgSim::DataStructures::DataGroupBuilder::ScalarType
DataGroup::ScalarType ScalarType
The type used for scalars.
Definition: DataGroupBuilder.h:48
SurgSim::DataStructures::DataGroupBuilder::m_matrices
NamedDataBuilder< DynamicMatrixType > m_matrices
The subsidiary builder used for matrix values.
Definition: DataGroupBuilder.h:199
SurgSim::DataStructures::DataGroupBuilder::ImageType
Image< float > ImageType
The type used for images.
Definition: DataGroupBuilder.h:56
SurgSim::DataStructures::DataGroupBuilder::DataGroupBuilder
DataGroupBuilder()
Constructs an empty builder object.
Definition: DataGroupBuilder.cpp:24
SurgSim::DataStructures::DataGroupBuilder::customData
NamedVariantDataBuilder & customData()
Provides access to the custom data entries.
Definition: DataGroupBuilder.cpp:128
DataGroup.h
SurgSim::DataStructures::DataGroupBuilder::addScalar
void addScalar(const std::string &name)
A shortcut for adding a named scalar entry.
Definition: DataGroupBuilder.cpp:153
SurgSim::DataStructures::DataGroup::VectorType
SurgSim::Math::Vector3d VectorType
The type used for vectors.
Definition: DataGroup.h:74
SurgSim::DataStructures::DataGroupBuilder::addEntriesFrom
void addEntriesFrom(const DataGroupBuilder &builder)
Create new entries from another DataGroupBuilder.
Definition: DataGroupBuilder.cpp:183
SurgSim::DataStructures::DataGroupBuilder::addCustom
void addCustom(const std::string &name)
A shortcut for adding a named custom data entry.
Definition: DataGroupBuilder.cpp:178
SurgSim::DataStructures::DataGroupBuilder::addImage
void addImage(const std::string &name)
A shortcut for adding a named image entry.
Definition: DataGroupBuilder.cpp:173
SurgSim::DataStructures::DataGroupBuilder::m_scalars
NamedDataBuilder< ScalarType > m_scalars
The subsidiary builder used for scalar values.
Definition: DataGroupBuilder.h:202
SurgSim::DataStructures::Image
A templated Image class.
Definition: Image.h:33
SurgSim::DataStructures::DataGroupBuilder::addString
void addString(const std::string &name)
A shortcut for adding a named string entry.
Definition: DataGroupBuilder.cpp:168
SurgSim::DataStructures::DataGroupBuilder::m_customData
NamedVariantDataBuilder m_customData
The subsidiary builder used for custom data.
Definition: DataGroupBuilder.h:217
SurgSim::DataStructures::DataGroupBuilder
A class that allows you to build a DataGroup structure.
Definition: DataGroupBuilder.h:38
SurgSim::DataStructures::DataGroupBuilder::addBoolean
void addBoolean(const std::string &name)
A shortcut for adding a named boolean entry.
Definition: DataGroupBuilder.cpp:163