14#ifndef OSGUTIL_SIMPLIFIER
15#define OSGUTIL_SIMPLIFIER 1
31 Simplifier(
double sampleRatio=1.0,
double maximumError=FLT_MAX,
double maximumLength=0.0);
35 void setSampleRatio(
float sampleRatio) {
_sampleRatio = sampleRatio; }
77 bool continueSimplification(
float nextError,
unsigned int numOriginalPrimitives,
unsigned int numRemainingPrimitives)
const
The osgUtil library provides general purpose utility classes such as update, cull and draw traverses,...
Definition NodeVisitor:25
Visitor for type safe operations on osg::Nodes.
Definition NodeVisitor:82
Smart pointer for handling referenced counted objects.
Definition ref_ptr:32
Base class for providing reference counted objects.
Definition Referenced:44
void simplify(osg::Geometry &geometry, const IndexList &protectedPoints)
a list of point indices
ContinueSimplificationCallback * getContinueSimplificationCallback()
Definition Simplifier:73
bool getSmoothing() const
Definition Simplifier:52
double _maximumError
Definition Simplifier:117
void setDoTriStrip(bool on)
Definition Simplifier:48
double _maximumLength
Definition Simplifier:118
float getSampleRatio() const
Definition Simplifier:36
META_NodeVisitor(osgUtil, Simplifier) void setSampleRatio(float sampleRatio)
Definition Simplifier:33
float getMaximumLength() const
Definition Simplifier:46
void setMaximumLength(float length)
Set the maximum length target that all edges must be shorted than.
Definition Simplifier:45
bool _triStrip
Definition Simplifier:119
void setSmoothing(bool on)
Definition Simplifier:51
virtual bool continueSimplificationImplementation(float nextError, unsigned int numOriginalPrimitives, unsigned int numRemainingPrimitives) const
Definition Simplifier:83
const ContinueSimplificationCallback * getContinueSimplificationCallback() const
Definition Simplifier:74
bool continueSimplification(float nextError, unsigned int numOriginalPrimitives, unsigned int numRemainingPrimitives) const
Definition Simplifier:77
bool getDoTriStrip() const
Definition Simplifier:49
void simplify(osg::Geometry &geometry)
simply the geometry.
std::vector< unsigned int > IndexList
Definition Simplifier:108
void setMaximumError(float error)
Set the maximum point error that all point removals must be less than to permit removal of a point.
Definition Simplifier:40
bool requiresDownSampling() const
Definition Simplifier:89
virtual bool requiresDownSamplingImplementation() const
Definition Simplifier:95
osg::ref_ptr< ContinueSimplificationCallback > _continueSimplificationCallback
Definition Simplifier:122
float getMaximumError() const
Definition Simplifier:41
bool _smoothing
Definition Simplifier:120
double _sampleRatio
Definition Simplifier:116
virtual void apply(osg::Geometry &geom)
Definition Simplifier:100
void setContinueSimplificationCallback(ContinueSimplificationCallback *cb)
Definition Simplifier:72
Simplifier(double sampleRatio=1.0, double maximumError=FLT_MAX, double maximumLength=0.0)
virtual bool continueSimplification(const Simplifier &simplifier, float nextError, unsigned int numOriginalPrimitives, unsigned int numRemainingPrimitives) const
return true if mesh should be continued to be simplified, return false to stop simplification.
Definition Simplifier:58
virtual bool requiresDownSampling(const Simplifier &simplifier) const
Definition Simplifier:63
virtual ~ContinueSimplificationCallback()
Definition Simplifier:69
#define OSGUTIL_EXPORT
Definition Export:40