opensurgsim
DataGroupBuilder.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_DATAGROUPBUILDER_H
17 #define SURGSIM_DATASTRUCTURES_DATAGROUPBUILDER_H
18 
19 #include "SurgSim/DataStructures/NamedDataBuilder.h"
20 #include "SurgSim/DataStructures/NamedVariantData.h"
21 #include "SurgSim/DataStructures/DataGroup.h"
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.
190  DataGroupBuilder& operator=(const DataGroupBuilder&);
191 
194 
197 
200 
203 
206 
209 
212 
215 
217  NamedVariantDataBuilder m_customData;
218 };
219 
220 }; // namespace Input
221 }; // namespace SurgSim
222 
223 #endif // SURGSIM_DATASTRUCTURES_DATAGROUPBUILDER_H
void addPose(const std::string &name)
A shortcut for adding a named pose entry.
Definition: DataGroupBuilder.cpp:138
void addString(const std::string &name)
A shortcut for adding a named string entry.
Definition: DataGroupBuilder.cpp:168
Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
NamedDataBuilder< DynamicMatrixType > & matrices()
Provides access to the matrix value entries.
Definition: DataGroupBuilder.cpp:68
DataGroupBuilder()
Constructs an empty builder object.
Definition: DataGroupBuilder.cpp:24
A templated Image class.
Definition: Image.h:33
void addMatrix(const std::string &name)
A shortcut for adding a named matrix entry.
Definition: DataGroupBuilder.cpp:148
void addInteger(const std::string &name)
A shortcut for adding a named integer entry.
Definition: DataGroupBuilder.cpp:158
NamedDataBuilder< ImageType > & images()
Provides access to the image value entries.
Definition: DataGroupBuilder.cpp:118
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
DataGroup::StringType StringType
The type used for strings.
Definition: DataGroupBuilder.h:54
NamedVariantDataBuilder & customData()
Provides access to the custom data entries.
Definition: DataGroupBuilder.cpp:128
NamedDataBuilder< ScalarType > & scalars()
Provides access to the scalar value entries.
Definition: DataGroupBuilder.cpp:78
DataGroup::VectorType VectorType
The type used for vectors.
Definition: DataGroupBuilder.h:44
DataGroup::IntegerType IntegerType
The type used for integers.
Definition: DataGroupBuilder.h:50
DataGroup::PoseType PoseType
The type used for poses.
Definition: DataGroupBuilder.h:42
Image< float > ImageType
The type used for images.
Definition: DataGroupBuilder.h:56
DataGroup createData() const
Produces a DataGroup object with an immutable set of names and indices.
Definition: DataGroupBuilder.cpp:28
NamedDataBuilder< PoseType > & poses()
Provides access to the pose value entries.
Definition: DataGroupBuilder.cpp:48
NamedDataBuilder< StringType > & strings()
Provides access to the string value entries.
Definition: DataGroupBuilder.cpp:108
void addEntriesFrom(const DataGroupBuilder &builder)
Create new entries from another DataGroupBuilder.
Definition: DataGroupBuilder.cpp:183
void addCustom(const std::string &name)
A shortcut for adding a named custom data entry.
Definition: DataGroupBuilder.cpp:178
void addScalar(const std::string &name)
A shortcut for adding a named scalar entry.
Definition: DataGroupBuilder.cpp:153
DataGroup::BooleanType BooleanType
The type used for booleans.
Definition: DataGroupBuilder.h:52
DataGroup::DynamicMatrixType DynamicMatrixType
The type used for matrices.
Definition: DataGroupBuilder.h:46
A collection of NamedData objects.
Definition: DataGroup.h:68
DataGroup::ScalarType ScalarType
The type used for scalars.
Definition: DataGroupBuilder.h:48
void addVector(const std::string &name)
A shortcut for adding a named vector entry.
Definition: DataGroupBuilder.cpp:143
bool BooleanType
The type used for booleans.
Definition: DataGroup.h:82
NamedDataBuilder< BooleanType > & booleans()
Provides access to the Boolean value entries.
Definition: DataGroupBuilder.cpp:98
std::string StringType
The type used for strings.
Definition: DataGroup.h:84
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > DynamicMatrixType
The type used for matrices.
Definition: DataGroup.h:76
NamedDataBuilder< VectorType > & vectors()
Provides access to the vector value entries.
Definition: DataGroupBuilder.cpp:58
void addBoolean(const std::string &name)
A shortcut for adding a named boolean entry.
Definition: DataGroupBuilder.cpp:163
A class that allows you to build a DataGroup structure.
Definition: DataGroupBuilder.h:38
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
NamedDataBuilder< IntegerType > & integers()
Provides access to the integer value entries.
Definition: DataGroupBuilder.cpp:88
int IntegerType
The type used for integers.
Definition: DataGroup.h:80
void addImage(const std::string &name)
A shortcut for adding a named image entry.
Definition: DataGroupBuilder.cpp:173