OpenSceneGraph/include/osgVolume/VolumeSettings

89 lines
3.2 KiB
Plaintext
Raw Normal View History

/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#ifndef OSGVOLUMESETTINGS
#define OSGVOLUMESETTINGS 1
#include <osg/Object>
#include <osgVolume/Property>
namespace osgVolume {
class OSGVOLUME_EXPORT VolumeSettings : public Property
{
public:
VolumeSettings();
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
VolumeSettings(const VolumeSettings&,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
META_Object(osgVolume, VolumeSettings);
virtual void accept(PropertyVisitor& pv);
virtual void traverse(PropertyVisitor& pv);
enum Technique
{
FixedFunction,
RayTraced,
MultiPass
};
void setTechnique(Technique technique) { _technique = technique; }
Technique getTechnique() const { return _technique; }
enum ShadingModel
{
Standard,
Light,
Isosurface,
MaximumIntensityProjection
};
void setShadingModel(ShadingModel sm) { _shadingModel = sm; }
ShadingModel getShadingModel() const { return _shadingModel; }
void setSampleRatio(float sr) { _sampleRatioProperty->setValue(sr); }
float getSampleRatio() const { return _sampleRatioProperty->getValue(); }
SampleRatioProperty* getSampleRatioProperty() const { return _sampleRatioProperty.get(); }
void setSampleRatioWhenMoving(float sr) { _sampleRatioWhenMovingProperty->setValue(sr); }
float getSampleRatioWhenMoving() const { return _sampleRatioWhenMovingProperty->getValue(); }
SampleRatioWhenMovingProperty* getSampleRatioWhenMovingProperty() const { return _sampleRatioWhenMovingProperty.get(); }
void setCutoff(float co) { _cutoffProperty->setValue(co); }
float getCutoff() const { return _cutoffProperty->getValue(); }
AlphaFuncProperty* getCutoffProperty() const { return _cutoffProperty.get(); }
void setTransparency(float t) { _transparencyProperty->setValue(t); }
float getTransparency() const { return _transparencyProperty->getValue(); }
TransparencyProperty* getTransparencyProperty() const { return _transparencyProperty.get(); }
protected:
virtual ~VolumeSettings() {}
Technique _technique;
ShadingModel _shadingModel;
osg::ref_ptr<SampleRatioProperty> _sampleRatioProperty;
osg::ref_ptr<SampleRatioWhenMovingProperty> _sampleRatioWhenMovingProperty;
osg::ref_ptr<AlphaFuncProperty> _cutoffProperty;
osg::ref_ptr<TransparencyProperty> _transparencyProperty;
};
}
#endif