8 #include "imstkSceneObject.h" 9 #include "imstkMacros.h" 10 #include "imstkMath.h" 12 #include <unordered_set> 14 #include <unordered_map> 19 class AbstractCellMesh;
41 enum class OtherMeshUpdateType
45 VisualReuseVertices = 2,
46 VisualSeparateVertices = 4,
47 CollisionAndVisualSeparate = Collision | VisualSeparateVertices,
48 CollisionAndVisualReused = Collision | VisualReuseVertices
51 PbdObjectCellRemoval(std::shared_ptr<PbdObject> pbdObj, OtherMeshUpdateType alsoUpdate = OtherMeshUpdateType::None);
73 void removeConstraints();
75 void addDummyVertexPointSet(std::shared_ptr<PointSet> pointSet);
76 void addDummyVertex(std::shared_ptr<AbstractCellMesh> mesh);
79 std::shared_ptr<PbdObject>
m_obj;
80 std::shared_ptr<AbstractCellMesh>
m_mesh;
87 bool newVertexOnSplit =
false;
88 std::shared_ptr<SurfaceMesh> surfaceMesh;
89 std::shared_ptr<PointwiseMap> map;
92 std::multimap<int, int> tetToTriMap;
96 std::multimap<int, std::pair<int, Vec3i>> tetAdjancencyMap;
99 std::unordered_map<int, int> tetVertToTriVertMap;
102 OtherMeshUpdateType m_updateMode;
104 std::vector<LinkedMeshData> m_linkedMeshData;
106 void updateMesh(LinkedMeshData& data);
107 void setupForExtraMeshUpdates(std::shared_ptr<SurfaceMesh> surfaceMesh, std::shared_ptr<PointwiseMap> map);
std::vector< int > m_cellsToRemove
List of cells to remove, cleared after removal.
std::vector< int > m_removedCells
Cells that have been removed.
std::shared_ptr< PbdObject > m_obj
Object that cells are removed from.
void removeCellOnApply(int cellId)
Adds cell to list of cells to be removed.
This class defines a method of removing cells and their associated constraints from a Pbd object...
std::shared_ptr< AbstractCellMesh > m_mesh
Mesh from object cells are removed from.
Base class for all scene objects. A scene object can optionally be visible and collide with other sce...
void apply()
removed cells and associated constraints
std::vector< int > getRemovedCells()
Get ids of cells that have been removed.