1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 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 OSGVOLUMESETTINGS
15#define OSGVOLUMESETTINGS 1
18#include <osgVolume/Property>
22class OSGVOLUME_EXPORT VolumeSettings : public Property
28 /** Copy constructor using CopyOp to manage deep vs shallow copy.*/
29 VolumeSettings(const VolumeSettings&,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
31 META_Object(osgVolume, VolumeSettings);
33 virtual void accept(PropertyVisitor& pv);
34 virtual void traverse(PropertyVisitor& pv);
36 void setFilename(const std::string& str) { _filename = str; dirty(); }
37 const std::string& getFilename() const { return _filename; }
46 void setTechnique(Technique technique) { _technique = technique; dirty(); }
47 Technique getTechnique() const { return _technique; }
54 MaximumIntensityProjection
57 void setShadingModel(ShadingModel sm) { _shadingModel = sm; dirty(); }
58 ShadingModel getShadingModel() const { return _shadingModel; }
60 void setSampleRatio(float sr) { _sampleRatioProperty->setValue(sr); dirty(); }
61 float getSampleRatio() const { return _sampleRatioProperty->getValue(); }
63 void setSampleRatioWhenMoving(float sr) { _sampleRatioWhenMovingProperty->setValue(sr); dirty(); }
64 float getSampleRatioWhenMoving() const { return _sampleRatioWhenMovingProperty->getValue(); }
66 void setCutoff(float co);
67 float getCutoff() const { return _cutoffProperty->getValue(); }
69 void setTransparency(float t) { _transparencyProperty->setValue(t); dirty(); }
70 float getTransparency() const { return _transparencyProperty->getValue(); }
73 SampleRatioProperty* getSampleRatioProperty() { return _sampleRatioProperty.get(); }
74 const SampleRatioProperty* getSampleRatioProperty() const { return _sampleRatioProperty.get(); }
76 SampleRatioWhenMovingProperty* getSampleRatioWhenMovingProperty() { return _sampleRatioWhenMovingProperty.get(); }
77 const SampleRatioWhenMovingProperty* getSampleRatioWhenMovingProperty() const { return _sampleRatioWhenMovingProperty.get(); }
79 AlphaFuncProperty* getCutoffProperty() { return _cutoffProperty.get(); }
80 const AlphaFuncProperty* getCutoffProperty() const { return _cutoffProperty.get(); }
82 TransparencyProperty* getTransparencyProperty() { return _transparencyProperty.get(); }
83 const TransparencyProperty* getTransparencyProperty() const { return _transparencyProperty.get(); }
85 IsoSurfaceProperty* getIsoSurfaceProperty() { return _isoSurfaceProperty.get(); }
86 const IsoSurfaceProperty* getIsoSurfaceProperty() const { return _isoSurfaceProperty.get(); }
90 virtual ~VolumeSettings() {}
92 std::string _filename;
95 ShadingModel _shadingModel;
97 osg::ref_ptr<SampleRatioProperty> _sampleRatioProperty;
98 osg::ref_ptr<SampleRatioWhenMovingProperty> _sampleRatioWhenMovingProperty;
99 osg::ref_ptr<AlphaFuncProperty> _cutoffProperty;
100 osg::ref_ptr<TransparencyProperty> _transparencyProperty;
101 osg::ref_ptr<IsoSurfaceProperty> _isoSurfaceProperty;