iMSTK
Interactive Medical Simulation Toolkit
imstkSurfaceMeshToSurfaceMeshCD.h
1 /*
2 ** This file is part of the Interactive Medical Simulation Toolkit (iMSTK)
3 ** iMSTK is distributed under the Apache License, Version 2.0.
4 ** See accompanying NOTICE for details.
5 */
6 
7 #pragma once
8 
9 #include "imstkCollisionDetectionAlgorithm.h"
10 #include "imstkMacros.h"
11 
12 namespace imstk
13 {
14 class SurfaceMesh;
15 
22 {
23 public:
25  ~SurfaceMeshToSurfaceMeshCD() override = default;
26 
27  IMSTK_TYPE_NAME(SurfaceMeshToSurfaceMeshCD)
28 
29 public:
30  void setMaxNumContacts(const int maxNumContacts) { m_maxNumContacts = maxNumContacts; }
31  const int getMaxNumContacts() const { return m_maxNumContacts; }
32 
33 protected:
38  std::shared_ptr<Geometry> geomA,
39  std::shared_ptr<Geometry> geomB,
40  std::vector<CollisionElement>& elementsA,
41  std::vector<CollisionElement>& elementsB) override;
42 
43 protected:
44  std::vector<std::pair<int, int>> m_intersectingPairs;
45  int m_maxNumContacts = 1000;
46 };
47 } // namespace imstk
Base class for all collision detection classes. CollisionDetection classes produce CollisionData betw...
Collision detection for surface meshes.
Compound Geometry.
void computeCollisionDataAB(std::shared_ptr< Geometry > geomA, std::shared_ptr< Geometry > geomB, std::vector< CollisionElement > &elementsA, std::vector< CollisionElement > &elementsB) override
Compute collision data for AB simultaneously.