OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | List of all members
osg::TemplatePrimitiveFunctor< T > Class Template Reference

#include <TemplatePrimitiveFunctor.h>

Inheritance diagram for osg::TemplatePrimitiveFunctor< T >:
Inheritance graph
[legend]
Collaboration diagram for osg::TemplatePrimitiveFunctor< T >:
Collaboration graph
[legend]

Public Member Functions

 TemplatePrimitiveFunctor ()
 
virtual ~TemplatePrimitiveFunctor ()
 
void setTreatVertexDataAsTemporary (bool treatVertexDataAsTemporary)
 
bool getTreatVertexDataAsTemporary () const
 
virtual void setVertexArray (unsigned int, const Vec2 *)
 
virtual void setVertexArray (unsigned int count, const Vec3 *vertices)
 
virtual void setVertexArray (unsigned int, const Vec4 *)
 
virtual void setVertexArray (unsigned int, const Vec2d *)
 
virtual void setVertexArray (unsigned int, const Vec3d *)
 
virtual void setVertexArray (unsigned int, const Vec4d *)
 
virtual void drawArrays (GLenum mode, GLint first, GLsizei count)
 Mimics the OpenGL glDrawArrays() function. More...
 
template<class IndexType >
void drawElementsTemplate (GLenum mode, GLsizei count, const IndexType *indices)
 
virtual void drawElements (GLenum mode, GLsizei count, const GLubyte *indices)
 Mimics the OpenGL glDrawElements() function. More...
 
virtual void drawElements (GLenum mode, GLsizei count, const GLushort *indices)
 Mimics the OpenGL glDrawElements() function. More...
 
virtual void drawElements (GLenum mode, GLsizei count, const GLuint *indices)
 Mimics the OpenGL glDrawElements() function. More...
 
virtual void begin (GLenum mode)
 
virtual void vertex (const Vec2 &vert)
 Mimics the OpenGL glVertex() "family of functions". More...
 
virtual void vertex (const Vec3 &vert)
 Mimics the OpenGL glVertex() "family of functions". More...
 
virtual void vertex (const Vec4 &vert)
 Mimics the OpenGL glVertex() "family of functions". More...
 
virtual void vertex (float x, float y)
 Mimics the OpenGL glVertex() "family of functions". More...
 
virtual void vertex (float x, float y, float z)
 Mimics the OpenGL glVertex() "family of functions". More...
 
virtual void vertex (float x, float y, float z, float w)
 Mimics the OpenGL glVertex() "family of functions". More...
 
virtual void end ()
 Mimics the OpenGL glEnd() function. More...
 
- Public Member Functions inherited from osg::PrimitiveFunctor
virtual ~PrimitiveFunctor ()
 
void useVertexCacheAsVertexArray ()
 

Protected Attributes

unsigned int _vertexArraySize
 
const Vec3_vertexArrayPtr
 
GLenum _modeCache
 

Additional Inherited Members

- Public Attributes inherited from osg::PrimitiveFunctor
std::vector< Vec3_vertexCache
 
bool _treatVertexDataAsTemporary
 

Detailed Description

template<class T>
class osg::TemplatePrimitiveFunctor< T >

Provides access to the primitives that compose an osg::Drawable.

Notice that TemplatePrimitiveFunctor is a class template, and that it inherits from its template parameter T. This template parameter must implement operator()(const osg::Vec3 v1, const osg::Vec3 v2, const osg::Vec3 v3, bool treatVertexDataAsTemporary), operator()(const osg::Vec3 v1, const osg::Vec3 v2, bool treatVertexDataAsTemporary), operator()(const osg::Vec3 v1, const osg::Vec3 v2, const osg::Vec3 v3, bool treatVertexDataAsTemporary), and operator()(const osg::Vec3 v1, const osg::Vec3 v2, const osg::Vec3 v3, const osg::Vec3 v4, bool treatVertexDataAsTemporary) which will be called for the matching primitive when the functor is applied to a Drawable. Parameters v1, v2, v3, and v4 are the vertices of the primitive. The last parameter, treatVertexDataAsTemporary, indicates whether these vertices are coming from a "real" vertex array, or from a temporary vertex array, created by the TemplatePrimitiveFunctor from some other geometry representation.

