osgUtil::Statistics Class Reference

`#include <Statistics>`

Inheritance diagram for osgUtil::Statistics:

## Public Types

enum | StatsType { STAT_NONE , STAT_FRAMERATE , STAT_GRAPHS , STAT_PRIMS , STAT_PRIMSPERVIEW , STAT_PRIMSPERBIN , STAT_DC , STAT_RESTART }
typedef std::pair< unsigned int, unsigned int > | PrimitivePair
typedef std::map< GLenum, PrimitivePair > | PrimitiveValueMap
typedef std::map< GLenum, unsigned int > | PrimitiveCountMap

## Public Member Functions

| Statistics ()
void | reset ()
void | setType (StatsType t)
virtual void | setVertexArray (unsigned int count, const osg::Vec3 *)
virtual void | setVertexArray (unsigned int count, const osg::Vec2 *)
virtual void | setVertexArray (unsigned int count, const osg::Vec4 *)
virtual void | setVertexArray (unsigned int count, const osg::Vec3d *)
virtual void | setVertexArray (unsigned int count, const osg::Vec2d *)
virtual void | setVertexArray (unsigned int count, const osg::Vec4d *)
virtual void | drawArrays (GLenum mode, GLint, GLsizei count)
| Mimics the OpenGL `glDrawArrays()` function.
virtual void | drawElements (GLenum mode, GLsizei count, const GLubyte *)
| Mimics the OpenGL `glDrawElements()` function.
virtual void | drawElements (GLenum mode, GLsizei count, const GLushort *)
| Mimics the OpenGL `glDrawElements()` function.
virtual void | drawElements (GLenum mode, GLsizei count, const GLuint *)
| Mimics the OpenGL `glDrawElements()` function.
virtual void | begin (GLenum mode)
void | vertex ()
virtual void | vertex (float, float, float)
virtual void | vertex (const osg::Vec3 &)
virtual void | vertex (const osg::Vec2 &)
virtual void | vertex (const osg::Vec4 &)
virtual void | vertex (float, float)
virtual void | vertex (float, float, float, float)
virtual void | end ()
void | addDrawable ()
void | addFastDrawable ()
void | addMatrix ()
void | addLight (int np)
void | addImpostor (int np)
int | getBins ()
void | setDepth (int d)
void | addBins (int np)
void | setBinNo (int n)
void | addStateGraphs (int n)
void | addOrderedLeaves (int n)
void | add (const Statistics &stats)
PrimitiveCountMap & | getPrimitiveCountMap ()
const PrimitiveCountMap & | getPrimitiveCountMap () const
PrimitiveValueMap & | getPrimitiveValueMap ()
const PrimitiveValueMap & | getPrimitiveValueMap () const
PrimitiveCountMap::iterator | GetPrimitivesBegin ()
| deprecated
PrimitiveCountMap::iterator | GetPrimitivesEnd ()
| deprecated
Public Member Functions inherited from osg::PrimitiveFunctor
virtual | ~PrimitiveFunctor ()

## Public Attributes

int | numDrawables
int | nummat
int | nbins
int | numStateGraphs
int | numFastDrawables
int | nlights
int | depth
int | _binNo
StatsType | stattype
int | nimpostor
int | numOrderedLeaves
unsigned int | _vertexCount
PrimitiveValueMap | _primitiveCount
GLenum | _currentPrimitiveFunctorMode

## Detailed Description

Statistics base class. Used to extract primitive information from the renderBin(s). Add a case of getStats(osgUtil::Statistics *stat) for any new drawable (or drawable derived class) that you generate (eg see Geometry.cpp). There are 20 types of drawable counted - actually only 14 cases can occur in reality. these represent sets of GL_POINTS, GL_LINES GL_LINESTRIPS, LOOPS, TRIANGLES, TRI-fans, tristrips, quads, quadstrips etc The number of triangles rendered is inferred: each triangle = 1 triangle (number of vertices/3) each quad = 2 triangles (nverts/2) each trifan or tristrip = (length-2) triangles and so on.

## Member Typedef Documentation

## PrimitiveCountMap

typedef std::map<GLenum, unsigned int> osgUtil::Statistics::PrimitiveCountMap

## PrimitivePair

typedef std::pair<unsigned int,unsigned int> osgUtil::Statistics::PrimitivePair

## PrimitiveValueMap

typedef std::map<GLenum,PrimitivePair> osgUtil::Statistics::PrimitiveValueMap

## Member Enumeration Documentation

## StatsType

enum osgUtil::Statistics::StatsType

Enumerator
STAT_NONE |
STAT_FRAMERATE |
STAT_GRAPHS |
STAT_PRIMS |
STAT_PRIMSPERVIEW |
STAT_PRIMSPERBIN |
STAT_DC |
STAT_RESTART |

