NetDEM v1.0
Loading...
Searching...
No Matches
modifier_manager.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "modifier.hpp"
4#include <memory>
5#include <string>
6#include <unordered_map>
7#include <unordered_set>
8
9namespace netdem {
10
19private:
20 // object maps
21 std::unordered_map<std::string, Modifier *> modifier_lib;
22
23 // active modifiers
25
26 // subscribers
27 std::unordered_set<Modifier *> scene_state_subscribers;
28
29public:
34
40 void Init(Simulation *s);
41
49
55 void RemoveModifier(std::string const &label);
56
62 void Enable(std::string const &label);
63
69 void Disable(std::string const &label);
70
76 void Enable(Modifier *const e);
77
83 void Disable(Modifier *const e);
84
91 Modifier *FindModifier(std::string const &label);
92
99 bool FindModifier(Modifier *const e);
100
105 void UpdateModifiers();
106
113 void ExecuteModifiers(DEMSolver::CyclePoint cycle_point);
114
119
120private:
121 Simulation *sim{nullptr};
122};
123
124} // namespace netdem
CyclePoint
Definition dem_solver.hpp:27
An interface class used to modify a DEM simulation.
Definition modifier.hpp:18
A class used to manage modifiers in a simulation.
Definition modifier_manager.hpp:18
void Init(Simulation *s)
Initializes the ModifierManager instance.
Definition modifier_manager.cpp:11
void UpdateModifiers()
Updates the modifiers in the scene_state_subscribers when the scene changes.
Definition modifier_manager.cpp:97
Modifier * FindModifier(std::string const &label)
Finds a modifier in the simulation by label.
~ModifierManager()
Destructor for ModifierManager class.
Definition modifier_manager.cpp:109
Modifier * Insert(Modifier *e)
Inserts new modifier into the simulation.
Definition modifier_manager.cpp:17
void Enable(std::string const &label)
Enables a modifier in the simulation.
ModifierManager()
Default constructor for ModifierManager class.
Definition modifier_manager.cpp:9
void RemoveModifier(std::string const &label)
Removes a modifier from the simulation.
Definition modifier_manager.cpp:30
void Disable(std::string const &label)
Disables a modifier in the simulation.
void ExecuteModifiers(DEMSolver::CyclePoint cycle_point)
Executes all modifiers during the specified cycle point of the DEM solver.
Definition modifier_manager.cpp:103
Class for managing a DEM simulation.
Definition simulation.hpp:21
Definition bond_entry.hpp:7
std::vector< T > VecXT
Definition utils_macros.hpp:31