MeshShape-inl.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_MESHSHAPE_INL_H
#define SURGSIM_MATH_MESHSHAPE_INL_H
namespace SurgSim
{
namespace Math
{
template <class V, class E, class T>
MeshShape::MeshShape(const SurgSim::DataStructures::TriangleMesh<V, E, T>& other) :
SurgSim::DataStructures::TriangleMesh<SurgSim::DataStructures::EmptyData, SurgSim::DataStructures::EmptyData,
SurgSim::DataStructures::NormalData>::TriangleMesh(other)
{
SURGSIM_ASSERT(other.isValid()) << "Invalid mesh";
updateAabbTree();
computeVolumeIntegrals();
calculateNormals();
}
}; // namespace Math
}; // namespace SurgSim
#endif
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Math::MeshShape::calculateNormals
bool calculateNormals()
Calculate normals for all triangles.
Definition: MeshShape.cpp:59
SurgSim::DataStructures::TriangleMesh::isValid
bool isValid() const
Test if the TriangleMesh is valid (valid vertex Ids used in all MeshElements)
Definition: TriangleMesh-inl.h:223
SURGSIM_ASSERT
#define SURGSIM_ASSERT(condition)
Assert that condition is true.
Definition: Assert.h:77
SurgSim::Math::MeshShape::updateAabbTree
void updateAabbTree()
Update the AabbTree, which is an axis-aligned bounding box r-tree used to accelerate spatial searches...
Definition: MeshShape.cpp:229
SurgSim::Math::MeshShape::MeshShape
MeshShape()
Constructor.
Definition: MeshShape.cpp:37
SurgSim::DataStructures::TriangleMesh
Basic class for storing Triangle Meshes, handling basic vertex, edge, and triangle functionality...
Definition: TriangleMesh.h:62
SurgSim::Math::MeshShape::computeVolumeIntegrals
virtual void computeVolumeIntegrals()
Compute useful volume integrals based on the triangle mesh, which are used to get the volume ...
Definition: MeshShape.cpp:146