scg3  0.6
RenderTraverser.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 RENDERTRAVERSER_H_
26 #define RENDERTRAVERSER_H_
27 
28 #include "Traverser.h"
29 
30 namespace scg {
31 
32 
33 class Appearance;
34 class Camera;
35 class Shape;
36 class Light;
37 class RenderState;
38 
39 
43 class RenderTraverser: public Traverser {
44 
45 public:
46 
50  RenderTraverser(RenderState* renderState);
51 
55  virtual ~RenderTraverser();
56 
57  // leaf nodes
58 
62  virtual void visitShape(Shape* node);
63 
64  // composite nodes
65 
70  virtual void visitCamera(Camera* node);
71 
76  virtual void visitPostCamera(Camera* node);
77 
81  virtual void visitGroup(Group* node);
82 
86  virtual void visitPostGroup(Group* node);
87 
91  virtual void visitLight(Light* node);
92 
96  virtual void visitPostLight(Light* node);
97 
101  virtual void visitTransformation(Transformation* node);
102 
107  virtual void visitPostTransformation(Transformation* node);
108 
109 };
110 
111 
112 } /* namespace scg */
113 
114 #endif /* RENDERTRAVERSER_H_ */
RenderTraverser(RenderState *renderState)
virtual void visitPostGroup(Group *node)
virtual void visitCamera(Camera *node)
Base class for all cameras (composite node, abstract).
Definition: Camera.h:51
A light to be applied to all nodes of its sub-tree (composite node).
Definition: Light.h:54
virtual void visitPostLight(Light *node)
virtual void visitTransformation(Transformation *node)
A group node to be used as root of a sub-tree of nodes (composite node).
Definition: Group.h:41
A traverser that renders the scene graph (visitor pattern).
Base class for all traversers (visitor pattern, abstract).
Definition: Traverser.h:36
virtual void visitLight(Light *node)
A shape node that contains geometry to be rendered (leaf node).
Definition: Shape.h:42
virtual void visitPostTransformation(Transformation *node)
virtual void visitPostCamera(Camera *node)
The central render state that collects information about the current shader, transformations,...
Definition: RenderState.h:107
virtual void visitShape(Shape *node)
A transformation node to be used to appy a transformation to the sub-tree (composite node).
Base class for all traversers (visitor pattern, abstract).
virtual ~RenderTraverser()
Definition: Animation.h:28
virtual void visitGroup(Group *node)