SegmentMeshTriangleMeshContact.h
Go to the documentation of this file.
1 // This file is a part of the OpenSurgSim project.
2 // Copyright 2013, SimQuest Solutions Inc.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 
16 #ifndef SURGSIM_COLLISION_SEGMENTMESHTRIANGLEMESHCONTACT_H
17 #define SURGSIM_COLLISION_SEGMENTMESHTRIANGLEMESHCONTACT_H
18 
19 #include <memory>
20 
22 #include "SurgSim/Math/MeshShape.h"
24 
25 namespace SurgSim
26 {
27 namespace Collision
28 {
29 
30 class CollisionPair;
31 
33 class SegmentMeshTriangleMeshContact : public ShapeShapeContactCalculation<Math::SegmentMeshShape, Math::MeshShape>
34 {
35 public:
37 
38  std::pair<int, int> getShapeTypes() override;
39 
40  std::list<std::shared_ptr<Contact>> calculateDcdContact(
41  const Math::SegmentMeshShape& segmentMeshShape,
42  const Math::RigidTransform3d& segmentMeshPose,
43  const Math::MeshShape& triangleMeshShape,
44  const Math::RigidTransform3d& triangleMeshPose) const override;
45 
46  std::list<std::shared_ptr<Contact>> calculateCcdContact(
47  const Math::SegmentMeshShape& shape1AtTime0, const Math::RigidTransform3d& pose1AtTime0,
48  const Math::SegmentMeshShape& shape1AtTime1, const Math::RigidTransform3d& pose1AtTime1,
49  const Math::MeshShape& shape2AtTime0, const Math::RigidTransform3d& pose2AtTime0,
50  const Math::MeshShape& shape2AtTime1, const Math::RigidTransform3d& pose2AtTime1) const override;
51 };
52 
53 }; // namespace Collision
54 }; // namespace SurgSim
55 
56 #endif // SURGSIM_COLLISION_SEGMENTMESHTRIANGLEMESHCONTACT_H
Definition: CompoundShapeToGraphics.cpp:29
std::pair< int, int > getShapeTypes() override
Virtual function that returns the shapes that this ContactCalculation class handles.
Definition: SegmentMeshTriangleMeshContact.cpp:61
std::list< std::shared_ptr< Contact > > calculateDcdContact(const Math::PosedShape< std::shared_ptr< Math::Shape >> posedShape1, const Math::PosedShape< std::shared_ptr< Math::Shape >> posedShape2)
Calculate the dcd contacts between two posed/transformed shapes.
Definition: ContactCalculation.cpp:74
Mesh shape: shape made of a triangle mesh The triangle mesh needs to be watertight to produce valid v...
Definition: MeshShape.h:54
std::list< std::shared_ptr< Contact > > calculateCcdContact(const Math::SegmentMeshShape &shape1AtTime0, const Math::RigidTransform3d &pose1AtTime0, const Math::SegmentMeshShape &shape1AtTime1, const Math::RigidTransform3d &pose1AtTime1, const Math::MeshShape &shape2AtTime0, const Math::RigidTransform3d &pose2AtTime0, const Math::MeshShape &shape2AtTime1, const Math::RigidTransform3d &pose2AtTime1) const override
Definition: SegmentMeshTriangleMeshContact.cpp:152
Class that can automate the type conversion and provides a consistent interface to the typed call Tak...
Definition: ShapeShapeContactCalculation.h:31
Eigen::Transform< double, 3, Eigen::Isometry > RigidTransform3d
A 3D rigid (isometric) transform, represented as doubles.
Definition: RigidTransform.h:46
SegmentMeshShape defines a shape based on a mesh, like MeshShape.
Definition: SegmentMeshShape.h:36
std::list< std::shared_ptr< Contact > > calculateDcdContact(const Math::SegmentMeshShape &segmentMeshShape, const Math::RigidTransform3d &segmentMeshPose, const Math::MeshShape &triangleMeshShape, const Math::RigidTransform3d &triangleMeshPose) const override
Virtual function to be overridden, this provides the typed contact calculation between two shapes it ...
Definition: SegmentMeshTriangleMeshContact.cpp:66
Class to calculate intersections between a segment mesh and a triangle mesh.
Definition: SegmentMeshTriangleMeshContact.h:33