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. | |
| 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. | |
| virtual void | begin (GLenum mode) |
| virtual void | vertex (const Vec2 &vert) |
Mimics the OpenGL glVertex() "family of functions". | |
| virtual void | vertex (const Vec3 &vert) |
Mimics the OpenGL glVertex() "family of functions". | |
| virtual void | vertex (const Vec4 &vert) |
Mimics the OpenGL glVertex() "family of functions". | |
| virtual void | vertex (float x, float y) |
Mimics the OpenGL glVertex() "family of functions". | |
| virtual void | vertex (float x, float y, float z) |
Mimics the OpenGL glVertex() "family of functions". | |
| virtual void | vertex (float x, float y, float z, float w) |
Mimics the OpenGL glVertex() "family of functions". | |
| virtual void | end () |
Mimics the OpenGL glEnd() function. | |
Protected Attributes | |
| unsigned int | _vertexArraySize |
| const Vec3 * | _vertexArrayPtr |
| GLenum | _modeCache |
| std::vector< Vec3 > | _vertexCache |
| bool | _treatVertexDataAsTemporary |
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.
PrimitiveFunctor for general usage hints. | osg::TemplatePrimitiveFunctor< T >::TemplatePrimitiveFunctor | ( | ) | [inline] |
| virtual osg::TemplatePrimitiveFunctor< T >::~TemplatePrimitiveFunctor | ( | ) | [inline, virtual] |
| virtual void osg::TemplatePrimitiveFunctor< T >::begin | ( | GLenum | mode | ) | [inline, virtual] |
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.
References osg::TemplatePrimitiveFunctor< T >::_modeCache, and osg::TemplatePrimitiveFunctor< T >::_vertexCache.
| virtual void osg::TemplatePrimitiveFunctor< T >::drawArrays | ( | GLenum | mode, | |
| GLint | first, | |||
| GLsizei | count | |||
| ) | [inline, virtual] |
Mimics the OpenGL glDrawArrays() function.
Implements osg::PrimitiveFunctor.
References osg::TemplatePrimitiveFunctor< T >::_treatVertexDataAsTemporary, and osg::TemplatePrimitiveFunctor< T >::_vertexArrayPtr.
Referenced by osg::TemplatePrimitiveFunctor< T >::end().
| virtual void osg::TemplatePrimitiveFunctor< T >::drawElements | ( | GLenum | mode, | |
| GLsizei | count, | |||
| const GLubyte * | indices | |||
| ) | [inline, virtual] |
Mimics the OpenGL glDrawElements() function.
Implements osg::PrimitiveFunctor.
References osg::TemplatePrimitiveFunctor< T >::drawElementsTemplate().
| virtual void osg::TemplatePrimitiveFunctor< T >::drawElements | ( | GLenum | mode, | |
| GLsizei | count, | |||
| const GLuint * | indices | |||
| ) | [inline, virtual] |
Mimics the OpenGL glDrawElements() function.
Implements osg::PrimitiveFunctor.
References osg::TemplatePrimitiveFunctor< T >::drawElementsTemplate().
| virtual void osg::TemplatePrimitiveFunctor< T >::drawElements | ( | GLenum | mode, | |
| GLsizei | count, | |||
| const GLushort * | indices | |||
| ) | [inline, virtual] |
Mimics the OpenGL glDrawElements() function.
Implements osg::PrimitiveFunctor.
References osg::TemplatePrimitiveFunctor< T >::drawElementsTemplate().
| void osg::TemplatePrimitiveFunctor< T >::drawElementsTemplate | ( | GLenum | mode, | |
| GLsizei | count, | |||
| const IndexType * | indices | |||
| ) | [inline] |
| virtual void osg::TemplatePrimitiveFunctor< T >::end | ( | ) | [inline, virtual] |
Mimics the OpenGL glEnd() function.
Implements osg::PrimitiveFunctor.
References osg::TemplatePrimitiveFunctor< T >::_modeCache, osg::TemplatePrimitiveFunctor< T >::_treatVertexDataAsTemporary, osg::TemplatePrimitiveFunctor< T >::_vertexCache, osg::TemplatePrimitiveFunctor< T >::drawArrays(), and osg::TemplatePrimitiveFunctor< T >::setVertexArray().
| bool osg::TemplatePrimitiveFunctor< T >::getTreatVertexDataAsTemporary | ( | ) | const [inline] |
| void osg::TemplatePrimitiveFunctor< T >::setTreatVertexDataAsTemporary | ( | bool | treatVertexDataAsTemporary | ) | [inline] |
| virtual void osg::TemplatePrimitiveFunctor< T >::setVertexArray | ( | unsigned | 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.
Referenced by osg::TemplatePrimitiveFunctor< T >::end().
| virtual void osg::TemplatePrimitiveFunctor< T >::setVertexArray | ( | unsigned | 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.
| 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 osg::TemplatePrimitiveFunctor< T >::_vertexArrayPtr, and osg::TemplatePrimitiveFunctor< T >::_vertexArraySize.
| virtual void osg::TemplatePrimitiveFunctor< T >::setVertexArray | ( | unsigned | 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.
| virtual void osg::TemplatePrimitiveFunctor< T >::setVertexArray | ( | unsigned | 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.
| virtual void osg::TemplatePrimitiveFunctor< T >::setVertexArray | ( | unsigned | 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.
| virtual void osg::TemplatePrimitiveFunctor< T >::vertex | ( | float | x, | |
| float | y, | |||
| float | z | |||
| ) | [inline, virtual] |
Mimics the OpenGL glVertex() "family of functions".
Implements osg::PrimitiveFunctor.
References osg::TemplatePrimitiveFunctor< T >::_vertexCache.
| virtual void osg::TemplatePrimitiveFunctor< T >::vertex | ( | float | x, | |
| float | y, | |||
| float | z, | |||
| float | w | |||
| ) | [inline, virtual] |
Mimics the OpenGL glVertex() "family of functions".
Implements osg::PrimitiveFunctor.
References osg::TemplatePrimitiveFunctor< T >::_vertexCache.
| virtual void osg::TemplatePrimitiveFunctor< T >::vertex | ( | const Vec3 & | vert | ) | [inline, virtual] |
Mimics the OpenGL glVertex() "family of functions".
Implements osg::PrimitiveFunctor.
References osg::TemplatePrimitiveFunctor< T >::_vertexCache.
| virtual void osg::TemplatePrimitiveFunctor< T >::vertex | ( | float | x, | |
| float | y | |||
| ) | [inline, virtual] |
Mimics the OpenGL glVertex() "family of functions".
Implements osg::PrimitiveFunctor.
References osg::TemplatePrimitiveFunctor< T >::_vertexCache.
| virtual void osg::TemplatePrimitiveFunctor< T >::vertex | ( | const Vec2 & | vert | ) | [inline, virtual] |
Mimics the OpenGL glVertex() "family of functions".
Implements osg::PrimitiveFunctor.
References osg::TemplatePrimitiveFunctor< T >::_vertexCache.
| virtual void osg::TemplatePrimitiveFunctor< T >::vertex | ( | const Vec4 & | vert | ) | [inline, virtual] |
Mimics the OpenGL glVertex() "family of functions".
Implements osg::PrimitiveFunctor.
References osg::TemplatePrimitiveFunctor< T >::_vertexCache.
GLenum osg::TemplatePrimitiveFunctor< T >::_modeCache [protected] |
bool osg::TemplatePrimitiveFunctor< T >::_treatVertexDataAsTemporary [protected] |
Referenced by osg::TemplatePrimitiveFunctor< T >::drawArrays(), osg::TemplatePrimitiveFunctor< T >::drawElementsTemplate(), osg::TemplatePrimitiveFunctor< T >::end(), osg::TemplatePrimitiveFunctor< T >::getTreatVertexDataAsTemporary(), osg::TemplatePrimitiveFunctor< T >::setTreatVertexDataAsTemporary(), and osg::TemplatePrimitiveFunctor< T >::TemplatePrimitiveFunctor().
const Vec3* osg::TemplatePrimitiveFunctor< T >::_vertexArrayPtr [protected] |
unsigned int osg::TemplatePrimitiveFunctor< T >::_vertexArraySize [protected] |
std::vector<Vec3> osg::TemplatePrimitiveFunctor< T >::_vertexCache [protected] |
1.7.1