OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | List of all members
osg::PrimitiveFunctor Class Referenceabstract

#include <PrimitiveSet.h>

Inheritance diagram for osg::PrimitiveFunctor:
Inheritance graph
[legend]

Public Member Functions

virtual ~PrimitiveFunctor ()
 
virtual void setVertexArray (unsigned int count, const Vec2 *vertices)=0
 
virtual void setVertexArray (unsigned int count, const Vec3 *vertices)=0
 
virtual void setVertexArray (unsigned int count, const Vec4 *vertices)=0
 
virtual void setVertexArray (unsigned int count, const Vec2d *vertices)=0
 
virtual void setVertexArray (unsigned int count, const Vec3d *vertices)=0
 
virtual void setVertexArray (unsigned int count, const Vec4d *vertices)=0
 
virtual void drawArrays (GLenum mode, GLint first, GLsizei count)=0
 Mimics the OpenGL glDrawArrays() function. More...
 
virtual void drawElements (GLenum mode, GLsizei count, const GLubyte *indices)=0
 Mimics the OpenGL glDrawElements() function. More...
 
virtual void drawElements (GLenum mode, GLsizei count, const GLushort *indices)=0
 Mimics the OpenGL glDrawElements() function. More...
 
virtual void drawElements (GLenum mode, GLsizei count, const GLuint *indices)=0
 Mimics the OpenGL glDrawElements() function. More...
 
virtual void begin (GLenum mode)=0
 Mimics the OpenGL glBegin() function. More...
 
virtual void vertex (const Vec2 &vert)=0
 Mimics the OpenGL glVertex() "family of functions". More...
 
virtual void vertex (const Vec3 &vert)=0
 Mimics the OpenGL glVertex() "family of functions". More...
 
virtual void vertex (const Vec4 &vert)=0
 Mimics the OpenGL glVertex() "family of functions". More...
 
virtual void vertex (float x, float y)=0
 Mimics the OpenGL glVertex() "family of functions". More...
 
virtual void vertex (float x, float y, float z)=0
 Mimics the OpenGL glVertex() "family of functions". More...
 
virtual void vertex (float x, float y, float z, float w)=0
 Mimics the OpenGL glVertex() "family of functions". More...
 
virtual void end ()=0
 Mimics the OpenGL glEnd() function. More...
 
void useVertexCacheAsVertexArray ()
 

Public Attributes

std::vector< Vec3_vertexCache
 
bool _treatVertexDataAsTemporary
 

Detailed Description

A PrimitiveFunctor is used (in conjunction with osg::Drawable::accept (PrimitiveFunctor&)) to get access to the primitives that compose the things drawn by OSG.

If osg::Drawable::accept() is called with a PrimitiveFunctor parameter, the Drawable will "pretend" it is drawing itself, but instead of calling real OpenGL functions, it will call PrimitiveFunctor's member functions that "mimic" the OpenGL calls.

Concrete subclasses of PrimitiveFunctor must implement these methods so that they performs whatever they want.

Definition at line 51 of file PrimitiveSet.h.

Constructor & Destructor Documentation

virtual osg::PrimitiveFunctor::~PrimitiveFunctor ( )
inlinevirtual

Definition at line 55 of file PrimitiveSet.h.

Member Function Documentation

virtual void osg::PrimitiveFunctor::begin ( GLenum  mode)
pure virtual

Mimics the OpenGL glBegin() function.

Implemented in osg::TriangleFunctor< T >, osg::TemplatePrimitiveFunctor< T >, and osgUtil::Statistics.

virtual void osg::PrimitiveFunctor::drawArrays ( GLenum  mode,
GLint  first,
GLsizei  count 
)
pure virtual

Mimics the OpenGL glDrawArrays() function.

Implemented in osg::TemplatePrimitiveFunctor< T >, osg::TriangleFunctor< T >, and osgUtil::Statistics.

virtual void osg::PrimitiveFunctor::drawElements ( GLenum  mode,
GLsizei  count,
const GLubyte *  indices 
)
pure virtual

Mimics the OpenGL glDrawElements() function.

Implemented in osg::TemplatePrimitiveFunctor< T >, osg::TriangleFunctor< T >, and osgUtil::Statistics.

virtual void osg::PrimitiveFunctor::drawElements ( GLenum  mode,
GLsizei  count,
const GLushort *  indices 
)
pure virtual

Mimics the OpenGL glDrawElements() function.

Implemented in osg::TemplatePrimitiveFunctor< T >, osg::TriangleFunctor< T >, and osgUtil::Statistics.

