OpenSceneGraph
3.0.1
|
Provides access to the triangles that compose an osg::Drawable
.
More...
Public Member Functions | |
TriangleFunctor () | |
virtual | ~TriangleFunctor () |
void | setTreatVertexDataAsTemporary (bool treatVertexDataAsTemporary) |
bool | getTreatVertexDataAsTemporary () const |
virtual void | setVertexArray (unsigned int, const Vec2 *) |
Sets the array of vertices used to describe the primitives. | |
virtual void | setVertexArray (unsigned int count, const Vec3 *vertices) |
Sets the array of vertices used to describe the primitives. | |
virtual void | setVertexArray (unsigned int, const Vec4 *) |
Sets the array of vertices used to describe the primitives. | |
virtual void | setVertexArray (unsigned int, const Vec2d *) |
Sets the array of vertices used to describe the primitives. | |
virtual void | setVertexArray (unsigned int, const Vec3d *) |
Sets the array of vertices used to describe the primitives. | |
virtual void | setVertexArray (unsigned int, const Vec4d *) |
Sets the array of vertices used to describe the primitives. | |
virtual void | drawArrays (GLenum mode, GLint first, GLsizei count) |
Mimics the OpenGL glDrawArrays() function. | |
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) |
Note: begin(..),vertex(..) & end() are convenience methods for adapting non vertex array primitives to vertex array based primitives. | |
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 triangles that compose an osg::Drawable
.
If the Drawable
is not composed of triangles, the TriangleFunctor
will convert the primitives to triangles whenever possible.
Notice that TriangleFunctor
is a class template, and that it inherits from its template parameter T
. This template parameter must implement T::operator() (const osg::Vec3 v1, const osg::Vec3 v2, const osg::Vec3 v3, bool treatVertexDataAsTemporary)
, which will be called for every triangle when the functor is applied to a Drawable
. Parameters v1
, v2
, and v3
are the triangle vertices. The fourth parameter, treatVertexDataAsTemporary
, indicates whether these vertices are coming from a "real" vertex array, or from a temporary vertex array, created by the TriangleFunctor
from some other geometry representation.
PrimitiveFunctor
for general usage hints. osg::TriangleFunctor::TriangleFunctor | ( | ) | [inline] |
References _vertexArraySize, _vertexArrayPtr, _modeCache, and _treatVertexDataAsTemporary.
virtual osg::TriangleFunctor::~TriangleFunctor | ( | ) | [inline, virtual] |
virtual void osg::TriangleFunctor::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 _modeCache, and _vertexCache.
virtual void osg::TriangleFunctor::drawArrays | ( | GLenum | mode, |
GLint | first, | ||
GLsizei | count | ||
) | [inline, virtual] |
Mimics the OpenGL glDrawArrays()
function.
Implements osg::PrimitiveFunctor.
References _vertexArrayPtr, and _treatVertexDataAsTemporary.
Referenced by end().
virtual void osg::TriangleFunctor::drawElements | ( | GLenum | mode, |
GLsizei | count, | ||
const GLubyte * | indices | ||
) | [inline, virtual] |
Mimics the OpenGL glDrawElements()
function.
Implements osg::PrimitiveFunctor.
References _vertexArrayPtr, and _treatVertexDataAsTemporary.
virtual void osg::TriangleFunctor::drawElements | ( | GLenum | mode, |
GLsizei | count, | ||
const GLushort * | indices | ||
) | [inline, virtual] |
Mimics the OpenGL glDrawElements()
function.
Implements osg::PrimitiveFunctor.
References _vertexArrayPtr, and _treatVertexDataAsTemporary.
virtual void osg::TriangleFunctor::drawElements | ( | GLenum | mode, |
GLsizei | count, | ||
const GLuint * | indices | ||
) | [inline, virtual] |
Mimics the OpenGL glDrawElements()
function.
Implements osg::PrimitiveFunctor.
References _vertexArrayPtr, and _treatVertexDataAsTemporary.
virtual void osg::TriangleFunctor::end | ( | ) | [inline, virtual] |
Mimics the OpenGL glEnd()
function.
Implements osg::PrimitiveFunctor.
References _vertexCache, setVertexArray(), _treatVertexDataAsTemporary, drawArrays(), and _modeCache.
bool osg::TriangleFunctor::getTreatVertexDataAsTemporary | ( | ) | const [inline] |
References _treatVertexDataAsTemporary.
void osg::TriangleFunctor::setTreatVertexDataAsTemporary | ( | bool | treatVertexDataAsTemporary | ) | [inline] |
References _treatVertexDataAsTemporary.
virtual void osg::TriangleFunctor::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 end().
virtual void osg::TriangleFunctor::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 _vertexArraySize, and _vertexArrayPtr.
virtual void osg::TriangleFunctor::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::TriangleFunctor::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::TriangleFunctor::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::TriangleFunctor::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::TriangleFunctor::vertex | ( | const Vec2 & | vert | ) | [inline, virtual] |
Mimics the OpenGL glVertex()
"family of functions".
Implements osg::PrimitiveFunctor.
References _vertexCache.
virtual void osg::TriangleFunctor::vertex | ( | const Vec3 & | vert | ) | [inline, virtual] |
Mimics the OpenGL glVertex()
"family of functions".
Implements osg::PrimitiveFunctor.
References _vertexCache.
virtual void osg::TriangleFunctor::vertex | ( | const Vec4 & | vert | ) | [inline, virtual] |
Mimics the OpenGL glVertex()
"family of functions".
Implements osg::PrimitiveFunctor.
References _vertexCache.
virtual void osg::TriangleFunctor::vertex | ( | float | x, |
float | y | ||
) | [inline, virtual] |
Mimics the OpenGL glVertex()
"family of functions".
Implements osg::PrimitiveFunctor.
References _vertexCache.
virtual void osg::TriangleFunctor::vertex | ( | float | x, |
float | y, | ||
float | z | ||
) | [inline, virtual] |
Mimics the OpenGL glVertex()
"family of functions".
Implements osg::PrimitiveFunctor.
References _vertexCache.
virtual void osg::TriangleFunctor::vertex | ( | float | x, |
float | y, | ||
float | z, | ||
float | w | ||
) | [inline, virtual] |
Mimics the OpenGL glVertex()
"family of functions".
Implements osg::PrimitiveFunctor.
References _vertexCache.
GLenum osg::TriangleFunctor::_modeCache [protected] |
Referenced by TriangleFunctor(), begin(), and end().
bool osg::TriangleFunctor::_treatVertexDataAsTemporary [protected] |
Referenced by TriangleFunctor(), setTreatVertexDataAsTemporary(), getTreatVertexDataAsTemporary(), drawArrays(), drawElements(), and end().
const Vec3* osg::TriangleFunctor::_vertexArrayPtr [protected] |
Referenced by TriangleFunctor(), setVertexArray(), drawArrays(), and drawElements().
unsigned int osg::TriangleFunctor::_vertexArraySize [protected] |
Referenced by TriangleFunctor(), and setVertexArray().
std::vector<Vec3> osg::TriangleFunctor::_vertexCache [protected] |
![]() | Generated at Mon Oct 3 2011 12:39:45 for the OpenSceneGraph by doxygen 1.7.5. |