diff --git a/Examples/DeformableBody/DeformableBodyExample.cpp b/Examples/DeformableBody/DeformableBodyExample.cpp index 4ac0406d7a1a2ff265e5fb17897ddc76ea4552aa..19c18d548e30f77fd8a3dcd16570f6b6730df0bf 100644 --- a/Examples/DeformableBody/DeformableBodyExample.cpp +++ b/Examples/DeformableBody/DeformableBodyExample.cpp @@ -29,8 +29,8 @@ #include "imstkMeshIO.h" #include "imstkMouseSceneControl.h" #include "imstkNew.h" -#include "imstkOneToOneMap.h" #include "imstkPlane.h" +#include "imstkPointwiseMap.h" #include "imstkRenderMaterial.h" #include "imstkScene.h" #include "imstkSceneManager.h" @@ -175,7 +175,7 @@ makeFEDeformableObject(std::shared_ptr<TetrahedralMesh> tetMesh) deformableObj->getVisualModel(0)->setRenderMaterial(mat); deformableObj->setPhysicsGeometry(tetMesh); // Map simulated geometry to visual - deformableObj->setPhysicsToVisualMap(std::make_shared<OneToOneMap>(tetMesh, surfMesh)); + deformableObj->setPhysicsToVisualMap(std::make_shared<PointwiseMap>(tetMesh, surfMesh)); deformableObj->setDynamicalModel(dynaModel); return deformableObj; diff --git a/Examples/PBD/PBDInjection/InflatableObject.cpp b/Examples/PBD/PBDInjection/InflatableObject.cpp index cb285c93df7ad9af7cd696db7bc538c81ebdae3a..8a34efe404f0badc87d3595bb4afc692987ddeed 100644 --- a/Examples/PBD/PBDInjection/InflatableObject.cpp +++ b/Examples/PBD/PBDInjection/InflatableObject.cpp @@ -20,26 +20,16 @@ =========================================================================*/ #include "InflatableObject.h" -#include "imstkNew.h" -#include "imstkVecDataArray.h" -#include "imstkTetrahedralMesh.h" -#include "imstkSurfaceMesh.h" #include "imstkCollisionUtils.h" #include "imstkImageData.h" -#include "imstkLogger.h" #include "imstkMeshIO.h" -#include "imstkOneToOneMap.h" -#include "imstkParallelFor.h" -#include "imstkPbdConstraint.h" +#include "imstkNew.h" +#include "imstkPbdInflatableDistanceConstraint.h" +#include "imstkPbdInflatableVolumeConstraint.h" #include "imstkPbdModel.h" -#include "imstkPbdObject.h" +#include "imstkPointwiseMap.h" #include "imstkRenderMaterial.h" -#include "imstkTexture.h" #include "imstkVisualModel.h" -#include "imstkCollisionUtils.h" - -#include "imstkPbdInflatableDistanceConstraint.h" -#include "imstkPbdInflatableVolumeConstraint.h" InflatableObject::InflatableObject(const std::string& name, const Vec3d& tissueSize, const Vec3i& tissueDim, const Vec3d& tissueCenter) : PbdObject(name) { @@ -106,7 +96,7 @@ InflatableObject::InflatableObject(const std::string& name, const Vec3d& tissueS // Setup the Object setPhysicsGeometry(m_objectTetMesh); setCollidingGeometry(m_objectSurfMesh); - setPhysicsToCollidingMap(std::make_shared<OneToOneMap>(m_objectTetMesh, m_objectSurfMesh)); + setPhysicsToCollidingMap(std::make_shared<PointwiseMap>(m_objectTetMesh, m_objectSurfMesh)); setDynamicalModel(pbdModel); } diff --git a/Examples/PBD/PBDTissueContact/PBDTissueContactExample.cpp b/Examples/PBD/PBDTissueContact/PBDTissueContactExample.cpp index 2bbf78dc6ed8c23d95a3ba53d16c3c0550842fb0..e8a644cd594b6a486af474cf0f40a3c0227493b9 100644 --- a/Examples/PBD/PBDTissueContact/PBDTissueContactExample.cpp +++ b/Examples/PBD/PBDTissueContact/PBDTissueContactExample.cpp @@ -29,9 +29,9 @@ #include "imstkMeshToMeshBruteForceCD.h" #include "imstkMouseSceneControl.h" #include "imstkNew.h" -#include "imstkOneToOneMap.h" #include "imstkPbdModel.h" #include "imstkPbdObject.h" +#include "imstkPointwiseMap.h" #include "imstkRbdConstraint.h" #include "imstkRenderMaterial.h" #include "imstkRigidBodyModel2.h" @@ -273,7 +273,7 @@ makeTissueObj(const std::string& name, // Setup the Object clothObj->setPhysicsGeometry(tissueMesh); clothObj->setCollidingGeometry(surfMesh); - clothObj->setPhysicsToCollidingMap(std::make_shared<OneToOneMap>(tissueMesh, surfMesh)); + clothObj->setPhysicsToCollidingMap(std::make_shared<PointwiseMap>(tissueMesh, surfMesh)); clothObj->setDynamicalModel(pbdModel); return clothObj; diff --git a/Examples/PBD/PBDTissueStitch/PBDTissueStitchExample.cpp b/Examples/PBD/PBDTissueStitch/PBDTissueStitchExample.cpp index 4c6b068f8630a8bdeef75dba6144bbe3dd04b113..8abba9f83a29ff17bcc315473f6add39113c3593 100644 --- a/Examples/PBD/PBDTissueStitch/PBDTissueStitchExample.cpp +++ b/Examples/PBD/PBDTissueStitch/PBDTissueStitchExample.cpp @@ -26,11 +26,11 @@ #include "imstkKeyboardSceneControl.h" #include "imstkLineMesh.h" #include "imstkMouseSceneControl.h" -#include "imstkOneToOneMap.h" #include "imstkPbdModel.h" #include "imstkPbdObject.h" #include "imstkPbdObjectCollision.h" #include "imstkPbdObjectStitching.h" +#include "imstkPointwiseMap.h" #include "imstkRbdConstraint.h" #include "imstkRenderMaterial.h" #include "imstkRigidBodyModel2.h" @@ -286,7 +286,7 @@ makeTetTissueObj(const std::string& name, tissueObj->getVisualModel(0)->setRenderMaterial(material); tissueObj->setPhysicsGeometry(tissueMesh); tissueObj->setCollidingGeometry(surfMesh); - tissueObj->setPhysicsToCollidingMap(std::make_shared<OneToOneMap>(tissueMesh, surfMesh)); + tissueObj->setPhysicsToCollidingMap(std::make_shared<PointwiseMap>(tissueMesh, surfMesh)); tissueObj->setDynamicalModel(pbdModel); return tissueObj; diff --git a/Examples/PBD/PBDTissueSurfaceNeedleContact/PBDTissueSurfaceNeedleContactExample.cpp b/Examples/PBD/PBDTissueSurfaceNeedleContact/PBDTissueSurfaceNeedleContactExample.cpp index f7e8fff346aaa0560b402dd5ee85947ce26657f2..b3e6713daabf66a6391af0b8fa371fa7fe80cc8d 100644 --- a/Examples/PBD/PBDTissueSurfaceNeedleContact/PBDTissueSurfaceNeedleContactExample.cpp +++ b/Examples/PBD/PBDTissueSurfaceNeedleContact/PBDTissueSurfaceNeedleContactExample.cpp @@ -29,10 +29,10 @@ #include "imstkMeshIO.h" #include "imstkMouseSceneControl.h" #include "imstkNew.h" -#include "imstkOneToOneMap.h" #include "imstkPbdModel.h" #include "imstkPbdObject.h" #include "imstkPbdSolver.h" +#include "imstkPointwiseMap.h" #include "imstkRenderMaterial.h" #include "imstkScene.h" #include "imstkSceneManager.h" @@ -253,7 +253,7 @@ makeTissueObj(const std::string& name, // Setup the Object clothObj->setPhysicsGeometry(tissueMesh); clothObj->setCollidingGeometry(surfMesh); - clothObj->setPhysicsToCollidingMap(std::make_shared<OneToOneMap>(tissueMesh, surfMesh)); + clothObj->setPhysicsToCollidingMap(std::make_shared<PointwiseMap>(tissueMesh, surfMesh)); clothObj->setDynamicalModel(pbdModel); return clothObj; diff --git a/Examples/PBD/PBDTissueVolumeNeedleContact/PBDTissueVolumeNeedleContactExample.cpp b/Examples/PBD/PBDTissueVolumeNeedleContact/PBDTissueVolumeNeedleContactExample.cpp index d07bb99b184fe1587a0a0250bb1a8d9bba1a4c11..c581125fe54c8ff93fd0465f4015c28ecdbf9c95 100644 --- a/Examples/PBD/PBDTissueVolumeNeedleContact/PBDTissueVolumeNeedleContactExample.cpp +++ b/Examples/PBD/PBDTissueVolumeNeedleContact/PBDTissueVolumeNeedleContactExample.cpp @@ -28,9 +28,9 @@ #include "imstkMeshIO.h" #include "imstkMouseSceneControl.h" #include "imstkNew.h" -#include "imstkOneToOneMap.h" #include "imstkPbdModel.h" #include "imstkPbdObject.h" +#include "imstkPointwiseMap.h" #include "imstkRbdConstraint.h" #include "imstkRenderMaterial.h" #include "imstkRigidBodyModel2.h" @@ -271,7 +271,7 @@ makeTissueObj(const std::string& name, // Setup the Object clothObj->setPhysicsGeometry(tissueMesh); clothObj->setCollidingGeometry(surfMesh); - clothObj->setPhysicsToCollidingMap(std::make_shared<OneToOneMap>(tissueMesh, surfMesh)); + clothObj->setPhysicsToCollidingMap(std::make_shared<PointwiseMap>(tissueMesh, surfMesh)); clothObj->setDynamicalModel(pbdModel); return clothObj; diff --git a/Examples/PBD/PbdTissueGrasping/PbdTissueGraspingExample.cpp b/Examples/PBD/PbdTissueGrasping/PbdTissueGraspingExample.cpp index e3822b6baca1cfb3563208d4fbd5db824c6bba92..e512c4c5ea563bedc1c0783021e5764907e7027f 100644 --- a/Examples/PBD/PbdTissueGrasping/PbdTissueGraspingExample.cpp +++ b/Examples/PBD/PbdTissueGrasping/PbdTissueGraspingExample.cpp @@ -29,11 +29,11 @@ #include "imstkMeshIO.h" #include "imstkMouseSceneControl.h" #include "imstkNew.h" -#include "imstkOneToOneMap.h" #include "imstkPbdModel.h" #include "imstkPbdObject.h" #include "imstkPbdObjectCollision.h" #include "imstkPbdObjectGrasping.h" +#include "imstkPointwiseMap.h" #include "imstkRenderMaterial.h" #include "imstkScene.h" #include "imstkSceneManager.h" @@ -262,7 +262,7 @@ makeTissueObj(const std::string& name, // Setup the Object clothObj->setPhysicsGeometry(tissueMesh); clothObj->setCollidingGeometry(surfMesh); - clothObj->setPhysicsToCollidingMap(std::make_shared<OneToOneMap>(tissueMesh, surfMesh)); + clothObj->setPhysicsToCollidingMap(std::make_shared<PointwiseMap>(tissueMesh, surfMesh)); clothObj->setDynamicalModel(pbdModel); return clothObj; @@ -345,7 +345,7 @@ main() auto jawPicking = std::make_shared<PbdObjectGrasping>(tissueObj); // Pick the surface instead of the tetrahedral mesh jawPicking->setGeometryToPick(tissueObj->getVisualGeometry(), - std::dynamic_pointer_cast<OneToOneMap>(tissueObj->getPhysicsToCollidingMap())); + std::dynamic_pointer_cast<PointwiseMap>(tissueObj->getPhysicsToCollidingMap())); scene->addInteraction(jawPicking); // Light diff --git a/Source/CollisionHandling/imstkPbdCollisionHandling.cpp b/Source/CollisionHandling/imstkPbdCollisionHandling.cpp index 92e1b4fd8799e7d55d293791214705f7f22d5e27..929b84b505af4d78385e3d20f3404e896fb3a784 100644 --- a/Source/CollisionHandling/imstkPbdCollisionHandling.cpp +++ b/Source/CollisionHandling/imstkPbdCollisionHandling.cpp @@ -22,7 +22,6 @@ #include "imstkPbdCollisionHandling.h" #include "imstkCollisionData.h" #include "imstkGeometryMap.h" -#include "imstkOneToOneMap.h" #include "imstkPbdEdgeEdgeConstraint.h" #include "imstkPbdModel.h" #include "imstkPbdObject.h" @@ -30,6 +29,7 @@ #include "imstkPbdPointPointConstraint.h" #include "imstkPbdPointTriangleConstraint.h" #include "imstkPbdSolver.h" +#include "imstkPointwiseMap.h" #include "imstkSurfaceMesh.h" namespace imstk @@ -67,10 +67,10 @@ getVertex(const CollisionElement& elem, const MeshSide& side) std::array<VertexMassPair, 1> results; if (ptId != -1) { - auto oneToOneMap = dynamic_cast<OneToOneMap*>(side.m_mapPtr); - if (side.m_mapPtr && oneToOneMap != nullptr) + auto geomMap = dynamic_cast<PointwiseMap*>(side.m_mapPtr); + if (side.m_mapPtr && geomMap != nullptr) { - ptId = oneToOneMap->getParentVertexId(ptId); + ptId = geomMap->getParentVertexId(ptId); } results[0] = { &side.m_vertices[ptId], side.m_invMasses[ptId], &side.m_velocities[ptId] }; } @@ -99,11 +99,11 @@ getEdge(const CollisionElement& elem, const MeshSide& side) std::array<VertexMassPair, 2> results; if (v1 != -1) { - auto oneToOneMap = dynamic_cast<OneToOneMap*>(side.m_mapPtr); - if (side.m_mapPtr && oneToOneMap != nullptr) + auto geomMap = dynamic_cast<PointwiseMap*>(side.m_mapPtr); + if (side.m_mapPtr && geomMap != nullptr) { - v1 = oneToOneMap->getParentVertexId(v1); - v2 = oneToOneMap->getParentVertexId(v2); + v1 = geomMap->getParentVertexId(v1); + v2 = geomMap->getParentVertexId(v2); } results[0] = { &side.m_vertices[v1], side.m_invMasses[v1], &side.m_velocities[v1] }; results[1] = { &side.m_vertices[v2], side.m_invMasses[v2], &side.m_velocities[v2] }; @@ -135,12 +135,12 @@ getTriangle(const CollisionElement& elem, const MeshSide& side) std::array<VertexMassPair, 3> results; if (v1 != -1) { - auto oneToOneMap = dynamic_cast<OneToOneMap*>(side.m_mapPtr); - if (side.m_mapPtr && oneToOneMap != nullptr) + auto geomMap = dynamic_cast<PointwiseMap*>(side.m_mapPtr); + if (side.m_mapPtr && geomMap != nullptr) { - v1 = oneToOneMap->getParentVertexId(v1); - v2 = oneToOneMap->getParentVertexId(v2); - v3 = oneToOneMap->getParentVertexId(v3); + v1 = geomMap->getParentVertexId(v1); + v2 = geomMap->getParentVertexId(v2); + v3 = geomMap->getParentVertexId(v3); } results[0] = { &side.m_vertices[v1], side.m_invMasses[v1], &side.m_velocities[v1] }; results[1] = { &side.m_vertices[v2], side.m_invMasses[v2], &side.m_velocities[v2] }; diff --git a/Source/GeometryMappers/Testing/imstkOneToOneMapTest.cpp b/Source/GeometryMappers/Testing/imstkPointwiseMapTest.cpp similarity index 92% rename from Source/GeometryMappers/Testing/imstkOneToOneMapTest.cpp rename to Source/GeometryMappers/Testing/imstkPointwiseMapTest.cpp index 02292319d9968367b281353673f404cde85dc16d..5e7d12f394315695a70b99aba67ddda7b5ab8683 100644 --- a/Source/GeometryMappers/Testing/imstkOneToOneMapTest.cpp +++ b/Source/GeometryMappers/Testing/imstkPointwiseMapTest.cpp @@ -20,8 +20,8 @@ =========================================================================*/ #include "imstkGeometry.h" -#include "imstkOneToOneMap.h" #include "imstkPointSet.h" +#include "imstkPointwiseMap.h" #include "imstkSphere.h" #include "imstkSurfaceMesh.h" #include "imstkVecDataArray.h" @@ -60,7 +60,7 @@ getCubePoints() } } // namespace -TEST(imstkOneToOneMapTest, SimpleMap) +TEST(imstkPointwiseMapTest, SimpleMap) { auto parent = std::make_shared<PointSet>(); parent->initialize(getCubePoints()); @@ -68,7 +68,7 @@ TEST(imstkOneToOneMapTest, SimpleMap) auto child = std::make_shared<PointSet>(); child->initialize(getCubePoints()); - OneToOneMap map; + PointwiseMap map; map.setParentGeometry(parent); map.setChildGeometry(child); map.compute(); @@ -86,37 +86,37 @@ TEST(imstkOneToOneMapTest, SimpleMap) } } -TEST(imstkOneToOneMapTest, DeathTests) +TEST(imstkPointwiseMapTest, DeathTests) { auto parent = std::make_shared<PointSet>(); auto child = std::make_shared<PointSet>(); auto sphere = std::make_shared<Sphere>(); { - OneToOneMap map; + PointwiseMap map; ASSERT_DEATH(map.compute(), "without valid geometries"); } { - OneToOneMap map; + PointwiseMap map; map.setParentGeometry(parent); ASSERT_DEATH(map.compute(), "without valid geometries"); } { - OneToOneMap map; + PointwiseMap map; map.setChildGeometry(child); ASSERT_DEATH(map.compute(), "without valid geometries"); } { - OneToOneMap map; + PointwiseMap map; ASSERT_DEATH(map.setParentGeometry(sphere), "The geometry provided is not a PointSet!"); } { - OneToOneMap map; + PointwiseMap map; ASSERT_DEATH(map.setChildGeometry(sphere), "The geometry provided is not a PointSet!"); } } -TEST(imstkOneToOneMapTest, OneToManyMap) +TEST(imstkPointwiseMapTest, OneToManyMap) { auto parent = std::make_shared<PointSet>(); parent->initialize(getCubePoints()); @@ -127,7 +127,7 @@ TEST(imstkOneToOneMapTest, OneToManyMap) points->push_back(Vec3d(0.5, 0.5, -0.5) * 10); child->initialize(points); - OneToOneMap map; + PointwiseMap map; map.setParentGeometry(parent); map.setChildGeometry(child); map.setTolerance(1e-8); diff --git a/Source/GeometryMappers/imstkOneToOneMap.cpp b/Source/GeometryMappers/imstkPointwiseMap.cpp similarity index 88% rename from Source/GeometryMappers/imstkOneToOneMap.cpp rename to Source/GeometryMappers/imstkPointwiseMap.cpp index ca03777f84674f845f48fa6a212fee3fc1a60b7b..5b2d648c63a0ca6e03ab1e11d984775dd8e326b0 100644 --- a/Source/GeometryMappers/imstkOneToOneMap.cpp +++ b/Source/GeometryMappers/imstkPointwiseMap.cpp @@ -13,20 +13,20 @@ limitations under the License. =========================================================================*/ -#include "imstkOneToOneMap.h" +#include "imstkPointwiseMap.h" #include "imstkParallelUtils.h" #include "imstkLogger.h" #include "imstkPointSet.h" namespace imstk { -OneToOneMap::OneToOneMap() +PointwiseMap::PointwiseMap() { setRequiredInputType<PointSet>(0); setRequiredInputType<PointSet>(1); } -OneToOneMap::OneToOneMap( +PointwiseMap::PointwiseMap( std::shared_ptr<Geometry> parent, std::shared_ptr<Geometry> child) { @@ -38,11 +38,11 @@ OneToOneMap::OneToOneMap( } void -OneToOneMap::compute() +PointwiseMap::compute() { if (!areInputsValid()) { - LOG(WARNING) << "OneToOneMap failed to run, inputs not satisfied"; + LOG(WARNING) << "PointwiseMap failed to run, inputs not satisfied"; return; } @@ -58,13 +58,13 @@ OneToOneMap::compute() } void -OneToOneMap::computeMap(std::unordered_map<int, int>& tetVertToSurfVertMap) +PointwiseMap::computeMap(std::unordered_map<int, int>& tetVertToSurfVertMap) { tetVertToSurfVertMap.clear(); if (!areInputsValid()) { - LOG(WARNING) << "OneToOneMap failed to run, inputs not satisfied"; + LOG(WARNING) << "PointwiseMap failed to run, inputs not satisfied"; return; } @@ -97,7 +97,7 @@ OneToOneMap::computeMap(std::unordered_map<int, int>& tetVertToSurfVertMap) } int -OneToOneMap::findMatchingVertex(const VecDataArray<double, 3>& parentVertices, const Vec3d& p) +PointwiseMap::findMatchingVertex(const VecDataArray<double, 3>& parentVertices, const Vec3d& p) { for (int idx = 0; idx < parentVertices.size(); idx++) { @@ -110,7 +110,7 @@ OneToOneMap::findMatchingVertex(const VecDataArray<double, 3>& parentVertices, c } void -OneToOneMap::setMap(const std::unordered_map<int, int>& sourceMap) +PointwiseMap::setMap(const std::unordered_map<int, int>& sourceMap) { m_oneToOneMap = sourceMap; @@ -123,7 +123,7 @@ OneToOneMap::setMap(const std::unordered_map<int, int>& sourceMap) } void -OneToOneMap::requestUpdate() +PointwiseMap::requestUpdate() { auto meshParent = std::dynamic_pointer_cast<PointSet>(getParentGeometry()); auto meshChild = std::dynamic_pointer_cast<PointSet>(getChildGeometry()); @@ -147,7 +147,7 @@ OneToOneMap::requestUpdate() } int -OneToOneMap::getParentVertexId(const int childVertexId) const +PointwiseMap::getParentVertexId(const int childVertexId) const { auto citer = m_oneToOneMap.find(childVertexId); return (citer != m_oneToOneMap.end()) ? citer->second : -1; diff --git a/Source/GeometryMappers/imstkOneToOneMap.h b/Source/GeometryMappers/imstkPointwiseMap.h similarity index 91% rename from Source/GeometryMappers/imstkOneToOneMap.h rename to Source/GeometryMappers/imstkPointwiseMap.h index 8a743c6444d5a59c9776ae9dff45c62ac05f2c89..1f08dbf33ab25e5de327f47a094313ba5deb5136 100644 --- a/Source/GeometryMappers/imstkOneToOneMap.h +++ b/Source/GeometryMappers/imstkPointwiseMap.h @@ -25,19 +25,19 @@ namespace imstk template<typename T, int N> class VecDataArray; /// -/// \class OneToOneMap +/// \class PointwiseMap /// -/// \brief OneToOneMap can compute & apply a one-to-one mapping between parent -/// and child PointSet geometries. +/// \brief PointwiseMap can compute & apply a mapping between parent and +/// child PointSet geometries. /// -class OneToOneMap : public GeometryMap +class PointwiseMap : public GeometryMap { public: - OneToOneMap(); - OneToOneMap( + PointwiseMap(); + PointwiseMap( std::shared_ptr<Geometry> parent, std::shared_ptr<Geometry> child); - ~OneToOneMap() override = default; + ~PointwiseMap() override = default; IMSTK_TYPE_NAME(OneToOneMap) diff --git a/Source/GeometryMappers/imstkSurfaceToTetraMap.cpp b/Source/GeometryMappers/imstkSurfaceToTetraMap.cpp index df05db3e04c2a20dc7b106bd3d71dfda58de145a..0259de4ecc3d65918419a856c657a7262b6910d5 100644 --- a/Source/GeometryMappers/imstkSurfaceToTetraMap.cpp +++ b/Source/GeometryMappers/imstkSurfaceToTetraMap.cpp @@ -40,7 +40,7 @@ SurfaceToTetraMap::SurfaceToTetraMap( void SurfaceToTetraMap::compute() { - OneToOneMap::compute(); + PointwiseMap::compute(); m_triToTetMap.clear(); computeTriToTetMap(m_triToTetMap); diff --git a/Source/GeometryMappers/imstkSurfaceToTetraMap.h b/Source/GeometryMappers/imstkSurfaceToTetraMap.h index 04dbc22b3826efdd17317fe95b810731993f5792..72ded5e279f8ac3cd9c67bb44551601004ad0c65 100644 --- a/Source/GeometryMappers/imstkSurfaceToTetraMap.h +++ b/Source/GeometryMappers/imstkSurfaceToTetraMap.h @@ -15,7 +15,7 @@ #pragma once -#include "imstkOneToOneMap.h" +#include "imstkPointwiseMap.h" #include "imstkMath.h" #include "imstkTypes.h" @@ -24,10 +24,10 @@ namespace imstk /// /// \class SurfaceToTetraMap /// -/// \brief SurfaceToTetrahedralMap serves as a OneToOneMap but also -/// maps tets to triangle faces. +/// \brief SurfaceToTetrahedralMap serves as a PointwiseMap but also maps +/// tets to triangle faces. /// -class SurfaceToTetraMap : public OneToOneMap +class SurfaceToTetraMap : public PointwiseMap { public: SurfaceToTetraMap(); diff --git a/Source/Scene/imstkPbdObjectGrasping.cpp b/Source/Scene/imstkPbdObjectGrasping.cpp index 2fe2c66dc7ffcf22a32fc90e98e95283bdeac171..8d9a11abc0f9376de538bba7e5f26efaacc715a8 100644 --- a/Source/Scene/imstkPbdObjectGrasping.cpp +++ b/Source/Scene/imstkPbdObjectGrasping.cpp @@ -24,11 +24,11 @@ limitations under the License. #include "imstkCDObjectFactory.h" #include "imstkCellPicker.h" #include "imstkLineMesh.h" -#include "imstkOneToOneMap.h" #include "imstkPbdBaryPointToPointConstraint.h" #include "imstkPbdModel.h" #include "imstkPbdObject.h" #include "imstkPointPicker.h" +#include "imstkPointwiseMap.h" #include "imstkSurfaceMesh.h" #include "imstkTaskGraph.h" #include "imstkTetrahedralMesh.h" @@ -44,7 +44,7 @@ namespace imstk struct MeshSide { MeshSide(VecDataArray<double, 3>& verticest, VecDataArray<double, 3>& velocitiest, DataArray<double>& invMassest, - AbstractDataArray* indicesPtrt, OneToOneMap* mapt) : vertices(verticest), velocities(velocitiest), + AbstractDataArray* indicesPtrt, PointwiseMap* mapt) : vertices(verticest), velocities(velocitiest), invMasses(invMassest), indicesPtr(indicesPtrt), map(mapt) { } @@ -53,7 +53,7 @@ struct MeshSide VecDataArray<double, 3>& velocities; DataArray<double>& invMasses; AbstractDataArray* indicesPtr = nullptr; - OneToOneMap* map = nullptr; + PointwiseMap* map = nullptr; }; template<int N> @@ -223,7 +223,7 @@ PbdObjectGrasping::addPickConstraints() } // If the user tries to pick - OneToOneMap* map = nullptr; + PointwiseMap* map = nullptr; if (m_geometryToPickMap != nullptr) { map = m_geometryToPickMap.get(); diff --git a/Source/Scene/imstkPbdObjectGrasping.h b/Source/Scene/imstkPbdObjectGrasping.h index 61bbb2c42f4e4367901da0428a10abf4a55aaa73..ff3c48049253a83a7769515c9d8d626f6a9a999b 100644 --- a/Source/Scene/imstkPbdObjectGrasping.h +++ b/Source/Scene/imstkPbdObjectGrasping.h @@ -31,11 +31,11 @@ limitations under the License. namespace imstk { class AnalyticalGeometry; -class OneToOneMap; class PbdCollisionConstraint; class PbdObject; -class PointSet; class PickingAlgorithm; +class PointSet; +class PointwiseMap; /// /// \class PbdObjectGrasping @@ -140,7 +140,7 @@ public: /// \brief Set a different geometry to pick with and a mapping back to the physics geometry /// to select the correct vertices /// - void setGeometryToPick(std::shared_ptr<Geometry> geomToPick, std::shared_ptr<OneToOneMap> map) + void setGeometryToPick(std::shared_ptr<Geometry> geomToPick, std::shared_ptr<PointwiseMap> map) { m_geomToPick = geomToPick; m_geometryToPickMap = map; @@ -164,8 +164,8 @@ protected: protected: std::shared_ptr<TaskNode> m_pickingNode = nullptr; - std::shared_ptr<Geometry> m_geomToPick = nullptr; - std::shared_ptr<OneToOneMap> m_geometryToPickMap = nullptr; + std::shared_ptr<Geometry> m_geomToPick = nullptr; + std::shared_ptr<PointwiseMap> m_geometryToPickMap = nullptr; std::shared_ptr<PbdObject> m_objectToGrasp = nullptr; std::shared_ptr<AnalyticalGeometry> m_graspGeom = nullptr; diff --git a/Source/Scene/imstkPbdObjectStitching.cpp b/Source/Scene/imstkPbdObjectStitching.cpp index ae9bfeda5355c5005e324fa186558950fd7ca6c1..acd4f02d4935afc4d5ef07c8c4ebb1a4671874f5 100644 --- a/Source/Scene/imstkPbdObjectStitching.cpp +++ b/Source/Scene/imstkPbdObjectStitching.cpp @@ -41,7 +41,7 @@ namespace imstk struct MeshSide { MeshSide(VecDataArray<double, 3>& verticest, VecDataArray<double, 3>& velocitiest, DataArray<double>& invMassest, - AbstractDataArray* indicesPtrt, OneToOneMap* mapt) : vertices(verticest), velocities(velocitiest), + AbstractDataArray* indicesPtrt, PointwiseMap* mapt) : vertices(verticest), velocities(velocitiest), invMasses(invMassest), indicesPtr(indicesPtrt), map(mapt) { } @@ -50,7 +50,7 @@ struct MeshSide VecDataArray<double, 3>& velocities; DataArray<double>& invMasses; AbstractDataArray* indicesPtr = nullptr; - OneToOneMap* map = nullptr; + PointwiseMap* map = nullptr; }; template<int N> @@ -197,7 +197,7 @@ PbdObjectStitching::addStitchConstraints() } // If the user tries to pick - OneToOneMap* map = nullptr; + PointwiseMap* map = nullptr; if (m_geometryToStitchMap != nullptr) { map = m_geometryToStitchMap.get(); diff --git a/Source/Scene/imstkPbdObjectStitching.h b/Source/Scene/imstkPbdObjectStitching.h index 8be3fd206a7c8fad1b4bca675bbfb2e7f782516b..eb176e0fd5cadb33c8a61aeb07689433fb235fde 100644 --- a/Source/Scene/imstkPbdObjectStitching.h +++ b/Source/Scene/imstkPbdObjectStitching.h @@ -29,11 +29,11 @@ limitations under the License. namespace imstk { -class OneToOneMap; class PbdBaryPointToPointConstraint; class PbdObject; class PointSet; class PickingAlgorithm; +class PointwiseMap; /// /// \class PbdObjectStitching @@ -104,7 +104,7 @@ public: /// \brief Set a different geometry to pick with and a mapping back to the physics geometry /// to select the correct vertices /// - void setGeometryToStitch(std::shared_ptr<Geometry> geomToStitch, std::shared_ptr<OneToOneMap> map) + void setGeometryToStitch(std::shared_ptr<Geometry> geomToStitch, std::shared_ptr<PointwiseMap> map) { m_geomToStitch = geomToStitch; m_geometryToStitchMap = map; @@ -128,8 +128,8 @@ protected: protected: std::shared_ptr<TaskNode> m_stitchingNode = nullptr; - std::shared_ptr<Geometry> m_geomToStitch = nullptr; - std::shared_ptr<OneToOneMap> m_geometryToStitchMap = nullptr; + std::shared_ptr<Geometry> m_geomToStitch = nullptr; + std::shared_ptr<PointwiseMap> m_geometryToStitchMap = nullptr; std::shared_ptr<PbdObject> m_objectToStitch = nullptr; diff --git a/Source/SimulationManager/Testing/imstkSceneSwitchTest.cpp b/Source/SimulationManager/Testing/imstkSceneSwitchTest.cpp index 75fcf02dae8268c72ac572a932a042e9a4dc64f7..335991568a75624c25d2c39fd2838d8a56466925 100644 --- a/Source/SimulationManager/Testing/imstkSceneSwitchTest.cpp +++ b/Source/SimulationManager/Testing/imstkSceneSwitchTest.cpp @@ -21,9 +21,9 @@ #include "imstkCamera.h" #include "imstkMeshIO.h" -#include "imstkOneToOneMap.h" #include "imstkPbdModel.h" #include "imstkPbdObject.h" +#include "imstkPointwiseMap.h" #include "imstkRenderMaterial.h" #include "imstkScene.h" #include "imstkSceneManager.h" @@ -124,7 +124,7 @@ createSoftBodyScene(std::string sceneName) pbdObj->setVisualGeometry(surfMesh); pbdObj->getVisualModel(0)->getRenderMaterial()->setDisplayMode(RenderMaterial::DisplayMode::WireframeSurface); pbdObj->setPhysicsGeometry(tetMesh); - pbdObj->setPhysicsToVisualMap(std::make_shared<OneToOneMap>(tetMesh, surfMesh)); + pbdObj->setPhysicsToVisualMap(std::make_shared<PointwiseMap>(tetMesh, surfMesh)); pbdObj->setDynamicalModel(pbdModel); scene->addSceneObject(pbdObj); diff --git a/Source/Wrappers/SwigInterface/imstkCWrapper.i b/Source/Wrappers/SwigInterface/imstkCWrapper.i index 9683dfef8b9f6900e9908b5699f0e9da17ff902f..b9149ad84fa657a50d4da3948ab650e8942a3f59 100644 --- a/Source/Wrappers/SwigInterface/imstkCWrapper.i +++ b/Source/Wrappers/SwigInterface/imstkCWrapper.i @@ -47,7 +47,7 @@ * GeometryMappers */ #include "imstkGeometryMap.h" -#include "imstkOneToOneMap.h" +#include "imstkPointwiseMap.h" #include "imstkTetraTriangleMap.h" /* @@ -267,7 +267,7 @@ namespace std * GeometryMap */ %include "../../GeometryMappers/imstkGeometryMap.h" -%include "../../GeometryMappers/imstkOneToOneMap.h" +%include "../../GeometryMappers/imstkPointwiseMap.h" %include "../../GeometryMappers/imstkTetraTriangleMap.h" /* diff --git a/Source/Wrappers/SwigInterface/shared_ptr_instantiation.i b/Source/Wrappers/SwigInterface/shared_ptr_instantiation.i index 92de602b4a52b3285910d35cc67037153b3dac4b..bb8f588e7dddec0d5f02b1013be8d1e0dc8c8443 100644 --- a/Source/Wrappers/SwigInterface/shared_ptr_instantiation.i +++ b/Source/Wrappers/SwigInterface/shared_ptr_instantiation.i @@ -50,7 +50,7 @@ * GeometryMap */ %shared_ptr(imstk::GeometryMap) -%shared_ptr(imstk::OneToOneMap) +%shared_ptr(imstk::PointwiseMap) %shared_ptr(imstk::TetraTriangleMap) /*