OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Protected Types | Protected Attributes | List of all members
SceneUtil::Optimizer Class Reference

#include <optimizer.hpp>

Collaboration diagram for SceneUtil::Optimizer:

Classes

class  CombineStaticTransformsVisitor
 
class  FlattenStaticTransformsVisitor
 
struct  IsOperationPermissibleForObjectCallback
 
class  MergeGeometryVisitor
 
class  MergeGroupsVisitor
 
class  RemoveEmptyNodesVisitor
 
class  RemoveRedundantNodesVisitor
 

Public Types

enum  OptimizationOptions {
  FLATTEN_STATIC_TRANSFORMS = (1 << 0), REMOVE_REDUNDANT_NODES = (1 << 1), REMOVE_LOADED_PROXY_NODES = (1 << 2), COMBINE_ADJACENT_LODS = (1 << 3),
  SHARE_DUPLICATE_STATE = (1 << 4), MERGE_GEOMETRY = (1 << 5), CHECK_GEOMETRY = (1 << 6), MAKE_FAST_GEOMETRY = (1 << 7),
  SPATIALIZE_GROUPS = (1 << 8), COPY_SHARED_NODES = (1 << 9), TRISTRIP_GEOMETRY = (1 << 10), TESSELLATE_GEOMETRY = (1 << 11),
  OPTIMIZE_TEXTURE_SETTINGS = (1 << 12), MERGE_GEODES = (1 << 13), FLATTEN_BILLBOARDS = (1 << 14), TEXTURE_ATLAS_BUILDER = (1 << 15),
  STATIC_OBJECT_DETECTION = (1 << 16), FLATTEN_STATIC_TRANSFORMS_DUPLICATING_SHARED_SUBGRAPHS = (1 << 17), INDEX_MESH = (1 << 18), VERTEX_POSTTRANSFORM = (1 << 19),
  VERTEX_PRETRANSFORM = (1 << 20), DEFAULT_OPTIMIZATIONS, ALL_OPTIMIZATIONS
}
 

Public Member Functions

 Optimizer ()
 
virtual ~Optimizer ()
 
void reset ()
 
virtual void optimize (osg::Node *node, unsigned int options)
 
void setIsOperationPermissibleForObjectCallback (IsOperationPermissibleForObjectCallback *callback)
 
IsOperationPermissibleForObjectCallbackgetIsOperationPermissibleForObjectCallback ()
 
const
IsOperationPermissibleForObjectCallback
getIsOperationPermissibleForObjectCallback () const
 
void setPermissibleOptimizationsForObject (const osg::Object *object, unsigned int options)
 
unsigned int getPermissibleOptimizationsForObject (const osg::Object *object) const
 
bool isOperationPermissibleForObject (const osg::StateSet *object, unsigned int option) const
 
bool isOperationPermissibleForObject (const osg::StateAttribute *object, unsigned int option) const
 
bool isOperationPermissibleForObject (const osg::Drawable *object, unsigned int option) const
 
bool isOperationPermissibleForObject (const osg::Node *object, unsigned int option) const
 
bool isOperationPermissibleForObjectImplementation (const osg::StateSet *stateset, unsigned int option) const
 
bool isOperationPermissibleForObjectImplementation (const osg::StateAttribute *attribute, unsigned int option) const
 
bool isOperationPermissibleForObjectImplementation (const osg::Drawable *drawable, unsigned int option) const
 
bool isOperationPermissibleForObjectImplementation (const osg::Node *node, unsigned int option) const
 

Protected Types

typedef std::map< const
osg::Object *, unsigned int
PermissibleOptimizationsMap
 

Protected Attributes

osg::ref_ptr
< IsOperationPermissibleForObjectCallback
_isOperationPermissibleForObjectCallback
 
PermissibleOptimizationsMap _permissibleOptimizationsMap
 

Detailed Description

Traverses scene graph to improve efficiency. See OptimizationOptions. For example of usage see examples/osgimpostor or osgviewer.

Member Typedef Documentation

typedef std::map<const osg::Object*,unsigned int> SceneUtil::Optimizer::PermissibleOptimizationsMap
protected

Member Enumeration Documentation

