1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
3 * This library is open source and may be redistributed and/or modified under
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version. The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * OpenSceneGraph Public License for more details.
14#ifndef OSGUTIL_REVERSEPRIMITIVEFUNCTOR
15#define OSGUTIL_REVERSEPRIMITIVEFUNCTOR 1
17#include <osg/PrimitiveSet>
19#include <osgUtil/Export>
24class OSGUTIL_EXPORT ReversePrimitiveFunctor : public osg::PrimitiveIndexFunctor
28 virtual ~ReversePrimitiveFunctor() {}
30 osg::PrimitiveSet * getReversedPrimitiveSet() { return _reversedPrimitiveSet.get(); }
32 virtual void setVertexArray(unsigned int , const osg::Vec2* ) {}
33 virtual void setVertexArray(unsigned int , const osg::Vec3* ) {}
34 virtual void setVertexArray(unsigned int , const osg::Vec4* ) {}
35 virtual void setVertexArray(unsigned int , const osg::Vec2d* ) {}
36 virtual void setVertexArray(unsigned int , const osg::Vec3d* ) {}
37 virtual void setVertexArray(unsigned int , const osg::Vec4d* ) {}
39 virtual void drawArrays(GLenum mode,GLint first,GLsizei count);
40 virtual void drawElements(GLenum mode,GLsizei count, const GLubyte* indices);
41 virtual void drawElements(GLenum mode,GLsizei count, const GLushort* indices);
42 virtual void drawElements(GLenum mode,GLsizei count, const GLuint* indices);
45 /// Mimics the OpenGL \c glBegin() function.
46 virtual void begin(GLenum mode);
47 virtual void vertex(unsigned int /*pos*/);
51 osg::ref_ptr<osg::PrimitiveSet> _reversedPrimitiveSet;
58} // end osgUtil namespace
60#endif // ** OSGUTIL_REVERSEFACEVISITOR ** //