openscenegraph
InsertImpostorsVisitor
Go to the documentation of this file.
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
14#ifndef OSGSIM_INSERTIMPOSTORSVISITOR
15#define OSGSIM_INSERTIMPOSTORSVISITOR
16
17#include <osg/NodeVisitor>
18#include <osgSim/Impostor>
19
20namespace osgSim {
21
26{
27 public:
28
31
33
34 void setImpostorThresholdRatio(float ratio) { _impostorThresholdRatio = ratio; }
35 float getImpostorThresholdRatio() const { return _impostorThresholdRatio; }
36
37 void setMaximumNumberOfNestedImpostors(unsigned int num) { _maximumNumNestedImpostors = num; }
38 unsigned int getMaximumNumberOfNestedImpostors() const { return _maximumNumNestedImpostors; }
39
41 void reset();
42
43 virtual void apply(osg::Node& node);
44
45 virtual void apply(osg::Group& node);
46
47 virtual void apply(osg::LOD& node);
48
49 /* Insert the required impostors into the scene graph. */
51
52 protected:
53
54 typedef std::vector< osg::Group* > GroupList;
55 typedef std::vector< osg::LOD* > LODList;
56
59
62 unsigned int _numNestedImpostors;
63
64};
65
66}
67
68#endif
Definition InsertImpostorsVisitor:26
META_NodeVisitor(osgSim, InsertImpostorsVisitor) void setImpostorThresholdRatio(float ratio)
Definition InsertImpostorsVisitor:32
virtual void apply(osg::Group &node)
GroupList _groupList
Definition InsertImpostorsVisitor:57
unsigned int _numNestedImpostors
Definition InsertImpostorsVisitor:62
virtual void apply(osg::LOD &node)
float _impostorThresholdRatio
Definition InsertImpostorsVisitor:60
LODList _lodList
Definition InsertImpostorsVisitor:58
std::vector< osg::LOD * > LODList
Definition InsertImpostorsVisitor:55
std::vector< osg::Group * > GroupList
Definition InsertImpostorsVisitor:54
unsigned int _maximumNumNestedImpostors
Definition InsertImpostorsVisitor:61
void setMaximumNumberOfNestedImpostors(unsigned int num)
Definition InsertImpostorsVisitor:37
unsigned int getMaximumNumberOfNestedImpostors() const
Definition InsertImpostorsVisitor:38
float getImpostorThresholdRatio() const
Definition InsertImpostorsVisitor:35
virtual void apply(osg::Node &node)
Definition Group:29
Definition LOD:36
Definition NodeVisitor:82
Definition Node:72
Definition BlinkSequence:27
#define OSGSIM_EXPORT
Definition osgSim/Export:38