OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
InsertImpostorsVisitor.h
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 
20 namespace 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. */
50  void insertImpostors();
51 
52  protected:
53 
54  typedef std::vector< osg::Group* > GroupList;
55  typedef std::vector< osg::LOD* > LODList;
56 
57  GroupList _groupList;
58  LODList _lodList;
59 
62  unsigned int _numNestedImpostors;
63 
64 };
65 
66 }
67 
68 #endif
std::vector< osg::LOD * > LODList
#define OSGSIM_EXPORT
Definition: Export.h:38
META_NodeVisitor(osgSim, InsertImpostorsVisitor) void setImpostorThresholdRatio(float ratio)
void setMaximumNumberOfNestedImpostors(unsigned int num)
unsigned int getMaximumNumberOfNestedImpostors() const
Definition: LOD.h:35
typedef void(GL_APIENTRY *GLTexImage3DProc)(GLenum target
Definition: Node.h:71
std::vector< osg::Group * > GroupList