LibCarna Version 3.4.0
Loading...
Searching...
No Matches
Node.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2010 - 2016 Leonid Kostrykin
3 *
4 * Chair of Medical Engineering (mediTEC)
5 * RWTH Aachen University
6 * Pauwelsstr. 20
7 * 52074 Aachen
8 * Germany
9 *
10 *
11 * Copyright (C) 2021 - 2025 Leonid Kostrykin
12 *
13 */
14
15#ifndef NODE_H_6014714286
16#define NODE_H_6014714286
17
19#include <memory>
20
26namespace LibCarna
27{
28
29namespace base
30{
31
32
33
34// ----------------------------------------------------------------------------------
35// Node
36// ----------------------------------------------------------------------------------
37
47class LIBCARNA Node : public Spatial
48{
49
50 struct Details;
51 const std::unique_ptr< Details > pimpl;
52
53public:
54
60 explicit Node( const std::string& tag = "" );
61
65 virtual ~Node();
66
72
78
84 void invalidate() override;
85
93
103
108 bool hasChild( const Spatial& child ) const;
109
114
118 std::size_t children() const;
119
124
128
134 virtual void updateWorldTransform() override;
135
136}; // Node
137
138
139
140} // namespace LibCarna :: base
141
142} // namespace LibCarna
143
144#endif // NODE_H_6014714286
Defines LibCarna::base::Spatial.
Represents an association.
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.hpp:48
void invalidate() override
Notifies all its listeners that this subtree has changed. This may include changes of the tree struct...
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.
Node(const std::string &tag="")
Instantiates.
Spatial * detachChild(Spatial &child)
Detaches child from this node in . The caller takes possession of the child.
virtual void updateWorldTransform() override
Computes the transformation to world space for this node just like the base class does,...
void addNodeListener(NodeListener &listener)
Notifies listener of changes related to this node in .
void visitChildren(bool recursively, const ImmutableVisitor &visit) const
void attachChild(Spatial *child)
Attaches child to this node in and takes it's possession.
void visitChildren(bool recursively, const MutableVisitor &visit)
Invokes visit once on each child of this node recursively.
virtual ~Node()
Deletes.
void removeNodeListener(NodeListener &listener)
Removes listener from being notified of changes related to this node in .
void deleteAllChildren()
Deletes all children of this node.
Represents a spatial scene element. It's location is determined relatively to another spatial that is...
Definition Spatial.hpp:48
std::function< void(Spatial &) > MutableVisitor
Declares an entity that visits mutable Spatial instances.
Definition Spatial.hpp:77
std::function< void(const Spatial &) > ImmutableVisitor
Declares an entity that visits mutable Spatial instances.
Definition Spatial.hpp:82