iMSTK
Interactive Medical Simulation Toolkit
imstkTriangleToTetMap.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 "imstkPointwiseMap.h"
10 #include "imstkMath.h"
11 #include "imstkTypes.h"
12 
13 namespace imstk
14 {
22 {
23 public:
26  std::shared_ptr<Geometry> parent,
27  std::shared_ptr<Geometry> child);
28  ~TriangleToTetMap() override = default;
29 
30  IMSTK_TYPE_NAME(TriangleToTetMap)
31 
32 
33  void compute() override;
36 
40  void computeTriToTetMap(std::unordered_map<int, int>& triToTetMap);
41 
45  int getParentTetId(const int triId) const;
46 
47 public:
48  std::unordered_map<int, int> m_triToTetMap;
49 };
50 } // namespace imstk
void compute() override
Compute the map.
int getParentTetId(const int triId) const
Get the tet id that contains the triangle.
Compound Geometry.
void computeTriToTetMap(std::unordered_map< int, int > &triToTetMap)
Compute tet vertex id to surf vertex id map.
SurfaceToTetrahedralMap serves as a PointwiseMap but also maps tets to triangle faces.
PointwiseMap can compute & apply a mapping between parent and child PointSet geometries.