InsertImpostorsVisitor
Go to the documentation of this file.
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#ifndef OSGSIM_INSERTIMPOSTORSVISITOR
#define OSGSIM_INSERTIMPOSTORSVISITOR
#include <osg/NodeVisitor>
#include <osgSim/Impostor>
namespace osgSim {
class OSGSIM_EXPORT InsertImpostorsVisitor : public osg::NodeVisitor
{
public:
InsertImpostorsVisitor();
META_NodeVisitor(osgSim, InsertImpostorsVisitor)
void setImpostorThresholdRatio(float ratio) { _impostorThresholdRatio = ratio; }
float getImpostorThresholdRatio() const { return _impostorThresholdRatio; }
void setMaximumNumberOfNestedImpostors(unsigned int num) { _maximumNumNestedImpostors = num; }
unsigned int getMaximumNumberOfNestedImpostors() const { return _maximumNumNestedImpostors; }
void reset();
virtual void apply(osg::Node& node);
virtual void apply(osg::Group& node);
virtual void apply(osg::LOD& node);
/* Insert the required impostors into the scene graph. */
void insertImpostors();
protected:
typedef std::vector< osg::Group* > GroupList;
typedef std::vector< osg::LOD* > LODList;
GroupList _groupList;
LODList _lodList;
float _impostorThresholdRatio;
unsigned int _maximumNumNestedImpostors;
unsigned int _numNestedImpostors;
};
}
#endif
Impostor
NodeVisitor
osgSim::InsertImpostorsVisitor::META_NodeVisitor
META_NodeVisitor(osgSim, InsertImpostorsVisitor) void setImpostorThresholdRatio(float ratio)
Definition InsertImpostorsVisitor:32
osgSim::InsertImpostorsVisitor::apply
virtual void apply(osg::Group &node)
osgSim::InsertImpostorsVisitor::_groupList
GroupList _groupList
Definition InsertImpostorsVisitor:57
osgSim::InsertImpostorsVisitor::InsertImpostorsVisitor
InsertImpostorsVisitor()
osgSim::InsertImpostorsVisitor::_numNestedImpostors
unsigned int _numNestedImpostors
Definition InsertImpostorsVisitor:62
osgSim::InsertImpostorsVisitor::apply
virtual void apply(osg::LOD &node)
osgSim::InsertImpostorsVisitor::insertImpostors
void insertImpostors()
osgSim::InsertImpostorsVisitor::_impostorThresholdRatio
float _impostorThresholdRatio
Definition InsertImpostorsVisitor:60
osgSim::InsertImpostorsVisitor::_lodList
LODList _lodList
Definition InsertImpostorsVisitor:58
osgSim::InsertImpostorsVisitor::LODList
std::vector< osg::LOD * > LODList
Definition InsertImpostorsVisitor:55
osgSim::InsertImpostorsVisitor::GroupList
std::vector< osg::Group * > GroupList
Definition InsertImpostorsVisitor:54
osgSim::InsertImpostorsVisitor::_maximumNumNestedImpostors
unsigned int _maximumNumNestedImpostors
Definition InsertImpostorsVisitor:61
osgSim::InsertImpostorsVisitor::setMaximumNumberOfNestedImpostors
void setMaximumNumberOfNestedImpostors(unsigned int num)
Definition InsertImpostorsVisitor:37
osgSim::InsertImpostorsVisitor::reset
void reset()
osgSim::InsertImpostorsVisitor::getMaximumNumberOfNestedImpostors
unsigned int getMaximumNumberOfNestedImpostors() const
Definition InsertImpostorsVisitor:38
osgSim::InsertImpostorsVisitor::getImpostorThresholdRatio
float getImpostorThresholdRatio() const
Definition InsertImpostorsVisitor:35
osgSim::InsertImpostorsVisitor::apply
virtual void apply(osg::Node &node)
osg::Group
Definition Group:29
osg::LOD
Definition LOD:36
osg::NodeVisitor
Definition NodeVisitor:82
osg::Node
Definition Node:72
osgSim
Definition BlinkSequence:27
OSGSIM_EXPORT
#define OSGSIM_EXPORT
Definition osgSim/Export:38