40 static_assert(std::is_base_of<node, T>::value,
"T must inherit from node");
49 virtual unsigned int append_child(
base_ptr child);
51 virtual unsigned int remove_child(
base_ptr child);
53 virtual void remove_all_children();
55 virtual void insert_child(
unsigned int i,
base_ptr child);
61 std::string get_type_name()
const override;
66 inline static group_ptr cast(
base* b) {
return b->get_group(); }
76CGV_TEMPLATE
template class CGV_API std::vector<base_ptr>;
82#include <cgv/config/lib_end.h>
base class for all classes that can be registered with support for dynamic properties (see also secti...
The group class is a node with children.
group(const std::string &name="")
construct from name
data::ref_ptr< T > create_and_append_child(const std::string &name="", unsigned int *index=nullptr)
create and append an instance of a child node and return pointer to appended child; optionally set na...
std::vector< base_ptr > children
store a list of children
void unlink(base_ptr b)
check if the base class is a node and clear the parent of the node
unsigned int get_nr_children() const
return the number of children
base_ptr get_child(unsigned int i) const
return the i-th child
void link(base_ptr b)
check if the base class is a node and set the parent of the node
virtual unsigned int append_child(base_ptr child)
append child and return index of appended child
std::string name
store the name as a string
node(const std::string &name="")
construct from name
reference counted pointer, which can work together with types that are derived from ref_counted,...
the base namespace holds the base hierarchy, support for plugin registration and signals
data::ref_ptr< const group, true > const_group_ptr
ref counted pointer to a node
data::ref_ptr< base, true > base_ptr
ref counted pointer to base
data::ref_ptr< group, true > group_ptr
ref counted pointer to a node
this header is dependency free