scg3  0.6
Composite.h
Go to the documentation of this file.
1 
9 /*
10  * Copyright 2014 Volker Ahlers
11  *
12  * Licensed under the Apache License, Version 2.0 (the "License");
13  * you may not use this file except in compliance with the License.
14  * You may obtain a copy of the License at
15  *
16  * http://www.apache.org/licenses/LICENSE-2.0
17  *
18  * Unless required by applicable law or agreed to in writing, software
19  * distributed under the License is distributed on an "AS IS" BASIS,
20  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21  * See the License for the specific language governing permissions and
22  * limitations under the License.
23  */
24 
25 #ifndef COMPOSITE_H_
26 #define COMPOSITE_H_
27 
28 #include "Node.h"
29 #include "scg_internals.h"
30 
31 namespace scg {
32 
33 
37 class Composite: public Node {
38 
39 public:
40 
44  Composite();
45 
49  virtual ~Composite() = 0;
50 
54  virtual void destroy();
55 
60  Composite* addChild(NodeSP child);
61 
68  Composite* removeChild(Node* node, bool& result);
69 
74  Composite* removeChild(Node* node);
75 
79  virtual void traverse(Traverser* traverser);
80 
84  virtual void acceptPost(Traverser* traverser);
85 
89  virtual void renderPost(RenderState* renderState);
90 
91 protected:
92 
94 
95 };
96 
97 
98 } /* namespace scg */
99 
100 #endif /* COMPOSITE_H_ */
Composite * addChild(NodeSP child)
Base class for all composite nodes, i.e., nodes with children (composite pattern, abstract).
Definition: Composite.h:37
virtual void acceptPost(Traverser *traverser)
Composite * removeChild(Node *node, bool &result)
virtual ~Composite()=0
virtual void destroy()
Base class for all traversers (visitor pattern, abstract).
Definition: Traverser.h:36
NodeSP leftChild_
Definition: Composite.h:93
virtual void renderPost(RenderState *renderState)
virtual void traverse(Traverser *traverser)
Base class for all nodes (composite pattern, abstract).
The central render state that collects information about the current shader, transformations,...
Definition: RenderState.h:107
Definition: Animation.h:28
Internal definitions required by most classes.
Base class for all nodes (composite pattern, abstract).
Definition: Node.h:47