VolumeSettings
Go to the documentation of this file.
/* -*-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();
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);
void setFilename(const std::string& str) { _filename = str; dirty(); }
const std::string& getFilename() const { return _filename; }
enum Technique
{
FixedFunction,
RayTraced,
MultiPass
};
void setTechnique(Technique technique) { _technique = technique; dirty(); }
Technique getTechnique() const { return _technique; }
enum ShadingModel
{
Standard,
Light,
Isosurface,
MaximumIntensityProjection
};
void setShadingModel(ShadingModel sm) { _shadingModel = sm; dirty(); }
ShadingModel getShadingModel() const { return _shadingModel; }
void setSampleRatio(float sr) { _sampleRatioProperty->setValue(sr); dirty(); }
float getSampleRatio() const { return _sampleRatioProperty->getValue(); }
void setSampleRatioWhenMoving(float sr) { _sampleRatioWhenMovingProperty->setValue(sr); dirty(); }
float getSampleRatioWhenMoving() const { return _sampleRatioWhenMovingProperty->getValue(); }
void setCutoff(float co);
float getCutoff() const { return _cutoffProperty->getValue(); }
void setTransparency(float t) { _transparencyProperty->setValue(t); dirty(); }
float getTransparency() const { return _transparencyProperty->getValue(); }
SampleRatioProperty* getSampleRatioProperty() { return _sampleRatioProperty.get(); }
const SampleRatioProperty* getSampleRatioProperty() const { return _sampleRatioProperty.get(); }
SampleRatioWhenMovingProperty* getSampleRatioWhenMovingProperty() { return _sampleRatioWhenMovingProperty.get(); }
const SampleRatioWhenMovingProperty* getSampleRatioWhenMovingProperty() const { return _sampleRatioWhenMovingProperty.get(); }
AlphaFuncProperty* getCutoffProperty() { return _cutoffProperty.get(); }
const AlphaFuncProperty* getCutoffProperty() const { return _cutoffProperty.get(); }
TransparencyProperty* getTransparencyProperty() { return _transparencyProperty.get(); }
const TransparencyProperty* getTransparencyProperty() const { return _transparencyProperty.get(); }
IsoSurfaceProperty* getIsoSurfaceProperty() { return _isoSurfaceProperty.get(); }
const IsoSurfaceProperty* getIsoSurfaceProperty() const { return _isoSurfaceProperty.get(); }
protected:
virtual ~VolumeSettings() {}
std::string _filename;
Technique _technique;
ShadingModel _shadingModel;
osg::ref_ptr<SampleRatioProperty> _sampleRatioProperty;
osg::ref_ptr<SampleRatioWhenMovingProperty> _sampleRatioWhenMovingProperty;
osg::ref_ptr<AlphaFuncProperty> _cutoffProperty;
osg::ref_ptr<TransparencyProperty> _transparencyProperty;
osg::ref_ptr<IsoSurfaceProperty> _isoSurfaceProperty;
};
}
#endif
Object
Property
osgVolume::AlphaFuncProperty
Definition Property:278
osgVolume::IsoSurfaceProperty
Definition Property:261
osgVolume::PropertyVisitor
Definition Property:46
osgVolume::Property::Property
Property()
osgVolume::Property::dirty
void dirty()
Definition Property:85
osgVolume::SampleRatioProperty
Definition Property:377
osgVolume::SampleRatioWhenMovingProperty
Definition Property:395
osgVolume::TransparencyProperty
Definition Property:413
osgVolume::VolumeSettings::VolumeSettings
VolumeSettings()
osgVolume::VolumeSettings::_filename
std::string _filename
Definition VolumeSettings:92
osgVolume::VolumeSettings::_shadingModel
ShadingModel _shadingModel
Definition VolumeSettings:95
osgVolume::VolumeSettings::setSampleRatioWhenMoving
void setSampleRatioWhenMoving(float sr)
Definition VolumeSettings:63
osgVolume::VolumeSettings::_sampleRatioProperty
osg::ref_ptr< SampleRatioProperty > _sampleRatioProperty
Definition VolumeSettings:97
osgVolume::VolumeSettings::getSampleRatioWhenMovingProperty
SampleRatioWhenMovingProperty * getSampleRatioWhenMovingProperty()
Definition VolumeSettings:76
osgVolume::VolumeSettings::getTransparencyProperty
TransparencyProperty * getTransparencyProperty()
Definition VolumeSettings:82
osgVolume::VolumeSettings::_technique
Technique _technique
Definition VolumeSettings:94
osgVolume::VolumeSettings::getSampleRatioProperty
SampleRatioProperty * getSampleRatioProperty()
Definition VolumeSettings:73
osgVolume::VolumeSettings::getIsoSurfaceProperty
const IsoSurfaceProperty * getIsoSurfaceProperty() const
Definition VolumeSettings:86
osgVolume::VolumeSettings::setTransparency
void setTransparency(float t)
Definition VolumeSettings:69
osgVolume::VolumeSettings::setCutoff
void setCutoff(float co)
osgVolume::VolumeSettings::getSampleRatioWhenMovingProperty
const SampleRatioWhenMovingProperty * getSampleRatioWhenMovingProperty() const
Definition VolumeSettings:77
osgVolume::VolumeSettings::_sampleRatioWhenMovingProperty
osg::ref_ptr< SampleRatioWhenMovingProperty > _sampleRatioWhenMovingProperty
Definition VolumeSettings:98
osgVolume::VolumeSettings::VolumeSettings
VolumeSettings(const VolumeSettings &, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
osgVolume::VolumeSettings::~VolumeSettings
virtual ~VolumeSettings()
Definition VolumeSettings:90
osgVolume::VolumeSettings::getIsoSurfaceProperty
IsoSurfaceProperty * getIsoSurfaceProperty()
Definition VolumeSettings:85
osgVolume::VolumeSettings::META_Object
META_Object(osgVolume, VolumeSettings)
osgVolume::VolumeSettings::_cutoffProperty
osg::ref_ptr< AlphaFuncProperty > _cutoffProperty
Definition VolumeSettings:99
osgVolume::VolumeSettings::setTechnique
void setTechnique(Technique technique)
Definition VolumeSettings:46
osgVolume::VolumeSettings::ShadingModel
ShadingModel
Definition VolumeSettings:50
osgVolume::VolumeSettings::Isosurface
@ Isosurface
Definition VolumeSettings:53
osgVolume::VolumeSettings::MaximumIntensityProjection
@ MaximumIntensityProjection
Definition VolumeSettings:54
osgVolume::VolumeSettings::Standard
@ Standard
Definition VolumeSettings:51
osgVolume::VolumeSettings::Light
@ Light
Definition VolumeSettings:52
osgVolume::VolumeSettings::getCutoff
float getCutoff() const
Definition VolumeSettings:67
osgVolume::VolumeSettings::traverse
virtual void traverse(PropertyVisitor &pv)
osgVolume::VolumeSettings::getSampleRatioProperty
const SampleRatioProperty * getSampleRatioProperty() const
Definition VolumeSettings:74
osgVolume::VolumeSettings::getCutoffProperty
AlphaFuncProperty * getCutoffProperty()
Definition VolumeSettings:79
osgVolume::VolumeSettings::getTransparency
float getTransparency() const
Definition VolumeSettings:70
osgVolume::VolumeSettings::Technique
Technique
Definition VolumeSettings:40
osgVolume::VolumeSettings::RayTraced
@ RayTraced
Definition VolumeSettings:42
osgVolume::VolumeSettings::MultiPass
@ MultiPass
Definition VolumeSettings:43
osgVolume::VolumeSettings::FixedFunction
@ FixedFunction
Definition VolumeSettings:41
osgVolume::VolumeSettings::setFilename
void setFilename(const std::string &str)
Definition VolumeSettings:36
osgVolume::VolumeSettings::getTechnique
Technique getTechnique() const
Definition VolumeSettings:47
osgVolume::VolumeSettings::getCutoffProperty
const AlphaFuncProperty * getCutoffProperty() const
Definition VolumeSettings:80
osgVolume::VolumeSettings::accept
virtual void accept(PropertyVisitor &pv)
osgVolume::VolumeSettings::getSampleRatio
float getSampleRatio() const
Definition VolumeSettings:61
osgVolume::VolumeSettings::setShadingModel
void setShadingModel(ShadingModel sm)
Definition VolumeSettings:57
osgVolume::VolumeSettings::getSampleRatioWhenMoving
float getSampleRatioWhenMoving() const
Definition VolumeSettings:64
osgVolume::VolumeSettings::getFilename
const std::string & getFilename() const
Definition VolumeSettings:37
osgVolume::VolumeSettings::_isoSurfaceProperty
osg::ref_ptr< IsoSurfaceProperty > _isoSurfaceProperty
Definition VolumeSettings:101
osgVolume::VolumeSettings::setSampleRatio
void setSampleRatio(float sr)
Definition VolumeSettings:60
osgVolume::VolumeSettings::getShadingModel
ShadingModel getShadingModel() const
Definition VolumeSettings:58
osgVolume::VolumeSettings::getTransparencyProperty
const TransparencyProperty * getTransparencyProperty() const
Definition VolumeSettings:83
osgVolume::VolumeSettings::_transparencyProperty
osg::ref_ptr< TransparencyProperty > _transparencyProperty
Definition VolumeSettings:100
osg::CopyOp
Definition CopyOp:41
osg::CopyOp::SHALLOW_COPY
@ SHALLOW_COPY
Definition CopyOp:47
osg::ref_ptr
Definition ref_ptr:32
osgVolume
OSGVOLUME_EXPORT
#define OSGVOLUME_EXPORT
Definition osgVolume/Export:39