root/OpenSceneGraph/trunk/src/osgWrappers/deprecated-dotosg/osgVolume/ScalarProperty.cpp @ 13041

Revision 13041, 2.0 kB (checked in by robert, 2 years ago)

Ran script to remove trailing spaces and tabs

  • Property svn:eol-style set to native
Line 
1#include <osgVolume/Property>
2
3#include <iostream>
4#include <string>
5
6#include <osg/Vec3>
7#include <osg/Vec4>
8#include <osg/io_utils>
9
10#include <osgDB/ReadFile>
11#include <osgDB/Registry>
12#include <osgDB/Input>
13#include <osgDB/Output>
14#include <osgDB/ParameterOutput>
15
16bool ScalarProperty_readLocalData(osg::Object &obj, osgDB::Input &fr);
17bool ScalarProperty_writeLocalData(const osg::Object &obj, osgDB::Output &fw);
18
19REGISTER_DOTOSGWRAPPER(ScalarProperty_Proxy)
20(
21    0,
22    "ScalarProperty",
23    "Object ScalarProperty",
24    ScalarProperty_readLocalData,
25    ScalarProperty_writeLocalData
26);
27
28REGISTER_DOTOSGWRAPPER(IsoSurfaceProperty_Proxy)
29(
30    new osgVolume::IsoSurfaceProperty,
31    "IsoSurfaceProperty",
32    "Object ScalarProperty",
33    ScalarProperty_readLocalData,
34    ScalarProperty_writeLocalData
35);
36
37REGISTER_DOTOSGWRAPPER(AlphaFuncProperty_Proxy)
38(
39    new osgVolume::AlphaFuncProperty,
40    "AlphaFuncProperty",
41    "Object AlphaFuncProperty",
42    ScalarProperty_readLocalData,
43    ScalarProperty_writeLocalData
44);
45
46REGISTER_DOTOSGWRAPPER(SampleDensityProperty_Proxy)
47(
48    new osgVolume::SampleDensityProperty,
49    "SampleDensityProperty",
50    "Object SampleDensityProperty",
51    ScalarProperty_readLocalData,
52    ScalarProperty_writeLocalData
53);
54
55REGISTER_DOTOSGWRAPPER(TransparencyProperty_Proxy)
56(
57    new osgVolume::TransparencyProperty,
58    "TransparencyProperty",
59    "Object TransparencyProperty",
60    ScalarProperty_readLocalData,
61    ScalarProperty_writeLocalData
62);
63
64
65
66bool ScalarProperty_readLocalData(osg::Object& obj, osgDB::Input &fr)
67{
68    osgVolume::ScalarProperty& sp = static_cast<osgVolume::ScalarProperty&>(obj);
69
70    bool itrAdvanced = false;
71
72    float value=0;
73    if (fr.read("value",value))
74    {
75        itrAdvanced = true;
76        sp.setValue(value);
77    }
78
79    return itrAdvanced;
80}
81
82bool ScalarProperty_writeLocalData(const osg::Object& obj, osgDB::Output& fw)
83{
84    const osgVolume::ScalarProperty& sp = static_cast<const osgVolume::ScalarProperty&>(obj);
85
86    fw.indent()<<"value "<<sp.getValue()<<std::endl;
87
88    return true;
89}
Note: See TracBrowser for help on using the browser.