cgv
Loading...
Searching...
No Matches
node.h
1#pragma once
2
3#include "named.h"
4#include <cgv/data/ref_ptr.h>
5#include "lib_begin.h"
6
7namespace cgv {
8 namespace base {
9
10class CGV_API node;
11
16
18class CGV_API node : public named
19{
20protected:
22 friend class data::ref_ptr<node,true>;
25public:
27 node(const std::string& name = "");
29 node_ptr get_parent() const;
31 base_ptr get_root() const;
33 void set_parent(node_ptr _parent);
35 node_ptr get_node();
37 const_node_ptr get_node_const();
39 std::string get_type_name() const;
40};
41
42template <> struct cast_helper<node>
43{
44 inline static node_ptr cast(base* b) { return b->get_node(); }
45};
46
47template <> struct cast_const_helper<node>
48{
49 inline static const_node_ptr cast_const(const base* b) { return b->get_node_const(); }
50};
51
52#if _MSC_VER >= 1400
53CGV_TEMPLATE template class CGV_API data::ref_ptr<node>;
54#endif
55
56 }
57}
58
59#include <cgv/config/lib_end.h>
base class for all classes that can be registered with support for dynamic properties (see also secti...
Definition base.h:75
base class for all gui types
Definition named.h:20
The node class keeps a pointer to its parent.
Definition node.h:19
node_ptr parent
store a pointer to the parent node
Definition node.h:24
complete implementation of method actions that only call one method when entering a node
Definition action.h:113
reference counted pointer, which can work together with types that are derived from ref_counted,...
Definition ref_ptr.h:160
data::ref_ptr< const node, true > const_node_ptr
ref counted pointer to a const node
Definition node.h:15
data::ref_ptr< node, true > node_ptr
ref counted pointer to a node
Definition node.h:13
the cgv namespace
Definition print.h:11