iMSTK
Interactive Medical Simulation Toolkit
imstkTaskGraphController.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 <memory>
10 
11 namespace imstk
12 {
13 class TaskGraph;
14 
21 {
22 public:
23  TaskGraphController() = default;
24  virtual ~TaskGraphController() = default;
25 
26 public:
27  virtual void setTaskGraph(std::shared_ptr<TaskGraph> graph) { this->m_graph = graph; }
28 
29  std::shared_ptr<TaskGraph> getTaskGraph() const { return m_graph; }
30 
36  bool initialize();
37 
41  virtual void execute() = 0;
42 
43 protected:
47  virtual void init() { }
48 
49 protected:
50  std::shared_ptr<TaskGraph> m_graph = nullptr;
51 };
52 } // namespace imstk
Compound Geometry.
bool initialize()
Initialization of the TaskGraphController, good for anything the controller may need to do after it r...
virtual void init()
Subclass initialization call.
virtual void execute()=0
Executes the TaskGraph.
Base class for TaskGraph controllers which are responsible for executing the TaskGraph.