## Constructor & Destructor Documentation

## Statistics()

osgUtil::Statistics::Statistics | ( |  | ) |

Referenced by add().

## Member Function Documentation

## add()

void osgUtil::Statistics::add | ( | const Statistics & | stats | ) |

References Statistics().

## addBins()

void osgUtil::Statistics::addBins | ( | int | np | ) |

inline

References nbins.

## addDrawable()

void osgUtil::Statistics::addDrawable | ( |  | ) |

inline

References numDrawables.

## addFastDrawable()

void osgUtil::Statistics::addFastDrawable | ( |  | ) |

inline

References numFastDrawables.

## addImpostor()

void osgUtil::Statistics::addImpostor | ( | int | np | ) |

inline

References nimpostor.

## addLight()

void osgUtil::Statistics::addLight | ( | int | np | ) |

inline

References nlights.

## addMatrix()

void osgUtil::Statistics::addMatrix | ( |  | ) |

inline

References nummat.

## addOrderedLeaves()

void osgUtil::Statistics::addOrderedLeaves | ( | int | n | ) |

inline

References numOrderedLeaves.

## addStateGraphs()

void osgUtil::Statistics::addStateGraphs | ( | int | n | ) |

inline

References numStateGraphs.

## begin()

virtual void osgUtil::Statistics::begin | ( | GLenum | mode | ) |

virtual

## drawArrays()

virtual void osgUtil::Statistics::drawArrays | ( | GLenum | mode,
|  | GLint | first,
|  | GLsizei | count )

virtual

Mimics the OpenGL `glDrawArrays()` function.

Implements osg::PrimitiveFunctor.

## drawElements() [1/3]

virtual void osgUtil::Statistics::drawElements | ( | GLenum | mode,
|  | GLsizei | count,
|  | const GLubyte * | indices )

virtual

Mimics the OpenGL `glDrawElements()` function.

Implements osg::PrimitiveFunctor.

## drawElements() [2/3]

virtual void osgUtil::Statistics::drawElements | ( | GLenum | mode,
|  | GLsizei | count,
|  | const GLuint * | indices )

virtual

Mimics the OpenGL `glDrawElements()` function.

Implements osg::PrimitiveFunctor.

## drawElements() [3/3]

virtual void osgUtil::Statistics::drawElements | ( | GLenum | mode,
|  | GLsizei | count,
|  | const GLushort * | indices )

virtual

Mimics the OpenGL `glDrawElements()` function.

Implements osg::PrimitiveFunctor.

## end()

virtual void osgUtil::Statistics::end | ( |  | ) |

virtual

## getBins()

int osgUtil::Statistics::getBins | ( |  | ) |

inline

References nbins.

## getPrimitiveCountMap() [1/2]

PrimitiveCountMap & osgUtil::Statistics::getPrimitiveCountMap | ( |  | ) |

inline

## getPrimitiveCountMap() [2/2]

const PrimitiveCountMap & osgUtil::Statistics::getPrimitiveCountMap | ( |  | ) | const

inline

## GetPrimitivesBegin()

PrimitiveCountMap::iterator osgUtil::Statistics::GetPrimitivesBegin | ( |  | ) |

inline

deprecated

## GetPrimitivesEnd()

PrimitiveCountMap::iterator osgUtil::Statistics::GetPrimitivesEnd | ( |  | ) |

inline

deprecated

## getPrimitiveValueMap() [1/2]

PrimitiveValueMap & osgUtil::Statistics::getPrimitiveValueMap | ( |  | ) |

inline

References _primitiveCount.

## getPrimitiveValueMap() [2/2]

const PrimitiveValueMap & osgUtil::Statistics::getPrimitiveValueMap | ( |  | ) | const

inline

References _primitiveCount.

## reset()

void osgUtil::Statistics::reset | ( |  | ) |

## setBinNo()

void osgUtil::Statistics::setBinNo | ( | int | n | ) |

inline

References _binNo.

## setDepth()

void osgUtil::Statistics::setDepth | ( | int | d | ) |

inline

References depth.

## setType()

void osgUtil::Statistics::setType | ( | StatsType | t | ) |

inline

References stattype.

## setVertexArray() [1/6]

virtual void osgUtil::Statistics::setVertexArray | ( | unsigned int | count,
|  | const osg::Vec2 * | vertices )

inline virtual

Sets the array of vertices used to describe the primitives. Somehow mimics the OpenGL `glVertexPointer()` function.

Implements osg::PrimitiveFunctor.

References _vertexCount.

## setVertexArray() [2/6]