Enumerator
FLATTEN_STATIC_TRANSFORMS 
REMOVE_REDUNDANT_NODES 
REMOVE_LOADED_PROXY_NODES 
COMBINE_ADJACENT_LODS 
SHARE_DUPLICATE_STATE 
MERGE_GEOMETRY 
CHECK_GEOMETRY 
MAKE_FAST_GEOMETRY 
SPATIALIZE_GROUPS 
COPY_SHARED_NODES 
TRISTRIP_GEOMETRY 
TESSELLATE_GEOMETRY 
OPTIMIZE_TEXTURE_SETTINGS 
MERGE_GEODES 
FLATTEN_BILLBOARDS 
TEXTURE_ATLAS_BUILDER 
STATIC_OBJECT_DETECTION 
FLATTEN_STATIC_TRANSFORMS_DUPLICATING_SHARED_SUBGRAPHS 
INDEX_MESH 
VERTEX_POSTTRANSFORM 
VERTEX_PRETRANSFORM 
DEFAULT_OPTIMIZATIONS 
ALL_OPTIMIZATIONS 

Constructor & Destructor Documentation

SceneUtil::Optimizer::Optimizer ( )
inline
virtual SceneUtil::Optimizer::~Optimizer ( )
inlinevirtual

Member Function Documentation

IsOperationPermissibleForObjectCallback* SceneUtil::Optimizer::getIsOperationPermissibleForObjectCallback ( )
inline

Get the callback for customizing what operations are permitted on objects in the scene graph.

const IsOperationPermissibleForObjectCallback* SceneUtil::Optimizer::getIsOperationPermissibleForObjectCallback ( ) const
inline

Get the callback for customizing what operations are permitted on objects in the scene graph.

unsigned int SceneUtil::Optimizer::getPermissibleOptimizationsForObject ( const osg::Object *  object) const
inline

Here is the caller graph for this function:

bool SceneUtil::Optimizer::isOperationPermissibleForObject ( const osg::StateSet *  object,
unsigned int  option 
) const
inline

Here is the call graph for this function:

bool SceneUtil::Optimizer::isOperationPermissibleForObject ( const osg::StateAttribute *  object,
unsigned int  option 
) const
inline

Here is the call graph for this function:

bool SceneUtil::Optimizer::isOperationPermissibleForObject ( const osg::Drawable *  object,
unsigned int  option 
) const
inline

Here is the call graph for this function:

bool SceneUtil::Optimizer::isOperationPermissibleForObject ( const osg::Node *  object,
unsigned int  option 
) const
inline

Here is the call graph for this function:

bool SceneUtil::Optimizer::isOperationPermissibleForObjectImplementation ( const osg::StateSet *  stateset,
unsigned int  option 
) const
inline

Here is the call graph for this function:

Here is the caller graph for this function:

bool SceneUtil::Optimizer::isOperationPermissibleForObjectImplementation ( const osg::StateAttribute *  attribute,
unsigned int  option 
) const
inline

Here is the call graph for this function:

bool SceneUtil::Optimizer::isOperationPermissibleForObjectImplementation ( const osg::Drawable *  drawable,
unsigned int  option 
) const
inline

Here is the call graph for this function:

bool SceneUtil::Optimizer::isOperationPermissibleForObjectImplementation ( const osg::Node *  node,
unsigned int  option 
) const
inline

Here is the call graph for this function:

void SceneUtil::Optimizer::optimize ( osg::Node *  node,
unsigned int  options 
)
virtual

Traverse the node and its subgraph with a series of optimization visitors, specified by the OptimizationOptions.

Here is the call graph for this function:

Here is the caller graph for this function:

void SceneUtil::Optimizer::reset ( )

Reset internal data to initial state - the getPermissibleOptionsMap is cleared.

void SceneUtil::Optimizer::setIsOperationPermissibleForObjectCallback ( IsOperationPermissibleForObjectCallback callback)
inline

Set the callback for customizing what operations are permitted on objects in the scene graph.

Here is the caller graph for this function:

void SceneUtil::Optimizer::setPermissibleOptimizationsForObject ( const osg::Object *  object,
unsigned int  options 
)
inline

Member Data Documentation

osg::ref_ptr<IsOperationPermissibleForObjectCallback> SceneUtil::Optimizer::_isOperationPermissibleForObjectCallback
protected
PermissibleOptimizationsMap SceneUtil::Optimizer::_permissibleOptimizationsMap
protected

The documentation for this class was generated from the following files: