# osgUtil::Optimizer Class Reference

Traverses scene graph to improve efficiency. More...

List of all members.

## Public Types

typedef std::map< const osg::Object *, unsigned int > | PermissibleOptimizationsMap
enum | OptimizationOptions { FLATTEN_STATIC_TRANSFORMS = 0x001, REMOVE_REDUNDANT_NODES = 0x002, COMBINE_ADJACENT_LODS = 0x004, SHARE_DUPLICATE_STATE = 0x008, MERGE_GEOMETRY = 0x010, CHECK_GEOMETRY = 0x020, SPATIALIZE_GROUPS = 0x040, COPY_SHARED_NODES = 0x080, TRISTRIP_GEOMETRY = 0x100, TESSELATE_GEOMETRY = 0x200, OPTIMIZE_TEXTURE_SETTINGS = 0x400, DEFAULT_OPTIMIZATIONS, ALL_OPTIMIZATIONS }

## Public Member Functions

| Optimizer ()
virtual | ~Optimizer ()
void | reset ()
| Reset internal data to initial state - the getPermissibleOptionsMap is cleared.
void | optimize (osg::Node *node)
| Traverse the node and its subgraph with a series of optimization visitors, specified by the OptimizationOptions.
virtual void | optimize (osg::Node *node, unsigned int options)
| Traverse the node and its subgraph with a series of optimization visitors, specified by the OptimizationOptions.
void | setPermissibleOptimizationsForObject (const osg::Object *object, unsigned int options)
unsigned int | getPermissibleOptimizationsForObject (const osg::Object *object) const
bool | isOperationPermissibleForObject (const osg::Object *object, unsigned int option) const
PermissibleOptimizationsMap & | getPermissibleOptionsMap ()
const PermissibleOptimizationsMap & | getPermissibleOptionsMap () const

## Protected Attributes

PermissibleOptimizationsMap | _permissibleOptimizationsMap

## Classes

class | CheckGeometryVisitor
class | CombineLODsVisitor
| Optimize the LOD groups, by combining adjacent LOD's which have complementary ranges. More...
class | CombineStaticTransformsVisitor
| Combine Static Transform nodes that sit above one another. More...
class | CopySharedSubgraphsVisitor
| Copy any shared subgraphs, enabling flattening of static transforms. More...
class | FlattenStaticTransformsVisitor
| Flatten Static Transform nodes by applying their transform to the geometry on the leaves of the scene graph, then removing the now redundant transforms. More...
class | MergeGeometryVisitor
class | RemoveEmptyNodesVisitor
| Remove rendundant nodes, such as groups with one single child. More...
class | RemoveRedundantNodesVisitor
| Remove rendundant nodes, such as groups with one single child. More...
class | SpatializeGroupsVisitor
| Spatialize scene into a balanced quad/oct tree. More...
class | StateVisitor
| Optimize State in the scene graph by removing duplicate state, replacing it with shared instances, both for StateAttributes, and whole StateSets. More...
class | TesselateVisitor
| Tesselate all geodes, to remove POLYGONS. More...
class | TextureVisitor
| For all textures apply settings. More...

## 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> osgUtil::Optimizer::PermissibleOptimizationsMap

## Member Enumeration Documentation

enum osgUtil::Optimizer::OptimizationOptions

Enumeration values:

  FLATTEN_STATIC_TRANSFORMS |
  REMOVE_REDUNDANT_NODES |
  COMBINE_ADJACENT_LODS |
  SHARE_DUPLICATE_STATE |
  MERGE_GEOMETRY |
  CHECK_GEOMETRY |
  SPATIALIZE_GROUPS |
  COPY_SHARED_NODES |
  TRISTRIP_GEOMETRY |
  TESSELATE_GEOMETRY |
  OPTIMIZE_TEXTURE_SETTINGS |
  DEFAULT_OPTIMIZATIONS |
  ALL_OPTIMIZATIONS |

## Constructor & Destructor Documentation

osgUtil::Optimizer::Optimizer | ( |  | ) | `[inline]`

virtual osgUtil::Optimizer::~Optimizer | ( |  | ) | `[inline, virtual]`

## Member Function Documentation

unsigned int osgUtil::Optimizer::getPermissibleOptimizationsForObject | ( | const osg::Object * | object | ) | const`[inline]`

const PermissibleOptimizationsMap& osgUtil::Optimizer::getPermissibleOptionsMap | ( |  | ) | const`[inline]`

PermissibleOptimizationsMap& osgUtil::Optimizer::getPermissibleOptionsMap | ( |  | ) | `[inline]`

bool osgUtil::Optimizer::isOperationPermissibleForObject | ( | const osg::Object * | object,
|  | unsigned int | option
| ) | const`[inline]`

void 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.

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

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

void Optimizer::reset | ( |  | ) |

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

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

## Member Data Documentation

PermissibleOptimizationsMap osgUtil::Optimizer::_permissibleOptimizationsMap `[protected]`

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

- Optimizer
- Optimizer.cpp