OpenSceneGraph 3.6.5
VolumeSettings
Go to the documentation of this file.
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield
2 *
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.
7 *
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.
12*/
13
14#ifndef OSGVOLUMESETTINGS
15#define OSGVOLUMESETTINGS 1
16
17#include <osg/Object>
18#include <osgVolume/Property>
19
20namespace osgVolume {
21
23{
24 public:
25
27
30
32
33 virtual void accept(PropertyVisitor& pv);
34 virtual void traverse(PropertyVisitor& pv);
35
36 void setFilename(const std::string& str) { _filename = str; dirty(); }
37 const std::string& getFilename() const { return _filename; }
38
45
46 void setTechnique(Technique technique) { _technique = technique; dirty(); }
47 Technique getTechnique() const { return _technique; }
48
56
59
60 void setSampleRatio(float sr) { _sampleRatioProperty->setValue(sr); dirty(); }
61 float getSampleRatio() const { return _sampleRatioProperty->getValue(); }
62
64 float getSampleRatioWhenMoving() const { return _sampleRatioWhenMovingProperty->getValue(); }
65
66 void setCutoff(float co);
67 float getCutoff() const { return _cutoffProperty->getValue(); }
68
69 void setTransparency(float t) { _transparencyProperty->setValue(t); dirty(); }
70 float getTransparency() const { return _transparencyProperty->getValue(); }
71
72
75
78
80 const AlphaFuncProperty* getCutoffProperty() const { return _cutoffProperty.get(); }
81
84
87
88protected:
89
90 virtual ~VolumeSettings() {}
91
92 std::string _filename;
93
96
102};
103
104}
105
106#endif
The osgVolume library is a NodeKit that extends the core scene graph to support volume rendering.
Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clo...
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
Smart pointer for handling referenced counted objects.
Definition ref_ptr:32
Definition Property:46
void dirty()
Definition Property:85
Definition Property:261
Definition Property:278
Sample ratioto use when the volume is static relative to the eye point or when moving if no SampleRat...
Definition Property:377
Sample density to use when the volume is moving relative to the eye point.
Definition Property:395
Definition Property:413
std::string _filename
Definition VolumeSettings:92
ShadingModel _shadingModel
Definition VolumeSettings:95
void setSampleRatioWhenMoving(float sr)
Definition VolumeSettings:63
osg::ref_ptr< SampleRatioProperty > _sampleRatioProperty
Definition VolumeSettings:97
SampleRatioWhenMovingProperty * getSampleRatioWhenMovingProperty()
Definition VolumeSettings:76
TransparencyProperty * getTransparencyProperty()
Definition VolumeSettings:82
Technique _technique
Definition VolumeSettings:94
SampleRatioProperty * getSampleRatioProperty()
Definition VolumeSettings:73
const IsoSurfaceProperty * getIsoSurfaceProperty() const
Definition VolumeSettings:86
void setTransparency(float t)
Definition VolumeSettings:69
void setCutoff(float co)
const SampleRatioWhenMovingProperty * getSampleRatioWhenMovingProperty() const
Definition VolumeSettings:77
osg::ref_ptr< SampleRatioWhenMovingProperty > _sampleRatioWhenMovingProperty
Definition VolumeSettings:98
VolumeSettings(const VolumeSettings &, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
Copy constructor using CopyOp to manage deep vs shallow copy.
virtual ~VolumeSettings()
Definition VolumeSettings:90
IsoSurfaceProperty * getIsoSurfaceProperty()
Definition VolumeSettings:85
META_Object(osgVolume, VolumeSettings)
osg::ref_ptr< AlphaFuncProperty > _cutoffProperty
Definition VolumeSettings:99
void setTechnique(Technique technique)
Definition VolumeSettings:46
ShadingModel
Definition VolumeSettings:50
@ Isosurface
Definition VolumeSettings:53
@ MaximumIntensityProjection
Definition VolumeSettings:54
@ Standard
Definition VolumeSettings:51
@ Light
Definition VolumeSettings:52
float getCutoff() const
Definition VolumeSettings:67
virtual void traverse(PropertyVisitor &pv)
const SampleRatioProperty * getSampleRatioProperty() const
Definition VolumeSettings:74
AlphaFuncProperty * getCutoffProperty()
Definition VolumeSettings:79
float getTransparency() const
Definition VolumeSettings:70
Technique
Definition VolumeSettings:40
@ RayTraced
Definition VolumeSettings:42
@ MultiPass
Definition VolumeSettings:43
@ FixedFunction
Definition VolumeSettings:41
void setFilename(const std::string &str)
Definition VolumeSettings:36
Technique getTechnique() const
Definition VolumeSettings:47
const AlphaFuncProperty * getCutoffProperty() const
Definition VolumeSettings:80
virtual void accept(PropertyVisitor &pv)
float getSampleRatio() const
Definition VolumeSettings:61
void setShadingModel(ShadingModel sm)
Definition VolumeSettings:57
float getSampleRatioWhenMoving() const
Definition VolumeSettings:64
const std::string & getFilename() const
Definition VolumeSettings:37
osg::ref_ptr< IsoSurfaceProperty > _isoSurfaceProperty
Definition VolumeSettings:101
void setSampleRatio(float sr)
Definition VolumeSettings:60
ShadingModel getShadingModel() const
Definition VolumeSettings:58
const TransparencyProperty * getTransparencyProperty() const
Definition VolumeSettings:83
osg::ref_ptr< TransparencyProperty > _transparencyProperty
Definition VolumeSettings:100
#define OSGVOLUME_EXPORT
Definition Export:39

osg logo
Generated at Wed Jul 23 2025 00:00:00 for the OpenSceneGraph by doxygen 1.14.0.