See also
PrimitiveFunctor for general usage hints.

Definition at line 41 of file TemplatePrimitiveFunctor.h.

Constructor & Destructor Documentation

template<class T >
osg::TemplatePrimitiveFunctor< T >::TemplatePrimitiveFunctor ( )
inline

Definition at line 45 of file TemplatePrimitiveFunctor.h.

template<class T >
virtual osg::TemplatePrimitiveFunctor< T >::~TemplatePrimitiveFunctor ( )
inlinevirtual

Definition at line 53 of file TemplatePrimitiveFunctor.h.

Member Function Documentation

template<class T >
virtual void osg::TemplatePrimitiveFunctor< T >::begin ( GLenum  mode)
inlinevirtual

Note: begin(..),vertex(..) & end() are convenience methods for adapting non vertex array primitives to vertex array based primitives. This is done to simplify the implementation of primitive functor subclasses - users only need override drawArray and drawElements.

Implements osg::PrimitiveFunctor.

Definition at line 281 of file TemplatePrimitiveFunctor.h.

template<class T >
virtual void osg::TemplatePrimitiveFunctor< T >::drawArrays ( GLenum  mode,
GLint  first,
GLsizei  count 
)
inlinevirtual

Mimics the OpenGL glDrawArrays() function.

Implements osg::PrimitiveFunctor.

Definition at line 90 of file TemplatePrimitiveFunctor.h.

Here is the caller graph for this function:

template<class T >
virtual void osg::TemplatePrimitiveFunctor< T >::drawElements ( GLenum  mode,
GLsizei  count,
const GLubyte *  indices 
)
inlinevirtual

Mimics the OpenGL glDrawElements() function.

Implements osg::PrimitiveFunctor.

Definition at line 260 of file TemplatePrimitiveFunctor.h.

Here is the call graph for this function:

template<class T >
virtual void osg::TemplatePrimitiveFunctor< T >::drawElements ( GLenum  mode,
GLsizei  count,
const GLushort *  indices 
)
inlinevirtual

Mimics the OpenGL glDrawElements() function.

Implements osg::PrimitiveFunctor.

Definition at line 265 of file TemplatePrimitiveFunctor.h.

Here is the call graph for this function:

template<class T >
virtual void osg::TemplatePrimitiveFunctor< T >::drawElements ( GLenum  mode,
GLsizei  count,
const GLuint *  indices 
)
inlinevirtual

Mimics the OpenGL glDrawElements() function.

Implements osg::PrimitiveFunctor.

Definition at line 270 of file TemplatePrimitiveFunctor.h.

Here is the call graph for this function:

template<class T >
template<class IndexType >
void osg::TemplatePrimitiveFunctor< T >::drawElementsTemplate ( GLenum  mode,
GLsizei  count,
const IndexType *  indices 
)
inline

Definition at line 168 of file TemplatePrimitiveFunctor.h.

Here is the caller graph for this function:

template<class T >
virtual void osg::TemplatePrimitiveFunctor< T >::end ( )
inlinevirtual

Mimics the OpenGL glEnd() function.

Implements osg::PrimitiveFunctor.

Definition at line 293 of file TemplatePrimitiveFunctor.h.

Here is the call graph for this function:

template<class T >
bool osg::TemplatePrimitiveFunctor< T >::getTreatVertexDataAsTemporary ( ) const
inline

Definition at line 56 of file TemplatePrimitiveFunctor.h.

template<class T >
void osg::TemplatePrimitiveFunctor< T >::setTreatVertexDataAsTemporary ( bool  treatVertexDataAsTemporary)
inline

Definition at line 55 of file TemplatePrimitiveFunctor.h.

