Files
OpenSceneGraph/include/osgUtil/TriStripVisitor
Robert Osfield 40fefcf335 Ported various demos and support classes over to use the new osg::Geometry class
thus removing dependancy on osg::Geoset from most of the OSG, only loaders
left to port now.
2002-06-26 10:28:17 +00:00

43 lines
1.1 KiB
Plaintext

//C++ header - Open Scene Graph - Copyright (C) 1998-2001 Robert Osfield
//Distributed under the terms of the GNU Library General Public License (LGPL)
//as published by the Free Software Foundation.
#ifndef OSGUTIL_TRISTRIPVISITOR
#define OSGUTIL_TRISTRIPVISITOR 1
#include <osg/NodeVisitor>
#include <osg/Geode>
#include <osg/Geometry>
#include <osgUtil/Export>
namespace osgUtil {
/** A tri stripping visitor for converting Geometry surface primitives into tri strips.
* The current implemention is based up NVidia's NvTriStrip.
*/
class OSGUTIL_EXPORT TriStripVisitor : public osg::NodeVisitor
{
public:
/// default to traversing all children.
TriStripVisitor()
{
setTraversalMode(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN);
}
/** convert mesh primitives in Geometry into Tri Strips using
* NvTriStrip. Converts all primitive types except points
* and lines, linestrips which it leaves unchanged.
*/
static void stripify(osg::Geometry& drawable);
/// apply stripify method to all geode geometry.
virtual void apply(osg::Geode& geode);
};
}
#endif