iMSTK
Interactive Medical Simulation Toolkit
NeedleInteraction.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 "imstkMacros.h"
10 #include "imstkPbdObjectCollision.h"
11 
12 using namespace imstk;
13 
14 class NeedleEmbedder;
15 
16 namespace imstk
17 {
18 class PbdObject;
19 class TetraToLineMeshCD;
20 } // namespace imstk
21 
28 {
29 public:
30  NeedleInteraction(std::shared_ptr<PbdObject> tissueObj,
31  std::shared_ptr<PbdObject> needleObj,
32  const std::string& collisionName = "");
33  ~NeedleInteraction() override = default;
34 
35  IMSTK_TYPE_NAME(NeedleInteraction)
36 
37  std::shared_ptr<NeedleEmbedder> getEmbedder() const { return m_embedder; }
38 
39  void setFriction(const double friction);
40  double getFriction() const;
41 
42  void setNeedleCompliance(const double compliance);
43  double getNeedleCompliance() const;
44 
45  void setStaticFrictionForceThreshold(const double force);
46  const double getStaticFrictionForceThreshold() const;
47 
48  void setPunctureForceThreshold(const double forceThreshold);
49  const double getPunctureForceThreshold() const;
50 
54  void initGraphEdges(std::shared_ptr<TaskNode> source, std::shared_ptr<TaskNode> sink) override;
55 
56 protected:
57  std::shared_ptr<NeedleEmbedder> m_embedder;
58  std::shared_ptr<TaskNode> m_embedderNode = nullptr;
59 };
Defines interaction between NeedleObject and PbdObject.
Computes intersection points along a line mesh on the faces of the tetrahedrons.
Compound Geometry.
Implements PBD embedded tissue handling for when the needle is embedded in the tissue.
Base class for scene objects that move and/or deform under position based dynamics formulation...
This class defines a collision interaction between two PbdObjects or PbdObject & CollidingObject.
void setFriction(const double friction)
Get/Set the friction, which gives how much velocity is removed along the tangents during contact...
void initGraphEdges()
Initializes the edges of the SceneObject&#39;s computational graph.