virtual void osgUtil::Statistics::setVertexArray | ( | unsigned int | count,
|  | const osg::Vec2d * | vertices )

inline virtual

Sets the array of vertices used to describe the primitives. Somehow mimics the OpenGL `glVertexPointer()` function.

Implements osg::PrimitiveFunctor.

References _vertexCount.

## setVertexArray() [3/6]

virtual void osgUtil::Statistics::setVertexArray | ( | unsigned int | count,
|  | const osg::Vec3 * | vertices )

inline virtual

Sets the array of vertices used to describe the primitives. Somehow mimics the OpenGL `glVertexPointer()` function.

Implements osg::PrimitiveFunctor.

References _vertexCount.

## setVertexArray() [4/6]

virtual void osgUtil::Statistics::setVertexArray | ( | unsigned int | count,
|  | const osg::Vec3d * | vertices )

inline virtual

Sets the array of vertices used to describe the primitives. Somehow mimics the OpenGL `glVertexPointer()` function.

Implements osg::PrimitiveFunctor.

References _vertexCount.

## setVertexArray() [5/6]

virtual void osgUtil::Statistics::setVertexArray | ( | unsigned int | count,
|  | const osg::Vec4 * | vertices )

inline virtual

Sets the array of vertices used to describe the primitives. Somehow mimics the OpenGL `glVertexPointer()` function.

Implements osg::PrimitiveFunctor.

References _vertexCount.

## setVertexArray() [6/6]

virtual void osgUtil::Statistics::setVertexArray | ( | unsigned int | count,
|  | const osg::Vec4d * | vertices )

inline virtual

Sets the array of vertices used to describe the primitives. Somehow mimics the OpenGL `glVertexPointer()` function.

Implements osg::PrimitiveFunctor.

References _vertexCount.

## vertex() [1/7]

void osgUtil::Statistics::vertex | ( |  | ) |

inline

References _currentPrimitiveFunctorMode, and _primitiveCount.

## vertex() [2/7]

virtual void osgUtil::Statistics::vertex | ( | const osg::Vec2 & |  | ) |

inline virtual

References vertex().

Referenced by vertex().

## vertex() [3/7]

virtual void osgUtil::Statistics::vertex | ( | const osg::Vec3 & |  | ) |

inline virtual

References vertex().

Referenced by vertex().

## vertex() [4/7]

virtual void osgUtil::Statistics::vertex | ( | const osg::Vec4 & |  | ) |

inline virtual

References vertex().

Referenced by vertex().

## vertex() [5/7]

virtual void osgUtil::Statistics::vertex | ( | float | ,
|  | float | )

inline virtual

References vertex().

Referenced by vertex().

## vertex() [6/7]

virtual void osgUtil::Statistics::vertex | ( | float | ,
|  | float | ,
|  | float | )

inline virtual

References vertex().

Referenced by vertex().

## vertex() [7/7]

virtual void osgUtil::Statistics::vertex | ( | float | ,
|  | float | ,
|  | float | ,
|  | float | )

inline virtual

References vertex().

Referenced by vertex().

## Member Data Documentation

## _binNo

int osgUtil::Statistics::_binNo

Referenced by setBinNo().

## _currentPrimitiveFunctorMode

GLenum osgUtil::Statistics::_currentPrimitiveFunctorMode

Referenced by vertex().

## _primitiveCount

PrimitiveValueMap osgUtil::Statistics::_primitiveCount

Referenced by getPrimitiveValueMap(), getPrimitiveValueMap(), and vertex().

## _vertexCount

unsigned int osgUtil::Statistics::_vertexCount

Referenced by setVertexArray(), setVertexArray(), setVertexArray(), setVertexArray(), setVertexArray(), and setVertexArray().

## depth

int osgUtil::Statistics::depth

Referenced by setDepth().

## nbins

int osgUtil::Statistics::nbins

Referenced by addBins(), and getBins().

## nimpostor

int osgUtil::Statistics::nimpostor

Referenced by addImpostor().

## nlights

int osgUtil::Statistics::nlights

Referenced by addLight().

## numDrawables

int osgUtil::Statistics::numDrawables

Referenced by addDrawable().

## numFastDrawables

int osgUtil::Statistics::numFastDrawables

Referenced by addFastDrawable().

## nummat

int osgUtil::Statistics::nummat

Referenced by addMatrix().

## numOrderedLeaves

int osgUtil::Statistics::numOrderedLeaves

Referenced by addOrderedLeaves().

## numStateGraphs

int osgUtil::Statistics::numStateGraphs

Referenced by addStateGraphs().

## stattype

StatsType osgUtil::Statistics::stattype

Referenced by setType().

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

- Statistics