14#ifndef OSGVOLUME_PROPERTY
15#define OSGVOLUME_PROPERTY 1
29class CompositeProperty;
31class TransferFunctionProperty;
33class IsoSurfaceProperty;
34class MaximumIntensityProjectionProperty;
35class LightingProperty;
36class AlphaFuncProperty;
37class SampleRatioProperty;
38class SampleRatioWhenMovingProperty;
39class SampleDensityProperty;
40class SampleDensityWhenMovingProperty;
41class TransparencyProperty;
42class ExteriorTransparencyFactorProperty;
85 void dirty() { ++_modifiedCount; }
115 for(Properties::iterator itr = _properties.begin();
116 itr != _properties.end();
127 void setProperty(
unsigned int i,
Property* property) {
if (i>=_properties.size()) _properties.resize(i+1); _properties[i] = property; }
133 const Property*
getProperty(
unsigned int i)
const {
return i<_properties.size() ? _properties[i].get() : 0; }
139 void removeProperty(
unsigned int i) { _properties.erase(_properties.begin()+i); }
169 if (_activeProperty>=0 &&
static_cast<unsigned int>(_activeProperty)<=getNumProperties())
171 _properties[_activeProperty]->accept(pv);
176 CompositeProperty::traverse(pv);
239 virtual void setValue(
float v) { _uniform->set(v); dirty(); }
242 float getValue()
const {
float v; _uniform->get(v);
return v; }
Definition EventHandler:34
virtual EventHandler * asEventHandler()
Definition EventHandler:52
Definition GUIActionAdapter:62
Definition GUIEventAdapter:82
Definition GUIEventHandler:50
virtual ~AlphaFuncProperty()
Definition Property:298
virtual void accept(PropertyVisitor &pv)
Definition Property:287
virtual void setValue(float v)
AlphaFuncProperty(const AlphaFuncProperty &isp, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY)
META_Object(osgVolume, AlphaFuncProperty)
const osg::AlphaFunc * getAlphaFunc() const
Definition Property:293
osg::ref_ptr< osg::AlphaFunc > _alphaFunc
Definition Property:300
osg::AlphaFunc * getAlphaFunc()
Definition Property:291
AlphaFuncProperty(float value=1.0f)
CollectPropertiesVisitor(bool traverseOnlyActiveChildren=true)
osg::ref_ptr< AlphaFuncProperty > _afProperty
Definition Property:468
osg::ref_ptr< SampleRatioProperty > _sampleRatioProperty
Definition Property:473
virtual void apply(SampleRatioProperty &sdp)
osg::ref_ptr< ExteriorTransparencyFactorProperty > _exteriorTransparencyFactorProperty
Definition Property:476
osg::ref_ptr< TransferFunctionProperty > _tfProperty
Definition Property:466
virtual void apply(ExteriorTransparencyFactorProperty &tp)
virtual void apply(ScalarProperty &)
virtual void apply(IsoSurfaceProperty &iso)
osg::ref_ptr< SampleRatioWhenMovingProperty > _sampleRatioWhenMovingProperty
Definition Property:474
osg::ref_ptr< SampleDensityWhenMovingProperty > _sampleDensityWhenMovingProperty
Definition Property:472
virtual void apply(SampleRatioWhenMovingProperty &sdp)
virtual void apply(SampleDensityWhenMovingProperty &sdp)
osg::ref_ptr< IsoSurfaceProperty > _isoProperty
Definition Property:467
osg::ref_ptr< SampleDensityProperty > _sampleDensityProperty
Definition Property:471
virtual void apply(TransferFunctionProperty &)
osg::ref_ptr< TransparencyProperty > _transparencyProperty
Definition Property:475
osg::ref_ptr< MaximumIntensityProjectionProperty > _mipProperty
Definition Property:469
virtual void apply(AlphaFuncProperty &af)
virtual void apply(TransparencyProperty &tp)
virtual void apply(LightingProperty &lp)
virtual void apply(MaximumIntensityProjectionProperty &mip)
osg::ref_ptr< LightingProperty > _lightingProperty
Definition Property:470
virtual void apply(SampleDensityProperty &sdp)
virtual void accept(PropertyVisitor &pv)
Definition Property:111
void addProperty(const osg::ref_ptr< T > &p)
Definition Property:137
unsigned int getNumProperties() const
Definition Property:141
void removeProperty(unsigned int i)
Definition Property:139
Properties _properties
Definition Property:148
CompositeProperty(const CompositeProperty &compositeProperty, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY)
Property * getProperty(unsigned int i)
Definition Property:131
void addProperty(Property *property)
Definition Property:135
virtual ~CompositeProperty()
Definition Property:145
META_Object(osgVolume, CompositeProperty)
const Property * getProperty(unsigned int i) const
Definition Property:133
virtual void traverse(PropertyVisitor &pv)
Definition Property:113
void setProperty(unsigned int i, Property *property)
Definition Property:127
std::vector< osg::ref_ptr< Property > > Properties
Definition Property:125
void setProperty(unsigned int i, const osg::ref_ptr< T > &p)
Definition Property:129
virtual void accept(PropertyVisitor &pv)
Definition Property:439
ExteriorTransparencyFactorProperty(const ExteriorTransparencyFactorProperty &isp, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY)
virtual ~ExteriorTransparencyFactorProperty()
Definition Property:443
ExteriorTransparencyFactorProperty(float value=0.0f)
META_Object(osgVolume, ExteriorTransparencyFactorProperty)
META_Object(osgVolume, IsoSurfaceProperty)
IsoSurfaceProperty(const IsoSurfaceProperty &isp, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY)
IsoSurfaceProperty(float value=1.0f)
virtual ~IsoSurfaceProperty()
Definition Property:274
virtual void accept(PropertyVisitor &pv)
Definition Property:270
virtual void accept(PropertyVisitor &pv)
Definition Property:331
META_Object(osgVolume, LightingProperty)
virtual ~LightingProperty()
Definition Property:335
LightingProperty(const LightingProperty &mipp, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY)
MaximumIntensityProjectionProperty(const MaximumIntensityProjectionProperty &mipp, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY)
virtual void accept(PropertyVisitor &pv)
Definition Property:313
virtual ~MaximumIntensityProjectionProperty()
Definition Property:317
MaximumIntensityProjectionProperty()
META_Object(osgVolume, MaximumIntensityProjectionProperty)
virtual const osgGA::EventHandler * asEventHandler() const
Definition Property:497
void setKeyEventActivatesSampleDensityAdjustment(int key)
Definition Property:513
int getKeyEventActivatesAlphaFuncAdjustment() const
Definition Property:517
PropertyAdjustmentCallback()
int _sampleDensityKey
Definition Property:526
int _exteriorTransparencyFactorKey
Definition Property:524
int getKeyEventActivatesSampleDensityAdjustment() const
Definition Property:514
bool _updateTransparency
Definition Property:528
void setKeyEventActivatesAlphaFuncAdjustment(int key)
Definition Property:516
bool _updateAlphaCutOff
Definition Property:530
int _cyleBackwardKey
Definition Property:522
void setKeyEventActivatesTransparencyAdjustment(int key)
Definition Property:507
META_Object(osgVolume, PropertyAdjustmentCallback)
virtual osgGA::EventHandler * asEventHandler()
Definition Property:496
int getKeyEventCycleForward() const
Definition Property:502
virtual DrawableEventCallback * asDrawableEventCallback()
Definition Property:493
int getKeyEventActivatesTransparencyAdjustment() const
Definition Property:508
int _cyleForwardKey
Definition Property:521
int getKeyEventActivatesExteriorTransparencyFactorAdjustment() const
Definition Property:511
void setKeyEventCycleBackward(int key)
Definition Property:504
int getKeyEventCycleBackward() const
Definition Property:505
PropertyAdjustmentCallback(const PropertyAdjustmentCallback &, const osg::CopyOp &)
virtual const DrawableEventCallback * asDrawableEventCallback() const
Definition Property:494
virtual const NodeCallback * asNodeCallback() const
Definition Property:491
virtual bool run(osg::Object *object, osg::Object *data)
Definition Property:499
virtual bool handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &, osg::Object *object, osg::NodeVisitor *)
bool _updateExteriorTransparencyFactor
Definition Property:529
int _transparencyKey
Definition Property:523
void setKeyEventCycleForward(int key)
Definition Property:501
virtual NodeCallback * asNodeCallback()
Definition Property:490
void setKeyEventActivatesExteriorTransparencyFactorAdjustment(int key)
Definition Property:510
bool _updateSampleDensity
Definition Property:531
int _alphaFuncKey
Definition Property:525
virtual void apply(AlphaFuncProperty &)
virtual void apply(SampleDensityWhenMovingProperty &)
virtual void apply(ScalarProperty &)
virtual void apply(TransparencyProperty &)
virtual void apply(IsoSurfaceProperty &)
virtual void apply(CompositeProperty &)
virtual void apply(MaximumIntensityProjectionProperty &)
PropertyVisitor(bool traverseOnlyActiveChildren=true)
virtual void apply(SampleRatioWhenMovingProperty &)
virtual void apply(ExteriorTransparencyFactorProperty &)
virtual void apply(SwitchProperty &)
virtual void apply(VolumeSettings &)
virtual void apply(SampleDensityProperty &)
virtual void apply(TransferFunctionProperty &)
bool _traverseOnlyActiveChildren
Definition Property:70
virtual void apply(SampleRatioProperty &)
virtual void apply(Property &)
virtual void apply(LightingProperty &)
virtual ~PropertyVisitor()
Definition Property:51
META_Object(osgVolume, Property)
void setModifiedCount(unsigned int c)
Definition Property:87
Property(const Property &, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY)
virtual void accept(PropertyVisitor &pv)
Definition Property:90
void dirty()
Definition Property:85
unsigned int _modifiedCount
Definition Property:97
virtual void traverse(PropertyVisitor &)
Definition Property:91
unsigned int getModifiedCount() const
Definition Property:88
META_Object(osgVolume, SampleDensityProperty)
SampleDensityProperty(float value=1.0f)
SampleDensityProperty(const SampleDensityProperty &isp, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY)
virtual ~SampleDensityProperty()
Definition Property:354
virtual void accept(PropertyVisitor &pv)
Definition Property:350
virtual ~SampleDensityWhenMovingProperty()
Definition Property:372
SampleDensityWhenMovingProperty(const SampleDensityWhenMovingProperty &isp, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY)
virtual void accept(PropertyVisitor &pv)
Definition Property:368
META_Object(osgVolume, SampleDensityWhenMovingProperty)
SampleDensityWhenMovingProperty(float value=1.0f)
virtual ~SampleRatioProperty()
Definition Property:390
META_Object(osgVolume, SampleRatioProperty)
SampleRatioProperty(const SampleRatioProperty &isp, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY)
SampleRatioProperty(float value=1.0f)
virtual void accept(PropertyVisitor &pv)
Definition Property:386
META_Object(osgVolume, SampleRatioWhenMovingProperty)
SampleRatioWhenMovingProperty(float value=1.0f)
virtual void accept(PropertyVisitor &pv)
Definition Property:404
virtual ~SampleRatioWhenMovingProperty()
Definition Property:408
SampleRatioWhenMovingProperty(const SampleRatioWhenMovingProperty &isp, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY)
virtual ~ScalarProperty()
Definition Property:252
ScalarProperty(const ScalarProperty &scalarProperty, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY)
ScalarProperty(const std::string &scaleName, float value)
osg::ref_ptr< osg::Uniform > _uniform
Definition Property:256
const osg::Uniform * getUniform() const
Definition Property:248
virtual void setValue(float v)
Definition Property:239
osg::Uniform * getUniform()
Definition Property:245
float getValue() const
Definition Property:242
virtual void accept(PropertyVisitor &pv)
Definition Property:236
META_Object(osgVolume, ScalarProperty)
META_Object(osgVolume, SwitchProperty)
SwitchProperty(const SwitchProperty &switchProperty, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY)
virtual ~SwitchProperty()
Definition Property:190
void setActiveProperty(int i)
Definition Property:183
virtual void traverse(PropertyVisitor &pv)
Definition Property:165
virtual void accept(PropertyVisitor &pv)
Definition Property:163
int _activeProperty
Definition Property:192
int getActiveProperty() const
Definition Property:186
META_Object(osgVolume, TransferFunctionProperty)
osg::ref_ptr< osg::TransferFunction > _tf
Definition Property:221
osg::TransferFunction * getTransferFunction()
Definition Property:212
const osg::TransferFunction * getTransferFunction() const
Definition Property:215
virtual ~TransferFunctionProperty()
Definition Property:219
void setTransferFunction(osg::TransferFunction *tf)
Definition Property:209
virtual void accept(PropertyVisitor &pv)
Definition Property:206
TransferFunctionProperty(const TransferFunctionProperty &tfp, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY)
TransferFunctionProperty(osg::TransferFunction *tf=0)
virtual ~TransparencyProperty()
Definition Property:426
TransparencyProperty(float value=1.0f)
META_Object(osgVolume, TransparencyProperty)
TransparencyProperty(const TransparencyProperty &isp, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY)
virtual void accept(PropertyVisitor &pv)
Definition Property:422
Definition VolumeSettings:23
virtual bool run(osg::Object *object, osg::Object *data)
Definition Callback:80
@ SHALLOW_COPY
Definition CopyOp:47
virtual DrawableEventCallback * asDrawableEventCallback()
Definition Callback:330
virtual NodeCallback * asNodeCallback()
Definition Callback:227
Definition NodeVisitor:82
Definition TransferFunction:31
T * get() const
Definition ref_ptr:117
#define OSGVOLUME_EXPORT
Definition osgVolume/Export:39