virtual void osg::PrimitiveFunctor::drawElements ( GLenum  mode,
GLsizei  count,
const GLuint *  indices 
)
pure virtual

Mimics the OpenGL glDrawElements() function.

Implemented in osg::TriangleFunctor< T >, osg::TemplatePrimitiveFunctor< T >, and osgUtil::Statistics.

virtual void osg::PrimitiveFunctor::end ( )
pure virtual

Mimics the OpenGL glEnd() function.

Implemented in osg::TriangleFunctor< T >, osg::TemplatePrimitiveFunctor< T >, and osgUtil::Statistics.

virtual void osg::PrimitiveFunctor::setVertexArray ( unsigned int  count,
const Vec2 vertices 
)
pure virtual

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

Implemented in osgUtil::Statistics, osg::TemplatePrimitiveFunctor< T >, and osg::TriangleFunctor< T >.

Here is the caller graph for this function:

virtual void osg::PrimitiveFunctor::setVertexArray ( unsigned int  count,
const Vec3 vertices 
)
pure virtual

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

Implemented in osgUtil::Statistics, osg::TemplatePrimitiveFunctor< T >, and osg::TriangleFunctor< T >.

virtual void osg::PrimitiveFunctor::setVertexArray ( unsigned int  count,
const Vec4 vertices 
)
pure virtual

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

Implemented in osgUtil::Statistics, osg::TemplatePrimitiveFunctor< T >, and osg::TriangleFunctor< T >.

virtual void osg::PrimitiveFunctor::setVertexArray ( unsigned int  count,
const Vec2d vertices 
)
pure virtual

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

Implemented in osgUtil::Statistics, osg::TemplatePrimitiveFunctor< T >, and osg::TriangleFunctor< T >.

virtual void osg::PrimitiveFunctor::setVertexArray ( unsigned int  count,
const Vec3d vertices 
)
pure virtual

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

Implemented in osg::TemplatePrimitiveFunctor< T >, osgUtil::Statistics, and osg::TriangleFunctor< T >.

virtual void osg::PrimitiveFunctor::setVertexArray ( unsigned int  count,
const Vec4d vertices 
)
pure virtual

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

Implemented in osg::TemplatePrimitiveFunctor< T >, osg::TriangleFunctor< T >, and osgUtil::Statistics.

void osg::PrimitiveFunctor::useVertexCacheAsVertexArray ( )
inline

Definition at line 123 of file PrimitiveSet.h.

Here is the call graph for this function:

virtual void osg::PrimitiveFunctor::vertex ( const Vec2 vert)
pure virtual

Mimics the OpenGL glVertex() "family of functions".

Implemented in osg::TriangleFunctor< T >, osg::TemplatePrimitiveFunctor< T >, and osgUtil::Statistics.

virtual void osg::PrimitiveFunctor::vertex ( const Vec3 vert)
pure virtual

Mimics the OpenGL glVertex() "family of functions".

Implemented in osg::TriangleFunctor< T >, osg::TemplatePrimitiveFunctor< T >, and osgUtil::Statistics.

virtual void osg::PrimitiveFunctor::vertex ( const Vec4 vert)
pure virtual

Mimics the OpenGL glVertex() "family of functions".

Implemented in osg::TriangleFunctor< T >, osg::TemplatePrimitiveFunctor< T >, and osgUtil::Statistics.

virtual void osg::PrimitiveFunctor::vertex ( float  x,
float  y 
)
pure virtual

Mimics the OpenGL glVertex() "family of functions".

Implemented in osg::TriangleFunctor< T >, osg::TemplatePrimitiveFunctor< T >, and osgUtil::Statistics.

virtual void osg::PrimitiveFunctor::vertex ( float  x,
float  y,
float  z 
)
pure virtual

Mimics the OpenGL glVertex() "family of functions".

Implemented in osg::TriangleFunctor< T >, osg::TemplatePrimitiveFunctor< T >, and osgUtil::Statistics.

virtual void osg::PrimitiveFunctor::vertex ( float  x,
float  y,
float  z,
float  w 
)
pure virtual

Mimics the OpenGL glVertex() "family of functions".

Implemented in osg::TriangleFunctor< T >, osg::TemplatePrimitiveFunctor< T >, and osgUtil::Statistics.

Member Data Documentation

bool osg::PrimitiveFunctor::_treatVertexDataAsTemporary

Definition at line 129 of file PrimitiveSet.h.

std::vector<Vec3> osg::PrimitiveFunctor::_vertexCache

Definition at line 128 of file PrimitiveSet.h.


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