Added SampleDensityWhenMovingProperty to control LOD property of osgVolume.
This commit is contained in:
@@ -35,6 +35,7 @@ class MaximumIntensityProjectionProperty;
|
||||
class LightingProperty;
|
||||
class AlphaFuncProperty;
|
||||
class SampleDensityProperty;
|
||||
class SampleDensityWhenMovingProperty;
|
||||
class TransparencyProperty;
|
||||
|
||||
class OSGVOLUME_EXPORT PropertyVisitor
|
||||
@@ -55,6 +56,7 @@ class OSGVOLUME_EXPORT PropertyVisitor
|
||||
virtual void apply(MaximumIntensityProjectionProperty&) {}
|
||||
virtual void apply(LightingProperty&) {}
|
||||
virtual void apply(SampleDensityProperty&) {}
|
||||
virtual void apply(SampleDensityWhenMovingProperty&) {}
|
||||
virtual void apply(TransparencyProperty&) {}
|
||||
|
||||
bool _traverseOnlyActiveChildren;
|
||||
@@ -289,6 +291,7 @@ class OSGVOLUME_EXPORT LightingProperty : public Property
|
||||
};
|
||||
|
||||
|
||||
/** Sample density to use when the volume is static relative to the eye point or when moving if no SampleDensityWhenMovingProperty is assigned.*/
|
||||
class OSGVOLUME_EXPORT SampleDensityProperty : public ScalarProperty
|
||||
{
|
||||
public:
|
||||
@@ -306,6 +309,24 @@ class OSGVOLUME_EXPORT SampleDensityProperty : public ScalarProperty
|
||||
virtual ~SampleDensityProperty() {}
|
||||
};
|
||||
|
||||
/** Sample density to use when the volume is moving relative to the eye point.*/
|
||||
class OSGVOLUME_EXPORT SampleDensityWhenMovingProperty : public ScalarProperty
|
||||
{
|
||||
public:
|
||||
|
||||
SampleDensityWhenMovingProperty(float value=1.0);
|
||||
|
||||
SampleDensityWhenMovingProperty(const SampleDensityWhenMovingProperty& isp,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
|
||||
|
||||
META_Object(osgVolume, SampleDensityWhenMovingProperty);
|
||||
|
||||
virtual void accept(PropertyVisitor& pv) { pv.apply(*this); }
|
||||
|
||||
protected:
|
||||
|
||||
virtual ~SampleDensityWhenMovingProperty() {}
|
||||
};
|
||||
|
||||
class OSGVOLUME_EXPORT TransparencyProperty : public ScalarProperty
|
||||
{
|
||||
public:
|
||||
@@ -338,6 +359,7 @@ class OSGVOLUME_EXPORT CollectPropertiesVisitor : public osgVolume::PropertyVisi
|
||||
virtual void apply(MaximumIntensityProjectionProperty& mip);
|
||||
virtual void apply(LightingProperty& lp);
|
||||
virtual void apply(SampleDensityProperty& sdp);
|
||||
virtual void apply(SampleDensityWhenMovingProperty& sdp);
|
||||
virtual void apply(TransparencyProperty& tp);
|
||||
|
||||
osg::ref_ptr<TransferFunctionProperty> _tfProperty;
|
||||
@@ -346,6 +368,7 @@ class OSGVOLUME_EXPORT CollectPropertiesVisitor : public osgVolume::PropertyVisi
|
||||
osg::ref_ptr<MaximumIntensityProjectionProperty> _mipProperty;
|
||||
osg::ref_ptr<LightingProperty> _lightingProperty;
|
||||
osg::ref_ptr<SampleDensityProperty> _sampleDensityProperty;
|
||||
osg::ref_ptr<SampleDensityWhenMovingProperty> _sampleDensityWhenMovingProperty;
|
||||
osg::ref_ptr<TransparencyProperty> _transparencyProperty;
|
||||
|
||||
};
|
||||
|
||||
@@ -52,7 +52,7 @@ class OSGVOLUME_EXPORT RayTracedTechnique : public VolumeTechnique
|
||||
OpenThreads::Mutex _mutex;
|
||||
ModelViewMatrixMap _modelViewMatrixMap;
|
||||
|
||||
osg::ref_ptr<osg::StateSet> _lodStateSet;
|
||||
osg::ref_ptr<osg::StateSet> _whenMovingStateSet;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user