scg3  0.6
InfoTraverser.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 INFOTRAVERSER_H_
26 #define INFOTRAVERSER_H_
27 
28 #include "scg_internals.h"
29 #include "Traverser.h"
30 
31 namespace scg {
32 
33 
37 class InfoTraverser: public Traverser {
38 
39 public:
40 
44  InfoTraverser(RenderState* renderState);
45 
49  virtual ~InfoTraverser();
50 
54  void clear();
55 
59  int getNNodes() const;
60 
64  int getNCores() const;
65 
69  int getNTriangles() const;
70 
71  // leaf nodes
72 
76  virtual void visitLightPosition(LightPosition* node);
77 
81  virtual void visitShape(Shape* node);
82 
83  // composite nodes
84 
88  virtual void visitCamera(Camera* node);
89 
93  virtual void visitGroup(Group* node);
94 
98  virtual void visitLight(Light* node);
99 
103  virtual void visitTransformation(Transformation* node);
104 
105 protected:
106 
107  int nNodes_;
108  int nCores_;
110 
111 };
112 
113 
114 } /* namespace scg */
115 
116 #endif /* INFOTRAVERSER_H_ */
virtual void visitCamera(Camera *node)
virtual void visitTransformation(Transformation *node)
Base class for all cameras (composite node, abstract).
Definition: Camera.h:51
virtual void visitLightPosition(LightPosition *node)
InfoTraverser(RenderState *renderState)
A light to be applied to all nodes of its sub-tree (composite node).
Definition: Light.h:54
A group node to be used as root of a sub-tree of nodes (composite node).
Definition: Group.h:41
int getNCores() const
Base class for all traversers (visitor pattern, abstract).
Definition: Traverser.h:36
A traverser that gathers information about the scene graph (visitor pattern).
Definition: InfoTraverser.h:37
A shape node that contains geometry to be rendered (leaf node).
Definition: Shape.h:42
virtual ~InfoTraverser()
virtual void visitShape(Shape *node)
int getNNodes() const
The central render state that collects information about the current shader, transformations,...
Definition: RenderState.h:107
virtual void visitLight(Light *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).
int getNTriangles() const
Definition: Animation.h:28
Internal definitions required by most classes.
virtual void visitGroup(Group *node)
A light position node to define the position of an associated light within the scene graph (leaf node...
Definition: LightPosition.h:44