osg::TemplatePrimitiveFunctor< T > Class Template Reference

`#include <TemplatePrimitiveFunctor>`

Inheritance diagram for osg::TemplatePrimitiveFunctor< T >:

## Public Member Functions

| TemplatePrimitiveFunctor ()
virtual | ~TemplatePrimitiveFunctor ()
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.
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.
virtual void | drawElements (GLenum mode, GLsizei count, const GLushort *indices)
| Mimics the OpenGL `glDrawElements()` function.
virtual void | drawElements (GLenum mode, GLsizei count, const GLuint *indices)
| Mimics the OpenGL `glDrawElements()` function.
Public Member Functions inherited from osg::PrimitiveFunctor
virtual | ~PrimitiveFunctor ()

## Protected Attributes

unsigned int | _vertexArraySize
const Vec3 * | _vertexArrayPtr

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

## Constructor & Destructor Documentation

## TemplatePrimitiveFunctor()

template<class T>

osg::TemplatePrimitiveFunctor< T >::TemplatePrimitiveFunctor | ( |  | ) |

inline

References _vertexArrayPtr, and _vertexArraySize.

## ~TemplatePrimitiveFunctor()

template<class T>

virtual osg::TemplatePrimitiveFunctor< T >::~TemplatePrimitiveFunctor | ( |  | ) |

inline virtual

## Member Function Documentation

## drawArrays()

template<class T>

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

inline virtual

Mimics the OpenGL `glDrawArrays()` function.

Implements osg::PrimitiveFunctor.

References _vertexArrayPtr, and GL_LINE_STRIP_ADJACENCY.

## drawElements() [1/3]

template<class T>

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

inline virtual

Mimics the OpenGL `glDrawElements()` function.

Implements osg::PrimitiveFunctor.

References drawElementsTemplate().

## drawElements() [2/3]

template<class T>

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

inline virtual

Mimics the OpenGL `glDrawElements()` function.

Implements osg::PrimitiveFunctor.

References drawElementsTemplate().

## drawElements() [3/3]

template<class T>

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

inline virtual

Mimics the OpenGL `glDrawElements()` function.

Implements osg::PrimitiveFunctor.

References drawElementsTemplate().

## drawElementsTemplate()

template<class T>
template<class IndexType>

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

inline

References _vertexArrayPtr, and GL_LINE_STRIP_ADJACENCY.

Referenced by drawElements(), drawElements(), and drawElements().

## setVertexArray() [1/6]

template<class T>

virtual void osg::TemplatePrimitiveFunctor< T >::setVertexArray | ( | unsigned int | count,
|  | const Vec3 * | vertices )

inline virtual

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

Implements osg::PrimitiveFunctor.

References _vertexArrayPtr, and _vertexArraySize.

## setVertexArray() [2/6]

template<class T>

virtual void osg::TemplatePrimitiveFunctor< T >::setVertexArray | ( | unsigned int | count,
|  | const Vec2 * | vertices )

inline virtual

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

Implements osg::PrimitiveFunctor.

References osg::notify(), and osg::WARN.

## setVertexArray() [3/6]

template<class T>

virtual void osg::TemplatePrimitiveFunctor< T >::setVertexArray | ( | unsigned int | count,
|  | const Vec2d * | vertices )

inline virtual

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

Implements osg::PrimitiveFunctor.

References osg::notify(), and osg::WARN.

## setVertexArray() [4/6]

template<class T>

virtual void osg::TemplatePrimitiveFunctor< T >::setVertexArray | ( | unsigned int | count,
|  | const Vec3d * | vertices )

inline virtual

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

Implements osg::PrimitiveFunctor.

References osg::notify(), and osg::WARN.

## setVertexArray() [5/6]

template<class T>

virtual void osg::TemplatePrimitiveFunctor< T >::setVertexArray | ( | unsigned int | count,
|  | const Vec4 * | vertices )

inline virtual

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

Implements osg::PrimitiveFunctor.

References osg::notify(), and osg::WARN.

## setVertexArray() [6/6]

template<class T>

virtual void osg::TemplatePrimitiveFunctor< T >::setVertexArray | ( | unsigned int | count,
|  | const Vec4d * | vertices )

inline virtual

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

Implements osg::PrimitiveFunctor.

References osg::notify(), and osg::WARN.

## Member Data Documentation

## _vertexArrayPtr

template<class T>

const Vec3* osg::TemplatePrimitiveFunctor< T >::_vertexArrayPtr

protected

Referenced by drawArrays(), drawElementsTemplate(), setVertexArray(), and TemplatePrimitiveFunctor().

## _vertexArraySize

template<class T>

unsigned int osg::TemplatePrimitiveFunctor< T >::_vertexArraySize

protected

Referenced by setVertexArray(), and TemplatePrimitiveFunctor().

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

- TemplatePrimitiveFunctor