DataGroup.h
Go to the documentation of this file.
// This file is a part of the OpenSurgSim project.
// Copyright 2012-2013, SimQuest Solutions Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef SURGSIM_DATASTRUCTURES_DATAGROUP_H
#define SURGSIM_DATASTRUCTURES_DATAGROUP_H
#include <Eigen/Core>
#include "SurgSim/DataStructures/Image.h"
#include "SurgSim/DataStructures/NamedData.h"
#include "SurgSim/DataStructures/NamedVariantData.h"
#include "SurgSim/Math/RigidTransform.h"
#include "SurgSim/Math/Vector.h"
namespace SurgSim
{
namespace DataStructures
{
class DataGroup
{
public:
typedef SurgSim::Math::RigidTransform3d PoseType;
typedef SurgSim::Math::Vector3d VectorType;
typedef Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> DynamicMatrixType;
typedef double ScalarType;
typedef int IntegerType;
typedef bool BooleanType;
typedef std::string StringType;
typedef Image<float> ImageType;
DataGroup();
DataGroup(const DataGroup& dataGroup);
DataGroup& operator=(const DataGroup& dataGroup);
DataGroup& operator=(DataGroup&& dataGroup);
NamedData<PoseType>& poses();
const NamedData<PoseType>& poses() const;
NamedData<VectorType>& vectors();
const NamedData<VectorType>& vectors() const;
NamedData<DynamicMatrixType>& matrices();
const NamedData<DynamicMatrixType>& matrices() const;
NamedData<ScalarType>& scalars();
const NamedData<ScalarType>& scalars() const;
NamedData<IntegerType>& integers();
const NamedData<IntegerType>& integers() const;
NamedData<BooleanType>& booleans();
const NamedData<BooleanType>& booleans() const;
NamedData<StringType>& strings();
const NamedData<StringType>& strings() const;
NamedData<ImageType>& images();
const NamedData<ImageType>& images() const;
NamedVariantData& customData();
const NamedVariantData& customData() const;
void resetAll();
bool isEmpty() const;
private:
NamedData<PoseType> m_poses;
NamedData<VectorType> m_vectors;
NamedData<DynamicMatrixType> m_matrices;
NamedData<ScalarType> m_scalars;
NamedData<IntegerType> m_integers;
NamedData<BooleanType> m_booleans;
NamedData<StringType> m_strings;
NamedData<ImageType> m_images;
NamedVariantData m_customData;
};
}; // namespace DataStructures
}; // namespace SurgSim
#endif // SURGSIM_DATASTRUCTURES_DATAGROUP_H
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::DataStructures::DataGroup::matrices
NamedData< DynamicMatrixType > & matrices()
Return the matrix data structure.
Definition: DataGroup.cpp:90
SurgSim::DataStructures::NamedVariantData
A NamedData collection of variant data type.
Definition: NamedVariantData.h:39
SurgSim::DataStructures::Image
A templated Image class.
Definition: Image.h:33
SurgSim::DataStructures::NamedData< PoseType >
SurgSim::DataStructures::DataGroup::resetAll
void resetAll()
Mark all data as not current.
Definition: DataGroup.cpp:161
SurgSim::DataStructures::DataGroup::scalars
NamedData< ScalarType > & scalars()
Return the scalar data structure.
Definition: DataGroup.cpp:101
SurgSim::DataStructures::DataGroup::PoseType
SurgSim::Math::RigidTransform3d PoseType
The type used for poses.
Definition: DataGroup.h:72
SurgSim::DataStructures::DataGroup::ScalarType
double ScalarType
The type used for scalars.
Definition: DataGroup.h:78
SurgSim::DataStructures::DataGroup::VectorType
SurgSim::Math::Vector3d VectorType
The type used for vectors.
Definition: DataGroup.h:74
SurgSim::DataStructures::DataGroup::booleans
NamedData< BooleanType > & booleans()
Return the boolean data structure.
Definition: DataGroup.cpp:121
NamedData.h
SurgSim::DataStructures::DataGroup::integers
NamedData< IntegerType > & integers()
Return the integer data structure.
Definition: DataGroup.cpp:111
SurgSim::DataStructures::DataGroup::operator=
DataGroup & operator=(const DataGroup &dataGroup)
Copy the data from another object.
Definition: DataGroup.cpp:40
SurgSim::DataStructures::DataGroup::m_poses
NamedData< PoseType > m_poses
The pose values.
Definition: DataGroup.h:214
SurgSim::DataStructures::DataGroup::ImageType
Image< float > ImageType
The type used for images.
Definition: DataGroup.h:86
SurgSim::DataStructures::DataGroup::vectors
NamedData< VectorType > & vectors()
Return the vector data structure.
Definition: DataGroup.cpp:80
SurgSim::DataStructures::DataGroup::m_strings
NamedData< StringType > m_strings
The string values.
Definition: DataGroup.h:232
Image.h
SurgSim::DataStructures::DataGroup::m_matrices
NamedData< DynamicMatrixType > m_matrices
The matrix values.
Definition: DataGroup.h:220
SurgSim::DataStructures::DataGroup::strings
NamedData< StringType > & strings()
Return the string data structure.
Definition: DataGroup.cpp:131
SurgSim::DataStructures::DataGroup::m_integers
NamedData< IntegerType > m_integers
The integer values.
Definition: DataGroup.h:226
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
A collection of NamedData objects.
Definition: DataGroup.h:68
SurgSim::DataStructures::DataGroup::poses
NamedData< PoseType > & poses()
Return the pose data structure.
Definition: DataGroup.cpp:70
RigidTransform.h
Definitions of 2x2 and 3x3 rigid (isometric) transforms.
SurgSim::DataStructures::DataGroup::m_booleans
NamedData< BooleanType > m_booleans
The boolean values.
Definition: DataGroup.h:229
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::BooleanType
bool BooleanType
The type used for booleans.
Definition: DataGroup.h:82
SurgSim::DataStructures::DataGroup::m_images
NamedData< ImageType > m_images
The string values.
Definition: DataGroup.h:235
NamedVariantData.h
SurgSim::DataStructures::DataGroup::m_customData
NamedVariantData m_customData
The custom data values.
Definition: DataGroup.h:238
Vector.h
Definitions of small fixed-size vector types.
SurgSim::DataStructures::DataGroup::DataGroup
DataGroup()
Construct an empty object, with no associated names and indices yet.
Definition: DataGroup.cpp:23
SurgSim::DataStructures::DataGroup::StringType
std::string StringType
The type used for strings.
Definition: DataGroup.h:84
SurgSim::DataStructures::DataGroup::images
NamedData< ImageType > & images()
Return the image data structure.
Definition: DataGroup.cpp:141
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::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::IntegerType
int IntegerType
The type used for integers.
Definition: DataGroup.h:80
SurgSim::Math::Vector3d
Eigen::Matrix< double, 3, 1 > Vector3d
A 3D vector of doubles.
Definition: Vector.h:57
SurgSim::DataStructures::DataGroup::customData
NamedVariantData & customData()
Return the custom data structure.
Definition: DataGroup.cpp:151