Go to the documentation of this file.
16 #ifndef SURGSIM_MATH_MESHSHAPE_H
17 #define SURGSIM_MATH_MESHSHAPE_H
30 namespace DataStructures
38 SURGSIM_STATIC_REGISTRATION(MeshShape);
55 SurgSim::DataStructures::EmptyData, SurgSim::DataStructures::NormalData>
70 template <
class V,
class E,
class T>
92 const std::shared_ptr<const SurgSim::DataStructures::AabbTree>
getAabbTree()
const;
101 bool doLoad(
const std::string& fileName)
override;
126 std::shared_ptr<SurgSim::DataStructures::AabbTree>
m_aabbTree;
134 #endif // SURGSIM_MATH_MESHSHAPE_H
Basic class for storing Triangle Meshes, handling basic vertex, edge, and triangle functionality.
Definition: TriangleMesh.h:62
Vector3d getCenter() const override
Get the volumetric center of the shape.
Definition: MeshShape.cpp:116
SURGSIM_CLASSNAME(SurgSim::Math::MeshShape)
int getType() const override
Definition: MeshShape.cpp:101
Eigen::Transform< double, 3, Eigen::Isometry > RigidTransform3d
A 3D rigid (isometric) transform, represented as doubles.
Definition: RigidTransform.h:46
MeshShape()
Constructor.
Definition: MeshShape.cpp:37
::SurgSim::Math::Matrix33d Matrix33d
Definition: Shape.h:69
virtual void computeVolumeIntegrals()
Compute useful volume integrals based on the triangle mesh, which are used to get the volume ,...
Definition: MeshShape.cpp:146
SurgSim::Math::Matrix33d m_secondMomentOfVolume
Second moment of volume.
Definition: MeshShape.h:122
bool isValid() const override
Check if the shape is valid.
Definition: MeshShape.cpp:111
SurgSim::Math::Vector3d m_center
Center (considering a uniform distribution in the mesh volume)
Definition: MeshShape.h:116
Eigen::Matrix< double, 3, 1 > Vector3d
A 3D vector of doubles.
Definition: Vector.h:57
Definition: CompoundShapeToGraphics.cpp:29
double getVolume() const override
Get the volume of the shape.
Definition: MeshShape.cpp:106
Eigen::Matrix< double, 3, 3, Eigen::RowMajor > Matrix33d
A 3x3 matrix of doubles.
Definition: Matrix.h:51
Matrix33d getSecondMomentOfVolume() const override
Get the second central moment of the volume, commonly used to calculate the moment of inertia matrix.
Definition: MeshShape.cpp:121
bool isTransformable() const override
Definition: MeshShape.cpp:250
const SurgSim::Math::Vector3d & getNormal(size_t triangleId) const
Get normal for triangle.
Definition: MeshShape.cpp:54
Mesh shape: shape made of a triangle mesh The triangle mesh needs to be watertight to produce valid v...
Definition: MeshShape.h:54
void updateAabbTree()
Update the AabbTree, which is an axis-aligned bounding box r-tree used to accelerate spatial searches...
Definition: MeshShape.cpp:229
Generic rigid shape class defining a shape.
Definition: Shape.h:65
::SurgSim::Math::Vector3d Vector3d
Definition: Shape.h:68
bool doLoad(const std::string &fileName) override
Derived classes will overwrite this method to do actual loading.
Definition: MeshShape.cpp:92
std::shared_ptr< Shape > getTransformed(const RigidTransform3d &pose) const override
Get a copy of this shape with an applied rigid transform.
Definition: MeshShape.cpp:216
bool doUpdate() override
Performs any updates that are required when the vertices are modified.
Definition: MeshShape.cpp:85
const std::shared_ptr< const SurgSim::DataStructures::AabbTree > getAabbTree() const
Get the AabbTree.
Definition: MeshShape.cpp:224
double m_volume
Volume (in m^-3)
Definition: MeshShape.h:119
bool calculateNormals()
Calculate normals for all triangles.
Definition: MeshShape.cpp:59
std::shared_ptr< SurgSim::DataStructures::AabbTree > m_aabbTree
The aabb tree used to accelerate collision detection against the mesh.
Definition: MeshShape.h:126