SurfaceMeshShape.h
Go to the documentation of this file.
// This file is a part of the OpenSurgSim project.
// Copyright 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_MATH_SURFACEMESHSHAPE_H
#define SURGSIM_MATH_SURFACEMESHSHAPE_H
#include "SurgSim/DataStructures/TriangleMesh.h"
#include "SurgSim/Framework/ObjectFactory.h"
#include "SurgSim/Math/MeshShape.h"
#include "SurgSim/Math/Shape.h"
namespace SurgSim
{
namespace Math
{
SURGSIM_STATIC_REGISTRATION(SurfaceMeshShape);
class SurfaceMeshShape : public MeshShape
{
public:
SurfaceMeshShape();
template <class VertexData, class EdgeData, class TriangleData>
SurfaceMeshShape(
const SurgSim::DataStructures::TriangleMesh<VertexData, EdgeData, TriangleData>& mesh,
double thickness = 1e-2);
SURGSIM_CLASSNAME(SurgSim::Math::SurfaceMeshShape);
int getType() const override;
bool isValid() const override;
protected:
void computeVolumeIntegrals() override;
private:
double m_thickness;
};
}; // Math
}; // SurgSim
#include "SurgSim/Math/SurfaceMeshShape-inl.h"
#endif // SURGSIM_MATH_SURFACEMESHSHAPE_H
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurfaceMeshShape-inl.h
SurgSim::Math::MeshShape
Mesh shape: shape made of a triangle mesh The triangle mesh needs to be watertight to produce valid v...
Definition: MeshShape.h:54
ObjectFactory.h
SurgSim::Math::SurfaceMeshShape::SurfaceMeshShape
SurfaceMeshShape()
Constructor.
Definition: SurfaceMeshShape.cpp:33
MeshShape.h
SurgSim::Math::SurfaceMeshShape::getType
int getType() const override
Definition: SurfaceMeshShape.cpp:37
SurgSim::Math::SurfaceMeshShape::m_thickness
double m_thickness
Surface mesh thickness.
Definition: SurfaceMeshShape.h:85
SurgSim::Math::SurfaceMeshShape::SURGSIM_CLASSNAME
SURGSIM_CLASSNAME(SurgSim::Math::SurfaceMeshShape)
SurgSim::Math::SurfaceMeshShape
SurfaceMeshShape defines a shape based on a mesh, like MeshShape.
Definition: SurfaceMeshShape.h:53
SurgSim::DataStructures::TriangleMesh
Basic class for storing Triangle Meshes, handling basic vertex, edge, and triangle functionality...
Definition: TriangleMesh.h:62
Shape.h
TriangleMesh.h
SurgSim::Math::SurfaceMeshShape::isValid
bool isValid() const override
Check if this shape contains a valid mesh and the thickness is at least 1e-5 (in meter, to avoid formal and numerical issues).
Definition: SurfaceMeshShape.cpp:143
SurgSim::Math::SurfaceMeshShape::computeVolumeIntegrals
void computeVolumeIntegrals() override
Compute useful volume integrals based on the triangle mesh, which are used to get the volume ...
Definition: SurfaceMeshShape.cpp:42