iMSTK
Interactive Medical Simulation Toolkit
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Protected Member Functions | List of all members
imstk::SurfaceMeshCut Class Reference

This filter cuts the triangles of a SurfaceMesh into smaller triangles using input cutting geometry. More...

#include <imstkSurfaceMeshCut.h>

Inheritance diagram for imstk::SurfaceMeshCut:
Inheritance graph
[legend]
Collaboration diagram for imstk::SurfaceMeshCut:
Collaboration graph
[legend]

Public Member Functions

std::shared_ptr< SurfaceMeshgetOutputMesh ()
 
void setInputMesh (std::shared_ptr< SurfaceMesh > inputSurf)
 
- Public Member Functions inherited from imstk::MeshCut
void requestUpdate () override
 Users can implement this for the logic to be run.
 
std::shared_ptr< std::map< int, int > > getCutVertMap ()
 
 imstkGetMacro (CutData, std::shared_ptr< std::vector< CutData >>)
 
 imstkSetMacro (CutData, std::shared_ptr< std::vector< CutData >>)
 
 imstkGetMacro (CutGeometry, std::shared_ptr< Geometry >)
 
 imstkSetMacro (CutGeometry, std::shared_ptr< Geometry >)
 
 imstkGetMacro (Epsilon, double)
 
 imstkSetMacro (Epsilon, double)
 
 imstkGetMacro (RemoveConstraintVertices, std::shared_ptr< std::unordered_set< size_t >>)
 
 imstkGetMacro (AddConstraintVertices, std::shared_ptr< std::unordered_set< size_t >>)
 
- Public Member Functions inherited from imstk::GeometryAlgorithm
std::shared_ptr< GeometrygetInput (size_t port=0) const
 Returns input geometry given port, returns nullptr if doesn't exist.
 
std::shared_ptr< GeometrygetOutput (size_t port=0) const
 Returns output geometry given port, returns nullptr if doesn't exist.
 
void setInput (std::shared_ptr< Geometry > inputGeometry, size_t port=0)
 Set the input at the port.
 
void update ()
 Do the actual algorithm.
 

Protected Member Functions

void refinement (std::shared_ptr< AbstractCellMesh > outputGeom, std::map< int, bool > &cutVerts) override
 Refine the mesh adding vertices and changing connectivity along the cut. More...
 
void splitVerts (std::shared_ptr< AbstractCellMesh > outputGeom, std::map< int, bool > &cutVerts, std::shared_ptr< Geometry > cuttingGeom) override
 Split the cutting vertices, separating them into two. More...
 
std::shared_ptr< std::vector< CutData > > generateCutData (std::shared_ptr< Geometry > cuttingGeom, std::shared_ptr< AbstractCellMesh > geomToCut) override
 Generate CutData which defines how the cut should be performed.
 
std::shared_ptr< std::vector< CutData > > generateImplicitCutData (std::shared_ptr< AnalyticalGeometry > cuttingGeom, std::shared_ptr< SurfaceMesh > geomToCut)
 
std::shared_ptr< std::vector< CutData > > generateSurfaceMeshCutData (std::shared_ptr< SurfaceMesh > cuttingGeom, std::shared_ptr< SurfaceMesh > geomToCut)
 
- Protected Member Functions inherited from imstk::MeshCut
int ptBoundarySign (const Vec3d &pt, std::shared_ptr< Geometry > geometry)
 Determine the sign of the point -1 if inside, 1 if outside, 0 if on boundary defined by epsilon.
 
template<int N>
bool vertexOnBoundary (std::shared_ptr< VecDataArray< int, N >> cells, std::set< int > &cellSet)
 
bool pointProjectionInSurface (const Vec3d &pt, std::shared_ptr< SurfaceMesh > surface)
 
- Protected Member Functions inherited from imstk::GeometryAlgorithm
void setOutput (std::shared_ptr< Geometry > inputGeometry, const size_t port=0)
 Set the output at the port.
 
template<typename T >
void setRequiredInputType (const size_t port)
 Declares the type for the port with the given number, also defines that the give port is required for the filter to run correctly.
 
template<typename T >
void setOptionalInputType (const size_t port)
 Declares the type for the port with the given number, the data for this port is optional and may be omitted.
 
virtual bool areInputsValid ()
 Check inputs are correct. More...
 
void setNumInputPorts (const size_t numPorts)
 Get/Set the amount of input ports.
 
 imstkGetMacro (NumInputPorts, size_t)
 
void setNumOutputPorts (const size_t numPorts)
 Get/Set the amount of output ports.
 
 imstkGetMacro (NumOutputPorts, size_t)
 

Additional Inherited Members

- Protected Types inherited from imstk::GeometryAlgorithm
using GeometryCheck = std::function< bool(Geometry *)>
 
using TypeCheckContainer = std::unordered_map< size_t, GeometryCheck >
 
- Protected Attributes inherited from imstk::MeshCut
std::shared_ptr< std::vector< CutData > > m_CutData = nullptr
 
std::shared_ptr< std::map< int, int > > m_CutVertMap
 
std::shared_ptr< Geometrym_CutGeometry = nullptr
 
std::shared_ptr< std::unordered_set< size_t > > m_RemoveConstraintVertices = nullptr
 
std::shared_ptr< std::unordered_set< size_t > > m_AddConstraintVertices = nullptr
 
double m_Epsilon = 0.001
 
- Protected Attributes inherited from imstk::GeometryAlgorithm
TypeCheckContainer m_requiredTypeChecks
 
TypeCheckContainer m_optionalTypeChecks
 

Detailed Description

This filter cuts the triangles of a SurfaceMesh into smaller triangles using input cutting geometry.

Definition at line 67 of file imstkSurfaceMeshCut.h.

Member Function Documentation

◆ refinement()

void imstk::SurfaceMeshCut::refinement ( std::shared_ptr< AbstractCellMesh outputGeom,
std::map< int, bool > &  cutVerts 
)
overrideprotectedvirtual

Refine the mesh adding vertices and changing connectivity along the cut.

Parameters
Geometryto cut
verticeson cutting path and whether they should be split

Implements imstk::MeshCut.

Definition at line 37 of file imstkSurfaceMeshCut.cpp.

◆ splitVerts()

void imstk::SurfaceMeshCut::splitVerts ( std::shared_ptr< AbstractCellMesh outputGeom,
std::map< int, bool > &  cutVerts,
std::shared_ptr< Geometry cuttingGeom 
)
overrideprotectedvirtual

Split the cutting vertices, separating them into two.

Parameters
Geometryto cut
verticeson cutting path and whether they should be split
Geometryto cut with

Implements imstk::MeshCut.

Definition at line 201 of file imstkSurfaceMeshCut.cpp.

Here is the call graph for this function:

The documentation for this class was generated from the following files: