9 #include "imstkGeometryMap.h" 10 #include "imstkMacros.h" 11 #include "imstkMath.h" 12 #include "imstkTypes.h" 16 template<
typename T,
int N>
class VecDataArray;
29 std::shared_ptr<Geometry> parent,
30 std::shared_ptr<Geometry> child);
43 void computeMap(std::unordered_map<int, int>& tetVertToSurfVertMap);
48 void setMap(
const std::unordered_map<int, int>& sourceMap);
49 const std::unordered_map<int, int>& getMap()
const {
return m_oneToOneMap; }
72 double getTolerance()
const {
return m_epsilon; }
void setMap(const std::unordered_map< int, int > &sourceMap)
Sets the one-to-one correspondence directly.
void computeMap(std::unordered_map< int, int > &tetVertToSurfVertMap)
Compute tet vertex id to surf vertex id map.
void addNewUniquePoint(int sourceId, int targetId)
Unsafe function for adding new points Can be used in methods that modify the parent mesh when new ver...
int findMatchingVertex(const VecDataArray< double, 3 > &parentMesh, const Vec3d &p)
Returns the first matching vertex, -1 if not found.
void requestUpdate() override
Apply (if active) the tetra-triangle mesh map.
int getParentVertexId(const int childVertexId) const
Get the mapped/corresponding parent index, given a child index. returns -1 if no correspondence found...
std::unordered_map< int, int > m_oneToOneMap
One to one mapping data.
PointwiseMap can compute & apply a mapping between parent and child PointSet geometries.
Base class for any geometric map.
void compute() override
Compute the tetra-triangle mesh map.
double m_epsilon
Tolernace for considering two points equivalent/mapped. The tolerance is set a bit higher here since ...
void setTolerance(const double tolerance)
Set/Get the tolerance. The distance to consider two points equivalent/corresponding.
std::vector< std::pair< int, int > > m_oneToOneMapVector
One to one mapping data.