root/OpenSceneGraph/trunk/src/osg/NodeVisitor.cpp @ 13041

Revision 13041, 3.6 kB (checked in by robert, 2 years ago)

Ran script to remove trailing spaces and tabs

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2 *
3 * This library is open source and may be redistributed and/or modified under
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version.  The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 * OpenSceneGraph Public License for more details.
12*/
13#include <osg/NodeVisitor>
14
15#include <osg/Billboard>
16#include <osg/ClearNode>
17#include <osg/ClipNode>
18#include <osg/CoordinateSystemNode>
19#include <osg/Geode>
20#include <osg/Group>
21#include <osg/LightSource>
22#include <osg/LOD>
23#include <osg/MatrixTransform>
24#include <osg/OccluderNode>
25#include <osg/OcclusionQueryNode>
26#include <osg/PagedLOD>
27#include <osg/PositionAttitudeTransform>
28#include <osg/Projection>
29#include <osg/ProxyNode>
30#include <osg/Sequence>
31#include <osg/Switch>
32#include <osg/TexGenNode>
33#include <osg/Transform>
34#include <osg/Camera>
35#include <osg/CameraView>
36
37#include <stdlib.h>
38
39using namespace osg;
40
41NodeVisitor::NodeVisitor(TraversalMode tm):
42        Referenced(true)
43{
44    _visitorType = NODE_VISITOR;
45    _traversalNumber = osg::UNINITIALIZED_FRAME_NUMBER;
46
47    _traversalMode = tm;
48    _traversalMask = 0xffffffff;
49    _nodeMaskOverride = 0x0;
50}
51
52NodeVisitor::NodeVisitor(VisitorType type,TraversalMode tm):
53    Referenced(true)
54{
55    _visitorType = type;
56    _traversalNumber = osg::UNINITIALIZED_FRAME_NUMBER;
57
58    _traversalMode = tm;
59    _traversalMask = 0xffffffff;
60    _nodeMaskOverride = 0x0;
61}
62
63
64NodeVisitor::~NodeVisitor()
65{
66    // if (_traversalVisitor) detach from _traversalVisitor;
67}
68
69void NodeVisitor::apply(Node& node)
70{
71    traverse(node);
72}
73
74void NodeVisitor::apply(Geode& node)
75{
76    apply(static_cast<Node&>(node));
77}
78
79void NodeVisitor::apply(Billboard& node)
80{
81    apply(static_cast<Geode&>(node));
82}
83
84void NodeVisitor::apply(Group& node)
85{
86    apply(static_cast<Node&>(node));
87}
88
89void NodeVisitor::apply(ProxyNode& node)
90{
91    apply(static_cast<Group&>(node));
92}
93
94void NodeVisitor::apply(Projection& node)
95{
96    apply(static_cast<Group&>(node));
97}
98
99void NodeVisitor::apply(CoordinateSystemNode& node)
100{
101    apply(static_cast<Group&>(node));
102}
103
104void NodeVisitor::apply(ClipNode& node)
105{
106    apply(static_cast<Group&>(node));
107}
108
109void NodeVisitor::apply(TexGenNode& node)
110{
111    apply(static_cast<Group&>(node));
112}
113
114void NodeVisitor::apply(LightSource& node)
115{
116    apply(static_cast<Group&>(node));
117}
118
119void NodeVisitor::apply(Transform& node)
120{
121    apply(static_cast<Group&>(node));
122}
123
124void NodeVisitor::apply(Camera& node)
125{
126    apply(static_cast<Transform&>(node));
127}
128
129void NodeVisitor::apply(CameraView& node)
130{
131    apply(static_cast<Transform&>(node));
132}
133
134void NodeVisitor::apply(MatrixTransform& node)
135{
136    apply(static_cast<Transform&>(node));
137}
138
139void NodeVisitor::apply(PositionAttitudeTransform& node)
140{
141    apply(static_cast<Transform&>(node));
142}
143
144void NodeVisitor::apply(Switch& node)
145{
146    apply(static_cast<Group&>(node));
147}
148
149void NodeVisitor::apply(Sequence& node)
150{
151    apply(static_cast<Group&>(node));
152}
153
154void NodeVisitor::apply(LOD& node)
155{
156    apply(static_cast<Group&>(node));
157}
158
159void NodeVisitor::apply(PagedLOD& node)
160{
161    apply(static_cast<LOD&>(node));
162}
163
164void NodeVisitor::apply(ClearNode& node)
165{
166    apply(static_cast<Group&>(node));
167}
168
169void NodeVisitor::apply(OccluderNode& node)
170{
171    apply(static_cast<Group&>(node));
172}
173
174void NodeVisitor::apply(OcclusionQueryNode& node)
175{
176    apply(static_cast<Group&>(node));
177}
Note: See TracBrowser for help on using the browser.