template<class T >
virtual void osg::TemplatePrimitiveFunctor< T >::setVertexArray ( unsigned  count,
const Vec2 vertices 
)
inlinevirtual

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

Implements osg::PrimitiveFunctor.

Definition at line 58 of file TemplatePrimitiveFunctor.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class T >
virtual void osg::TemplatePrimitiveFunctor< T >::setVertexArray ( unsigned int  count,
const Vec3 vertices 
)
inlinevirtual

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

Implements osg::PrimitiveFunctor.

Definition at line 63 of file TemplatePrimitiveFunctor.h.

template<class T >
virtual void osg::TemplatePrimitiveFunctor< T >::setVertexArray ( unsigned  count,
const Vec4 vertices 
)
inlinevirtual

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

Implements osg::PrimitiveFunctor.

Definition at line 69 of file TemplatePrimitiveFunctor.h.

Here is the call graph for this function:

template<class T >
virtual void osg::TemplatePrimitiveFunctor< T >::setVertexArray ( unsigned  count,
const Vec2d vertices 
)
inlinevirtual

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

Implements osg::PrimitiveFunctor.

Definition at line 74 of file TemplatePrimitiveFunctor.h.

Here is the call graph for this function:

template<class T >
virtual void osg::TemplatePrimitiveFunctor< T >::setVertexArray ( unsigned  count,
const Vec3d vertices 
)
inlinevirtual

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

Implements osg::PrimitiveFunctor.

Definition at line 79 of file TemplatePrimitiveFunctor.h.

Here is the call graph for this function:

template<class T >
virtual void osg::TemplatePrimitiveFunctor< T >::setVertexArray ( unsigned  count,
const Vec4d vertices 
)
inlinevirtual

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

Implements osg::PrimitiveFunctor.

Definition at line 84 of file TemplatePrimitiveFunctor.h.

Here is the call graph for this function:

template<class T >
virtual void osg::TemplatePrimitiveFunctor< T >::vertex ( const Vec2 vert)
inlinevirtual

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

Implements osg::PrimitiveFunctor.

Definition at line 287 of file TemplatePrimitiveFunctor.h.

template<class T >
virtual void osg::TemplatePrimitiveFunctor< T >::vertex ( const Vec3 vert)
inlinevirtual

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

Implements osg::PrimitiveFunctor.

Definition at line 288 of file TemplatePrimitiveFunctor.h.

template<class T >
virtual void osg::TemplatePrimitiveFunctor< T >::vertex ( const Vec4 vert)
inlinevirtual

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

Implements osg::PrimitiveFunctor.

Definition at line 289 of file TemplatePrimitiveFunctor.h.

template<class T >
virtual void osg::TemplatePrimitiveFunctor< T >::vertex ( float  x,
float  y 
)
inlinevirtual

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

Implements osg::PrimitiveFunctor.

Definition at line 290 of file TemplatePrimitiveFunctor.h.

template<class T >
virtual void osg::TemplatePrimitiveFunctor< T >::vertex ( float  x,
float  y,
float  z 
)
inlinevirtual

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

Implements osg::PrimitiveFunctor.

Definition at line 291 of file TemplatePrimitiveFunctor.h.

template<class T >
virtual void osg::TemplatePrimitiveFunctor< T >::vertex ( float  x,
float  y,
float  z,
float  w 
)
inlinevirtual

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

Implements osg::PrimitiveFunctor.

Definition at line 292 of file TemplatePrimitiveFunctor.h.

Member Data Documentation

template<class T >
GLenum osg::TemplatePrimitiveFunctor< T >::_modeCache
protected

Definition at line 309 of file TemplatePrimitiveFunctor.h.

template<class T >
const Vec3* osg::TemplatePrimitiveFunctor< T >::_vertexArrayPtr
protected

Definition at line 307 of file TemplatePrimitiveFunctor.h.

template<class T >
unsigned int osg::TemplatePrimitiveFunctor< T >::_vertexArraySize
protected

Definition at line 306 of file TemplatePrimitiveFunctor.h.


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