iMSTK
Interactive Medical Simulation Toolkit
imstkSequentialTaskGraphController.cpp
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 "imstkSequentialTaskGraphController.h"
8 #include "imstkTaskGraph.h"
9 
10 namespace imstk
11 {
12 void
14 {
15  m_executionOrderedNodes = TaskGraph::topologicalSort(m_graph);
16 }
17 
18 void
20 {
21  // Sequential
22  for (std::shared_ptr<TaskNode> node : *m_executionOrderedNodes)
23  {
24  node->execute();
25  }
26 }
27 } // namespace imstk
Compound Geometry.
void execute() override
Executes the TaskGraph.
static std::shared_ptr< TaskNodeList > topologicalSort(std::shared_ptr< TaskGraph > graph)
Graph sum, shared references are considered identical nodes, source/sink of results invalidated/nullp...
void init() override
Sorts the computational nodes.