iMSTK
Interactive Medical Simulation Toolkit
imstkBurnable.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 #include "imstkComponent.h"
8 #include "imstkMath.h"
9 #include "imstkVecDataArray.h"
10 #include "imstkPbdObjectCellRemoval.h"
11 
12 #pragma once
13 
14 namespace imstk
15 {
16 class PbdConstraint;
17 class PbdObject;
18 class PbdObjectCellRemoval;
19 class TaskNode;
20 
29 class Burnable : public SceneBehaviour
30 {
31 public:
32  Burnable(const std::string& name = "BurnableBehaviour");
33 
37  std::shared_ptr<PbdObject> getPbdObject() const { return m_burnableObject; }
39 
40  void setTrackOnly(bool val) { m_trackOnly = val; }
41 
42  bool getTrackOnly() const { return m_trackOnly; }
43 
44  // Check state of mesh and delete cells that are burned away
45  // void update(double dt);
46  void visualUpdate(const double& dt) override;
47 
48  void setUpdateType(PbdObjectCellRemoval::OtherMeshUpdateType updateType)
49  {
50  m_updateType = updateType;
51  }
52 
53  PbdObjectCellRemoval::OtherMeshUpdateType getUpdateType() const
54  {
55  return m_updateType;
56  }
57 
58  std::shared_ptr<PbdObjectCellRemoval> getCellRemover() const
59  {
60  return m_cellRemover;
61  }
62 
63 protected:
64 
65  // Allocate state against mesh
66  void init() override;
67 
68  bool m_trackOnly = false;
69 
70  PbdObjectCellRemoval::OtherMeshUpdateType m_updateType = PbdObjectCellRemoval::OtherMeshUpdateType::None;
71 
72  std::shared_ptr<PbdObject> m_burnableObject;
73  std::shared_ptr<PbdObjectCellRemoval> m_cellRemover;
74 
75  std::shared_ptr<DataArray<double>> m_burnDamagePtr;
76  std::shared_ptr<DataArray<double>> m_burnVisualPtr;
77 };
78 } // namespace imstk
std::shared_ptr< PbdObject > m_burnableObject
Object being burned.
Definition: imstkBurnable.h:72
Compound Geometry.
Defines the behaviour to allow a Pbd Object to be burned. This object creates the state data on the m...
Definition: imstkBurnable.h:29
A Behaviour represents a single component system A template is used here for UpdateInfo to keep the C...
std::shared_ptr< PbdObject > getPbdObject() const
Get the PBD object to be torn.
Definition: imstkBurnable.h:37
std::shared_ptr< PbdObjectCellRemoval > m_cellRemover
Cell remover for removing cells.
Definition: imstkBurnable.h:73
void init() override
Initialize the component, called at a later time after all component construction is complete...