OpenSceneGraph
Public Member Functions | Protected Attributes | List of all members
osg::TriangleFunctor< T > Class Template Reference

Provides access to the triangles that compose an osg::Drawable. More...

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

Public Member Functions

 TriangleFunctor ()
 
virtual ~TriangleFunctor ()
 
virtual void setVertexArray (unsigned int, const Vec2 *)
 Sets the array of vertices used to describe the primitives. More...
 
virtual void setVertexArray (unsigned int count, const Vec3 *vertices)
 Sets the array of vertices used to describe the primitives. More...
 
virtual void setVertexArray (unsigned int, const Vec4 *)
 Sets the array of vertices used to describe the primitives. More...
 
virtual void setVertexArray (unsigned int, const Vec2d *)
 Sets the array of vertices used to describe the primitives. More...
 
virtual void setVertexArray (unsigned int, const Vec3d *)
 Sets the array of vertices used to describe the primitives. More...
 
virtual void setVertexArray (unsigned int, const Vec4d *)
 Sets the array of vertices used to describe the primitives. More...
 
virtual void drawArrays (GLenum mode, GLint first, GLsizei count)
 Mimics the OpenGL glDrawArrays() function. More...
 
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...
 
- Public Member Functions inherited from osg::PrimitiveFunctor
virtual ~PrimitiveFunctor ()
 

Protected Attributes

unsigned int _vertexArraySize
 
const Vec3_vertexArrayPtr
 

Detailed Description

template<class T>
class osg::TriangleFunctor< T >

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.

See also
PrimitiveFunctor for general usage hints.

Constructor & Destructor Documentation

◆ TriangleFunctor()

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

◆ ~TriangleFunctor()

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

Member Function Documentation

◆ drawArrays()

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

Mimics the OpenGL glDrawArrays() function.

Implements osg::PrimitiveFunctor.

References osg::TriangleFunctor< T >::_vertexArrayPtr.

◆ drawElements() [1/3]

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

Mimics the OpenGL glDrawElements() function.

Implements osg::PrimitiveFunctor.

References osg::TriangleFunctor< T >::_vertexArrayPtr.

◆ drawElements() [2/3]

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

Mimics the OpenGL glDrawElements() function.

Implements osg::PrimitiveFunctor.

References osg::TriangleFunctor< T >::_vertexArrayPtr.

◆ drawElements() [3/3]

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

Mimics the OpenGL glDrawElements() function.

Implements osg::PrimitiveFunctor.

References osg::TriangleFunctor< T >::_vertexArrayPtr.

◆ setVertexArray() [1/6]

template<class T >
virtual void osg::TriangleFunctor< 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.

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

◆ setVertexArray() [2/6]

template<class T >
virtual void osg::TriangleFunctor< 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.

References osg::TriangleFunctor< T >::_vertexArrayPtr, and osg::TriangleFunctor< T >::_vertexArraySize.

◆ setVertexArray() [3/6]

template<class T >
virtual void osg::TriangleFunctor< 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.

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

◆ setVertexArray() [4/6]

template<class T >
virtual void osg::TriangleFunctor< 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.

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

◆ setVertexArray() [5/6]

template<class T >
virtual void osg::TriangleFunctor< 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.

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

◆ setVertexArray() [6/6]

template<class T >
virtual void osg::TriangleFunctor< 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.

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

Member Data Documentation

◆ _vertexArrayPtr

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

◆ _vertexArraySize

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

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