Refactor VolumeSettings so that it's subclassed from osgVolume::Property

git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14348 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield
2014-07-03 10:01:46 +00:00
parent c4f199d1b5
commit 3c6a1ec117
2 changed files with 37 additions and 23 deletions

View File

@@ -18,20 +18,28 @@ using namespace osgVolume;
VolumeSettings::VolumeSettings():
_technique(MultiPass),
_shadingModel(Standard),
_sampleRatio(1.0f),
_sampleRatioWhenMoving(1.0f),
_cutoff(0.0f),
_transparency(1.0f)
_sampleRatioProperty(new SampleRatioProperty(1.0f)),
_sampleRatioWhenMovingProperty(new SampleRatioWhenMovingProperty(1.0f)),
_cutoffProperty(new AlphaFuncProperty(0.0f)),
_transparencyProperty(new TransparencyProperty(1.0f))
{
}
VolumeSettings::VolumeSettings(const VolumeSettings& vs,const osg::CopyOp& copyop):
osg::Object(vs, copyop),
Property(vs, copyop),
_technique(vs._technique),
_shadingModel(vs._shadingModel),
_sampleRatio(vs._sampleRatio),
_sampleRatioWhenMoving(vs._sampleRatioWhenMoving),
_cutoff(vs._cutoff),
_transparency(vs._transparency)
_sampleRatioProperty(osg::clone(vs._sampleRatioProperty.get(), copyop)),
_sampleRatioWhenMovingProperty(osg::clone(vs._sampleRatioWhenMovingProperty.get(), copyop)),
_cutoffProperty(osg::clone(vs._cutoffProperty.get(), copyop)),
_transparencyProperty(osg::clone(vs._transparencyProperty.get(), copyop))
{
}
void VolumeSettings::accept(PropertyVisitor& pv)
{
_sampleRatioProperty->accept(pv);
_sampleRatioWhenMovingProperty->accept(pv);
_cutoffProperty->accept(pv);
_transparencyProperty->accept(pv);
}