osgUtil::Optimizer Class Reference

`#include <Optimizer>`

## Classes

struct | IsOperationPermissibleForObjectCallback
class | FlattenStaticTransformsVisitor
class | FlattenStaticTransformsDuplicatingSharedSubgraphsVisitor
class | CombineStaticTransformsVisitor
class | RemoveEmptyNodesVisitor
class | RemoveRedundantNodesVisitor
class | RemoveLoadedProxyNodesVisitor
class | TessellateVisitor
class | CombineLODsVisitor
class | StateVisitor
class | MergeGeodesVisitor
class | MakeFastGeometryVisitor
class | MergeGeometryVisitor
class | SpatializeGroupsVisitor
class | CopySharedSubgraphsVisitor
class | TextureVisitor
class | FlattenBillboardVisitor
class | TextureAtlasBuilder
class | TextureAtlasVisitor
class | StaticObjectDetectionVisitor
class | BufferObjectVisitor

## 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) , BUFFER_OBJECT_SETTINGS = (1 << 21) , DEFAULT_OPTIMIZATIONS , ALL_OPTIMIZATIONS
}

## Public Member Functions

| Optimizer ()
virtual | ~Optimizer ()
void | reset ()
void | optimize (osg::Node *node)
template<class T>
void | optimize (const osg::ref_ptr< T > &node)
virtual void | optimize (osg::Node *node, unsigned int options)
template<class T>
void | optimize (const osg::ref_ptr< T > &node, unsigned int options)
void | setIsOperationPermissibleForObjectCallback (IsOperationPermissibleForObjectCallback *callback)
IsOperationPermissibleForObjectCallback * | getIsOperationPermissibleForObjectCallback ()
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

## PermissibleOptimizationsMap

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

protected

## Member Enumeration Documentation

## OptimizationOptions

enum osgUtil::Optimizer::OptimizationOptions

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 |
BUFFER_OBJECT_SETTINGS |
DEFAULT_OPTIMIZATIONS |
ALL_OPTIMIZATIONS |

## Constructor & Destructor Documentation

## Optimizer()

osgUtil::Optimizer::Optimizer | ( |  | ) |

inline

Referenced by osgUtil::Optimizer::BufferObjectVisitor::BufferObjectVisitor(), osgUtil::Optimizer::CombineLODsVisitor::CombineLODsVisitor(), osgUtil::Optimizer::CombineStaticTransformsVisitor::CombineStaticTransformsVisitor(), osgUtil::Optimizer::CopySharedSubgraphsVisitor::CopySharedSubgraphsVisitor(), osgUtil::Optimizer::FlattenBillboardVisitor::FlattenBillboardVisitor(), osgUtil::Optimizer::FlattenStaticTransformsDuplicatingSharedSubgraphsVisitor::FlattenStaticTransformsDuplicatingSharedSubgraphsVisitor(), osgUtil::Optimizer::FlattenStaticTransformsVisitor::FlattenStaticTransformsVisitor(), osgUtil::Optimizer::IsOperationPermissibleForObjectCallback::isOperationPermissibleForObjectImplementation(), osgUtil::Optimizer::IsOperationPermissibleForObjectCallback::isOperationPermissibleForObjectImplementation(), osgUtil::Optimizer::IsOperationPermissibleForObjectCallback::isOperationPermissibleForObjectImplementation(), osgUtil::Optimizer::IsOperationPermissibleForObjectCallback::isOperationPermissibleForObjectImplementation(), osgUtil::Optimizer::MakeFastGeometryVisitor::MakeFastGeometryVisitor(), osgUtil::Optimizer::MergeGeodesVisitor::MergeGeodesVisitor(), osgUtil::Optimizer::MergeGeometryVisitor::MergeGeometryVisitor(), osgUtil::Optimizer::RemoveEmptyNodesVisitor::RemoveEmptyNodesVisitor(), osgUtil::Optimizer::RemoveLoadedProxyNodesVisitor::RemoveLoadedProxyNodesVisitor(), osgUtil::Optimizer::RemoveRedundantNodesVisitor::RemoveRedundantNodesVisitor(), osgUtil::Optimizer::SpatializeGroupsVisitor::SpatializeGroupsVisitor(), osgUtil::Optimizer::StateVisitor::StateVisitor(), osgUtil::Optimizer::StaticObjectDetectionVisitor::StaticObjectDetectionVisitor(), osgUtil::Optimizer::TessellateVisitor::TessellateVisitor(), osgUtil::Optimizer::TextureAtlasVisitor::TextureAtlasVisitor(), and osgUtil::Optimizer::TextureVisitor::TextureVisitor().

## ~Optimizer()

virtual osgUtil::Optimizer::~Optimizer | ( |  | ) |

inline virtual

## Member Function Documentation

## getIsOperationPermissibleForObjectCallback() [1/2]

IsOperationPermissibleForObjectCallback * osgUtil::Optimizer::getIsOperationPermissibleForObjectCallback | ( |  | ) |

inline

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

References _isOperationPermissibleForObjectCallback.

## getIsOperationPermissibleForObjectCallback() [2/2]

const IsOperationPermissibleForObjectCallback * osgUtil::Optimizer::getIsOperationPermissibleForObjectCallback | ( |  | ) | const

inline

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

References _isOperationPermissibleForObjectCallback.

## getPermissibleOptimizationsForObject()

unsigned int osgUtil::Optimizer::getPermissibleOptimizationsForObject | ( | const osg::Object * | object | ) | const

inline

References _permissibleOptimizationsMap.

Referenced by isOperationPermissibleForObjectImplementation(), isOperationPermissibleForObjectImplementation(), isOperationPermissibleForObjectImplementation(), and isOperationPermissibleForObjectImplementation().

