cgv
group.h
1 #pragma once
2 
3 #include "node.h"
4 #include <vector>
5 
6 #include "lib_begin.h"
7 
8 namespace cgv {
9  namespace base {
10 
11 class CGV_API group;
12 
15 
17 class CGV_API group : public node
18 {
19 protected:
21  friend class data::ref_ptr<group,true>;
23  std::vector<base_ptr> children;
25  void link(base_ptr b);
27  void unlink(base_ptr b);
28 public:
30  group(const std::string& name = "");
32  unsigned int get_nr_children() const;
34  base_ptr get_child(unsigned int i) const;
36  virtual unsigned int append_child(base_ptr child);
38  virtual unsigned int remove_child(base_ptr child);
40  virtual void remove_all_children();
42  virtual void insert_child(unsigned int i, base_ptr child);
44  data::ref_ptr<group,true> get_group();
46  std::string get_type_name() const;
47 };
48 
49 template <>
50 struct cast_helper<group>
51 {
52  inline static data::ref_ptr<group,true> cast(base* b)
53  {
54  return b->get_group();
55  }
56 };
57 
58 
59 #if _MSC_VER >= 1400
60 CGV_TEMPLATE template class CGV_API data::ref_ptr<group>;
61 CGV_TEMPLATE template class CGV_API std::vector<base_ptr>;
62 #endif
63 
64  }
65 }
66 
67 #include <cgv/config/lib_end.h>
cgv::base::group::children
std::vector< base_ptr > children
store a list of children
Definition: group.h:23
cgv::base::group
Definition: group.h:18
cgv::data::ref_ptr< group, true >
cgv::base::base
Definition: base.h:57
cgv
the cgv namespace
Definition: vr_calib.cxx:9
cgv::base::node
Definition: node.h:17
cgv::base::group_ptr
data::ref_ptr< group, true > group_ptr
ref counted pointer to a node
Definition: group.h:14