Carna Version 3.3.3
Loading...
Searching...
No Matches
Node.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2010 - 2015 Leonid Kostrykin
3 *
4 * Chair of Medical Engineering (mediTEC)
5 * RWTH Aachen University
6 * Pauwelsstr. 20
7 * 52074 Aachen
8 * Germany
9 *
10 */
11
12#ifndef NODE_H_6014714286
13#define NODE_H_6014714286
14
15#include <Carna/base/Spatial.h>
16#include <memory>
17
22namespace Carna
23{
24
25namespace base
26{
27
28
29
30// ----------------------------------------------------------------------------------
31// Node
32// ----------------------------------------------------------------------------------
33
44class CARNA_LIB Node : public Spatial
45{
46
47 struct Details;
48 const std::unique_ptr< Details > pimpl;
49
50public:
51
57 explicit Node( const std::string& tag = "" );
58
62 virtual ~Node();
63
69
75
81 void invalidate() override;
82
90
100
105 bool hasChild( const Spatial& child ) const;
106
111
115 std::size_t children() const;
116
121
125
131 virtual void updateWorldTransform() override;
132
133}; // Node
134
135
136
137} // namespace Carna :: base
138
139} // namespace Carna
140
141#endif // NODE_H_6014714286
Defines Carna::base::Spatial.
Represents an association.
Definition Association.h:45
Notified by Node objects.
Defines the inner node of a scene graph. Implements a spatial scene element that is allowed to have c...
Definition Node.h:45
void attachChild(Spatial *child)
Attaches child to this node in and takes it's possession.
void removeNodeListener(NodeListener &listener)
Removes listener from being notified of changes related to this node in .
Spatial * detachChild(Spatial &child)
Detaches child from this node in . The caller takes possession of the child.
bool hasChild(const Spatial &child) const
Tells whether child is among the children of this node in .
std::size_t children() const
Tells number of children.
void addNodeListener(NodeListener &listener)
Notifies listener of changes related to this node in .
void deleteAllChildren()
Deletes all children of this node.
void visitChildren(bool recursively, const MutableVisitor &visit)
Invokes visit once on each child of this node recursively.
void invalidate() override
Notifies all its listeners that this subtree has changed. This may include changes of the tree struct...
void visitChildren(bool recursively, const ImmutableVisitor &visit) const
virtual ~Node()
Deletes.
Node(const std::string &tag="")
Instantiates.
virtual void updateWorldTransform() override
Computes the transformation to world space for this node just like the base class does,...
Represents a spatial scene element. It's location is determined relatively to another spatial that is...
Definition Spatial.h:45
std::function< void(Spatial &) > MutableVisitor
Declares an entity that visits mutable Spatial instances.
Definition Spatial.h:74
std::function< void(const Spatial &) > ImmutableVisitor
Declares an entity that visits mutable Spatial instances.
Definition Spatial.h:79