OSSIA
Open Scenario System for Interactive Application
Loading...
Searching...
No Matches
continuity.hpp
1#pragma once
2#include <ossia/dataflow/graph_node.hpp>
3#include <ossia/editor/loop/loop.hpp>
4#include <ossia/editor/scenario/scenario.hpp>
6namespace ossia
7{
8
9template <void (graph_node::*fun_T)(bool)>
10struct mark_discontinuous
11{
12 void operator()(scenario& s) const
13 {
14#if defined(OSSIA_SCENARIO_DATAFLOW)
15 (s.node.get()->*fun_T)(true);
16 for(auto& itv : s.get_time_intervals())
17 {
18 if(!itv->node->requested_tokens.empty())
19 {
20 (*this)(*itv);
21 }
22 }
23#endif
24 }
25 void operator()(time_interval& itv) const
26 {
27#if defined(OSSIA_SCENARIO_DATAFLOW) && defined(__cpp_rtti)
28 (itv.node.get()->*fun_T)(true);
29 for(auto& proc : itv.get_time_processes())
30 {
31 if(proc->node)
32 {
33 (proc->node.get()->*fun_T)(true);
34 auto ptr = proc->node.get();
35 if(auto scenar = dynamic_cast<scenario*>(ptr))
36 (*this)(*scenar);
37 }
38 }
39#endif
40 }
41};
42using mark_start_discontinuous
43 = mark_discontinuous<&graph_node::set_start_discontinuous>;
44using mark_end_discontinuous = mark_discontinuous<&graph_node::set_end_discontinuous>;
45}
Definition git_info.h:7