## isOperationPermissibleForObject() [1/4]

bool osgUtil::Optimizer::isOperationPermissibleForObject | ( | const osg::Drawable * | object,
|  | unsigned int | option ) const

inline

References _isOperationPermissibleForObjectCallback, and isOperationPermissibleForObjectImplementation().

## isOperationPermissibleForObject() [2/4]

bool osgUtil::Optimizer::isOperationPermissibleForObject | ( | const osg::Node * | object,
|  | unsigned int | option ) const

inline

References _isOperationPermissibleForObjectCallback, and isOperationPermissibleForObjectImplementation().

## isOperationPermissibleForObject() [3/4]

bool osgUtil::Optimizer::isOperationPermissibleForObject | ( | const osg::StateAttribute * | object,
|  | unsigned int | option ) const

inline

References _isOperationPermissibleForObjectCallback, and isOperationPermissibleForObjectImplementation().

## isOperationPermissibleForObject() [4/4]

bool osgUtil::Optimizer::isOperationPermissibleForObject | ( | const osg::StateSet * | object,
|  | unsigned int | option ) const

inline

References _isOperationPermissibleForObjectCallback, and isOperationPermissibleForObjectImplementation().

## isOperationPermissibleForObjectImplementation() [1/4]

bool osgUtil::Optimizer::isOperationPermissibleForObjectImplementation | ( | const osg::Drawable * | drawable,
|  | unsigned int | option ) const

inline

References osg::Node::getCullCallback(), osg::Node::getEventCallback(), getPermissibleOptimizationsForObject(), osg::Node::getUpdateCallback(), osg::Object::getUserData(), MERGE_GEOMETRY, and REMOVE_REDUNDANT_NODES.

## isOperationPermissibleForObjectImplementation() [2/4]

bool osgUtil::Optimizer::isOperationPermissibleForObjectImplementation | ( | const osg::Node * | node,
|  | unsigned int | option ) const

inline

References COMBINE_ADJACENT_LODS, FLATTEN_STATIC_TRANSFORMS, osg::Node::getCullCallback(), osg::Node::getEventCallback(), osg::Node::getNodeMask(), osg::Node::getNumDescriptions(), getPermissibleOptimizationsForObject(), osg::Node::getStateSet(), osg::Node::getUpdateCallback(), osg::Object::getUserData(), and REMOVE_REDUNDANT_NODES.

## isOperationPermissibleForObjectImplementation() [3/4]

bool osgUtil::Optimizer::isOperationPermissibleForObjectImplementation | ( | const osg::StateAttribute * | attribute,
|  | unsigned int | option ) const

inline

References getPermissibleOptimizationsForObject().

## isOperationPermissibleForObjectImplementation() [4/4]

bool osgUtil::Optimizer::isOperationPermissibleForObjectImplementation | ( | const osg::StateSet * | stateset,
|  | unsigned int | option ) const

inline

References getPermissibleOptimizationsForObject().

Referenced by isOperationPermissibleForObject(), isOperationPermissibleForObject(), isOperationPermissibleForObject(), isOperationPermissibleForObject(), osgUtil::Optimizer::IsOperationPermissibleForObjectCallback::isOperationPermissibleForObjectImplementation(), osgUtil::Optimizer::IsOperationPermissibleForObjectCallback::isOperationPermissibleForObjectImplementation(), osgUtil::Optimizer::IsOperationPermissibleForObjectCallback::isOperationPermissibleForObjectImplementation(), and osgUtil::Optimizer::IsOperationPermissibleForObjectCallback::isOperationPermissibleForObjectImplementation().

## optimize() [1/4]

template<class T>

void osgUtil::Optimizer::optimize | ( | const osg::ref_ptr< T > & | node | ) |

inline

References osg::ref_ptr< T >::get(), and optimize().

Referenced by optimize().

## optimize() [2/4]

template<class T>

void osgUtil::Optimizer::optimize | ( | const osg::ref_ptr< T > & | node,
|  | unsigned int | options )

inline

References osg::ref_ptr< T >::get(), and optimize().

Referenced by optimize().

## optimize() [3/4]

void osgUtil::Optimizer::optimize | ( | osg::Node * | node | ) |

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

## optimize() [4/4]

virtual void osgUtil::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.

## reset()

void osgUtil::Optimizer::reset | ( |  | ) |

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

## setIsOperationPermissibleForObjectCallback()

void osgUtil::Optimizer::setIsOperationPermissibleForObjectCallback | ( | IsOperationPermissibleForObjectCallback * | callback | ) |

inline

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

References _isOperationPermissibleForObjectCallback.

## setPermissibleOptimizationsForObject()

void osgUtil::Optimizer::setPermissibleOptimizationsForObject | ( | const osg::Object * | object,
|  | unsigned int | options )

inline

References _permissibleOptimizationsMap.

## Member Data Documentation

## _isOperationPermissibleForObjectCallback

osg::ref_ptr<IsOperationPermissibleForObjectCallback> osgUtil::Optimizer::_isOperationPermissibleForObjectCallback

protected

Referenced by getIsOperationPermissibleForObjectCallback(), getIsOperationPermissibleForObjectCallback(), isOperationPermissibleForObject(), isOperationPermissibleForObject(), isOperationPermissibleForObject(), isOperationPermissibleForObject(), and setIsOperationPermissibleForObjectCallback().

## _permissibleOptimizationsMap

PermissibleOptimizationsMap osgUtil::Optimizer::_permissibleOptimizationsMap

protected

Referenced by getPermissibleOptimizationsForObject(), and setPermissibleOptimizationsForObject().

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

- Optimizer