14#ifndef OSGUTIL_STATISTICS
15#define OSGUTIL_STATISTICS 1
81 virtual void drawArrays(GLenum mode,GLint,GLsizei count);
82 virtual void drawElements(GLenum mode,GLsizei count,
const GLubyte*);
83 virtual void drawElements(GLenum mode,GLsizei count,
const GLushort*);
84 virtual void drawElements(GLenum mode,GLsizei count,
const GLuint*);
86 virtual void begin(GLenum mode);
92 _number_of_vertexes++;
149 unsigned int _total_primitives_count;
150 unsigned int _number_of_vertexes;
152 inline unsigned int _calculate_primitives_number_by_mode(GLenum, GLsizei);
155inline unsigned int Statistics::_calculate_primitives_number_by_mode(GLenum mode, GLsizei count)
161 case GL_POLYGON:
return count;
162 case GL_LINES:
return count / 2;
163 case GL_LINE_STRIP:
return count - 1;
164 case GL_TRIANGLES:
return count / 3;
165 case GL_TRIANGLE_STRIP:
166 case GL_TRIANGLE_FAN:
return count - 2;
167 case GL_QUADS:
return count / 4;
168 case GL_QUAD_STRIP:
return count / 2 - 1;
186 virtual void reset();
199 virtual void print(std::ostream& out);
Vec2f Vec2
Definition Vec2:21
Vec3f Vec3
Definition Vec3:21
Vec4f Vec4
Definition Vec4:21
The osgUtil library provides general purpose utility classes such as update, cull and draw traverses,...
Definition NodeVisitor:25
Pure virtual base class for drawable geometry.
Definition Drawable:89
A Geode is a "geometry node", that is, a leaf node on the scene graph that can have "renderable thing...
Definition Geode:29
General group node which maintains a list of children.
Definition Group:29
LOD - Level Of Detail group node which allows switching between children depending on distance from e...
Definition LOD:36
Base class for all internal nodes in the scene graph.
Definition Node:72
Visitor for type safe operations on osg::Nodes.
Definition NodeVisitor:82
virtual void reset()
Method to call to reset visitor.
Definition NodeVisitor:167
A PrimitiveFunctor is used (in conjunction with osg::Drawable::accept (PrimitiveFunctor&)) to get acc...
Definition PrimitiveSet:54
Stores a set of modes and attributes which represent a set of OpenGL state.
Definition StateSet:46
Switch is a Group node that allows switching between children.
Definition Switch:27
A Transform is a group node for which all children are transformed by a 4x4 matrix.
Definition Transform:75
General purpose double pair, uses include representation of texture coordinates.
Definition Vec2d:29
General purpose double triple for use as vertices, vectors and normals.
Definition Vec3d:30
General purpose double quad.
Definition Vec4d:29
Statistics base class.
Definition Statistics:48
int getBins()
Definition Statistics:109
void addStateGraphs(int n)
Definition Statistics:114
virtual void vertex(float, float, float, float)
Definition Statistics:100
void addLight(int np)
Definition Statistics:107
virtual void setVertexArray(unsigned int count, const osg::Vec4d *)
Sets the array of vertices used to describe the primitives.
Definition Statistics:79
int _binNo
Definition Statistics:137
void setDepth(int d)
Definition Statistics:110
virtual void drawElements(GLenum mode, GLsizei count, const GLubyte *)
Mimics the OpenGL glDrawElements() function.
virtual void begin(GLenum mode)
GLenum _currentPrimitiveFunctorMode
Definition Statistics:144
virtual void setVertexArray(unsigned int count, const osg::Vec4 *)
Sets the array of vertices used to describe the primitives.
Definition Statistics:76
void addOrderedLeaves(int n)
Definition Statistics:115
std::map< GLenum, unsigned int > PrimitiveCountMap
Definition Statistics:53
PrimitiveValueMap _primitiveCount
Definition Statistics:143
virtual void drawArrays(GLenum mode, GLint, GLsizei count)
Mimics the OpenGL glDrawArrays() function.
virtual void vertex(const osg::Vec3 &)
Definition Statistics:96
virtual void setVertexArray(unsigned int count, const osg::Vec3 *)
Sets the array of vertices used to describe the primitives.
Definition Statistics:74
PrimitiveCountMap::iterator GetPrimitivesBegin()
deprecated
Definition Statistics:129
int numFastDrawables
Definition Statistics:134
virtual void setVertexArray(unsigned int count, const osg::Vec3d *)
Sets the array of vertices used to describe the primitives.
Definition Statistics:77
unsigned int _vertexCount
Definition Statistics:142
StatsType stattype
Definition Statistics:138
std::map< GLenum, PrimitivePair > PrimitiveValueMap
Definition Statistics:52
int nlights
Definition Statistics:135
const PrimitiveCountMap & getPrimitiveCountMap() const
Definition Statistics:122
int nimpostor
Definition Statistics:139
virtual void vertex(const osg::Vec4 &)
Definition Statistics:98
void addDrawable()
Definition Statistics:104
void vertex()
Definition Statistics:88
void addFastDrawable()
Definition Statistics:105
virtual void setVertexArray(unsigned int count, const osg::Vec2 *)
Sets the array of vertices used to describe the primitives.
Definition Statistics:75
int numDrawables
Definition Statistics:133
int depth
Definition Statistics:136
void addMatrix()
Definition Statistics:106
void setBinNo(int n)
Definition Statistics:113
virtual void vertex(float, float)
Definition Statistics:99
PrimitiveValueMap & getPrimitiveValueMap()
Definition Statistics:124
virtual void drawElements(GLenum mode, GLsizei count, const GLushort *)
Mimics the OpenGL glDrawElements() function.
virtual void vertex(float, float, float)
Definition Statistics:95
void add(const Statistics &stats)
const PrimitiveValueMap & getPrimitiveValueMap() const
Definition Statistics:125
int nummat
Definition Statistics:133
PrimitiveCountMap::iterator GetPrimitivesEnd()
deprecated
Definition Statistics:131
void setType(StatsType t)
Definition Statistics:72
int numOrderedLeaves
Definition Statistics:140
PrimitiveCountMap & getPrimitiveCountMap()
Definition Statistics:121
virtual void drawElements(GLenum mode, GLsizei count, const GLuint *)
Mimics the OpenGL glDrawElements() function.
virtual void setVertexArray(unsigned int count, const osg::Vec2d *)
Sets the array of vertices used to describe the primitives.
Definition Statistics:78
int numStateGraphs
Definition Statistics:133
int nbins
Definition Statistics:133
void addBins(int np)
Definition Statistics:111
StatsType
Definition Statistics:59
@ STAT_PRIMS
Definition Statistics:63
@ STAT_GRAPHS
Definition Statistics:62
@ STAT_NONE
Definition Statistics:60
@ STAT_DC
Definition Statistics:66
@ STAT_PRIMSPERVIEW
Definition Statistics:64
@ STAT_FRAMERATE
Definition Statistics:61
@ STAT_PRIMSPERBIN
Definition Statistics:65
@ STAT_RESTART
Definition Statistics:67
std::pair< unsigned int, unsigned int > PrimitivePair
Definition Statistics:51
virtual void vertex(const osg::Vec2 &)
Definition Statistics:97
void addImpostor(int np)
Definition Statistics:108
virtual void apply(osg::Group &node)
META_NodeVisitor(osgUtil, StatsVisitor) virtual void reset()
std::set< osg::Node * > NodeSet
Definition Statistics:178
std::set< osg::StateSet * > StateSetSet
Definition Statistics:180
unsigned int _numInstancedDrawable
Definition Statistics:206
virtual void apply(osg::Switch &node)
StateSetSet _statesetSet
Definition Statistics:219
unsigned int _numInstancedLOD
Definition Statistics:203
virtual void apply(osg::Transform &node)
NodeSet _lodSet
Definition Statistics:213
NodeSet _switchSet
Definition Statistics:214
DrawableSet _geometrySet
Definition Statistics:217
osgUtil::Statistics _instancedStats
Definition Statistics:222
virtual void apply(osg::StateSet &ss)
NodeSet _transformSet
Definition Statistics:212
std::set< osg::Drawable * > DrawableSet
Definition Statistics:179
unsigned int _numInstancedSwitch
Definition Statistics:202
unsigned int _numInstancedStateSet
Definition Statistics:209
unsigned int _numInstancedFastGeometry
Definition Statistics:208
unsigned int _numInstancedTransform
Definition Statistics:204
virtual void print(std::ostream &out)
virtual void apply(osg::LOD &node)
DrawableSet _fastGeometrySet
Definition Statistics:218
unsigned int _numInstancedGeometry
Definition Statistics:207
osgUtil::Statistics _uniqueStats
Definition Statistics:221
virtual void apply(osg::Geode &node)
NodeSet _groupSet
Definition Statistics:211
virtual void totalUpStats()
unsigned int _numInstancedGeode
Definition Statistics:205
DrawableSet _drawableSet
Definition Statistics:216
unsigned int _numInstancedGroup
Definition Statistics:201
NodeSet _geodeSet
Definition Statistics:215
virtual void apply(osg::Node &node)
virtual void apply(osg::Drawable &drawable)
#define OSGUTIL_EXPORT
Definition Export:40