16 #ifndef SURGSIM_MATH_COMPOUNDSHAPE_H 17 #define SURGSIM_MATH_COMPOUNDSHAPE_H 22 #include <boost/thread.hpp> 24 #include "SurgSim/Math/Shape.h" 26 #include "SurgSim/DataStructures/OptionalValue.h" 34 SURGSIM_STATIC_REGISTRATION(CompoundShape);
58 void setShapes(
const std::vector<SubShape>& shapes);
61 const std::vector<SubShape>&
getShapes()
const;
65 const std::shared_ptr<Shape>&
getShape(
size_t index)
const;
77 const std::vector<RigidTransform3d>&
getPoses()
const;
82 void setPoses(
const std::vector<RigidTransform3d>& poses);
121 void invalidateData();
123 std::vector<SubShape> m_shapes;
125 std::vector<RigidTransform3d> m_poses;
128 typedef boost::shared_lock<boost::shared_mutex> ReadLock;
129 typedef boost::unique_lock<boost::shared_mutex> WriteLock;
131 mutable boost::shared_mutex m_mutex;
Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
const std::vector< SubShape > & getShapes() const
Definition: CompoundShape.cpp:226
Vector3d getCenter() const override
Get the volumetric center of the shape.
Definition: CompoundShape.cpp:72
Eigen::Matrix< double, 3, 1 > Vector3d
A 3D vector of doubles.
Definition: Vector.h:57
RigidTransform3d getPose(size_t index) const
Definition: CompoundShape.cpp:246
void updateShape() override
Update the internals of a transformable shape.
Definition: CompoundShape.cpp:367
const std::vector< RigidTransform3d > & getPoses() const
Definition: CompoundShape.cpp:253
int getType() const override
Definition: CompoundShape.cpp:40
const std::shared_ptr< Shape > & getShape(size_t index) const
Definition: CompoundShape.cpp:232
std::shared_ptr< Shape > getTransformed(const RigidTransform3d &pose) const override
Get a copy of this shape with an applied rigid transform.
Definition: CompoundShape.cpp:320
RigidTransform3d getCompoundPose(size_t index) const
Definition: CompoundShape.cpp:239
Definition: CompoundShape.h:36
double getVolume() const override
Definition: CompoundShape.cpp:45
~CompoundShape()
Destructor.
Definition: CompoundShape.cpp:36
void setPose(size_t index, const RigidTransform3d &pose)
Set the local pose for the specified shape with respect to this CompoundShape.
Definition: CompoundShape.cpp:283
bool isValid() const override
Check if the shape is valid.
Definition: CompoundShape.cpp:147
size_t getNumShapes() const
Definition: CompoundShape.cpp:302
bool isTransformable() const override
Definition: CompoundShape.cpp:315
void updateShapePartial() override
Update some of the internals of a transformable shape.
Definition: CompoundShape.cpp:376
void setPoses(const std::vector< RigidTransform3d > &poses)
Sets the local poses for all subshapes with respect to this CompoundShape.
Definition: CompoundShape.cpp:259
Eigen::Matrix< double, 3, 3, Eigen::RowMajor > Matrix33d
A 3x3 matrix of doubles.
Definition: Matrix.h:51
void setShapes(const std::vector< SubShape > &shapes)
Sets the shapes for this object, the shapes should be a list of shapes together with their respective...
Definition: CompoundShape.cpp:205
CompoundShape()
Constructor.
Definition: CompoundShape.cpp:28
size_t addShape(const std::shared_ptr< Shape > &shape, const RigidTransform3d &pose=RigidTransform3d::Identity())
Add a shape to this shape, you can optionally supply a local pose for the added shape w...
Definition: CompoundShape.cpp:185
const Math::Aabbd & getBoundingBox() const override
Definition: CompoundShape.cpp:152
Matrix33d getSecondMomentOfVolume() const override
Get the second central moment of the volume, commonly used to calculate the moment of inertia matrix...
Definition: CompoundShape.cpp:107
void clearShapes()
clears all the enclosed shapes
Definition: CompoundShape.cpp:308
Generic rigid shape class defining a shape.
Definition: Shape.h:65