scg3  0.6
Traverser.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 TRAVERSER_H_
26 #define TRAVERSER_H_
27 
28 #include "scg_internals.h"
29 
30 namespace scg {
31 
32 
36 class Traverser {
37 
38 public:
39 
43  Traverser(RenderState* renderState);
44 
48  virtual ~Traverser() = 0;
49 
50  // leaf nodes
51 
55  virtual void visitLightPosition(LightPosition* node);
56 
60  virtual void visitShape(Shape* node);
61 
62  // composite nodes
63 
67  virtual void visitCamera(Camera* node);
68 
72  virtual void visitPostCamera(Camera* node);
73 
77  virtual void visitGroup(Group* node);
78 
82  virtual void visitPostGroup(Group* node);
83 
87  virtual void visitLight(Light* node);
88 
92  virtual void visitPostLight(Light* node);
93 
97  virtual void visitTransformation(Transformation* node);
98 
102  virtual void visitPostTransformation(Transformation* node);
103 
104 protected:
105 
107 
108 };
109 
110 
111 } /* namespace scg */
112 
113 #endif /* TRAVERSER_H_ */
Base class for all cameras (composite node, abstract).
Definition: Camera.h:51
virtual void visitGroup(Group *node)
Traverser(RenderState *renderState)
virtual void visitPostGroup(Group *node)
A light to be applied to all nodes of its sub-tree (composite node).
Definition: Light.h:54
virtual void visitShape(Shape *node)
A group node to be used as root of a sub-tree of nodes (composite node).
Definition: Group.h:41
RenderState * renderState_
Definition: Traverser.h:106
virtual void visitPostCamera(Camera *node)
Base class for all traversers (visitor pattern, abstract).
Definition: Traverser.h:36
A shape node that contains geometry to be rendered (leaf node).
Definition: Shape.h:42
virtual void visitPostLight(Light *node)
virtual void visitLightPosition(LightPosition *node)
virtual void visitCamera(Camera *node)
virtual ~Traverser()=0
virtual void visitLight(Light *node)
The central render state that collects information about the current shader, transformations,...
Definition: RenderState.h:107
A transformation node to be used to appy a transformation to the sub-tree (composite node).
virtual void visitPostTransformation(Transformation *node)
Definition: Animation.h:28
Internal definitions required by most classes.
A light position node to define the position of an associated light within the scene graph (leaf node...
Definition: LightPosition.h:44
virtual void visitTransformation(Transformation *node)