iMSTK
Interactive Medical Simulation Toolkit
imstkPuncturable.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 "imstkComponent.h"
10 #include "imstkPuncture.h"
11 
12 namespace imstk
13 {
14 class Entity;
15 class Needle;
16 class Puncturable;
17 
26 class Puncturable : public Component
27 {
28 public:
29  Puncturable(const std::string& name = "Puncturable") : Component(name) { }
30  ~Puncturable() override = default;
31 
35  void setPuncture(const PunctureId& id, std::shared_ptr<Puncture> data);
36  std::shared_ptr<Puncture> getPuncture(const PunctureId& id);
38 
39  bool getPunctured() const;
40 
41 protected:
42  PunctureMap m_punctures;
43 };
44 
48 PunctureId getPunctureId(std::shared_ptr<Needle> needle,
49  std::shared_ptr<Puncturable> puncturable,
50  const int supportId = -1);
51 } // namespace imstk
PunctureId getPunctureId(std::shared_ptr< Needle > needle, std::shared_ptr< Puncturable > puncturable, const int supportId)
Get puncture id between needle and puncturable.
Place this on an object to make it puncturable by a needle. This allows puncturables to know they&#39;ve ...
Compound Geometry.
Represents a part of an entity, involved in a system. The component system is doubly linked meaning t...
void setPuncture(const PunctureId &id, std::shared_ptr< Puncture > data)
Get/Set puncture data.
std::tuple< int, int, int > PunctureId
Punctures are identified via three ints. The needle id, the puncturable id, and a local id that allow...
Definition: imstkPuncture.h:21