NetDEM v1.0
Loading...
Searching...
No Matches
wall_group.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "modifier.hpp"
4#include "wall.hpp"
5
6#include <unordered_set>
7
8namespace netdem {
9
16class WallGroup : public Modifier {
17protected:
19 std::unordered_set<int> wall_id_list;
20
23
24public:
28 WallGroup();
29
33 VecXT<Wall *> const &GetWalls();
34
40 void AddWall(int id);
41
47 void RemoveWall(int id);
48
54 void AddWall(const VecXT<int> &ids);
55
61 void RemoveWall(const VecXT<int> &ids);
62
68 void AddWall(const std::initializer_list<int> &ids);
69
75 void RemoveWall(const std::initializer_list<int> &ids);
76
80 void SetWall(int id);
81
85 void SetWall(const VecXT<int> &id_list);
86
90 void SetWall(const std::initializer_list<int> &id_list);
91
95 void Clear();
96
102 Modifier *Clone() const override;
103
107 void Execute() override;
108
114 void Update() override;
115};
116
117} // namespace netdem
An interface class used to modify a DEM simulation.
Definition modifier.hpp:18
A class used to group walls in a DEM simulation.
Definition wall_group.hpp:16
void RemoveWall(int id)
Removes a wall from the group.
Definition wall_group.cpp:23
Modifier * Clone() const override
Clones the current WallGroup instance.
Definition wall_group.cpp:86
VecXT< Wall * > const & GetWalls()
Get the walls.
Definition wall_group.cpp:16
void AddWall(int id)
Adds a wall to the group.
Definition wall_group.cpp:18
WallGroup()
Default constructor for WallGroup class.
Definition wall_group.cpp:10
void AddWall(const std::initializer_list< int > &ids)
Adds multiple walls to the group.
void Execute() override
Executes the WallGroup instance.
Definition wall_group.cpp:88
void Update() override
Updates the WallGroup instance.
Definition wall_group.cpp:90
void SetWall(const std::initializer_list< int > &id_list)
Sets the walls based on a variable number of wall IDs.
void Clear()
Clears all walls from the group.
Definition wall_group.cpp:81
std::unordered_set< int > wall_id_list
The list of wall ids.
Definition wall_group.hpp:19
VecXT< Wall * > wall_list
The list of wall.
Definition wall_group.hpp:22
void SetWall(int id)
Sets the walls based on a wall ID.
Definition wall_group.cpp:56
void RemoveWall(const std::initializer_list< int > &ids)
Removes multiple walls from the group.
Definition bond_entry.hpp:7
std::vector< T > VecXT
Definition utils_macros.hpp:31