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

Revision 13041, 1.4 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/Volume>
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 Volume_readLocalData(osg::Object &obj, osgDB::Input &fr);
17bool Volume_writeLocalData(const osg::Object &obj, osgDB::Output &fw);
18
19REGISTER_DOTOSGWRAPPER(Volume_Proxy)
20(
21    new osgVolume::Volume,
22    "Volume",
23    "Object Node Volume Group",
24    Volume_readLocalData,
25    Volume_writeLocalData
26);
27
28bool Volume_readLocalData(osg::Object& obj, osgDB::Input &fr)
29{
30    osgVolume::Volume& volume = static_cast<osgVolume::Volume&>(obj);
31
32    bool itrAdvanced = false;
33
34    osg::ref_ptr<osg::Object> readObject = fr.readObjectOfType(osgDB::type_wrapper<osgVolume::VolumeTechnique>());
35    if (readObject.valid())
36    {
37        volume.setVolumeTechniquePrototype(dynamic_cast<osgVolume::VolumeTechnique*>(readObject.get()));
38        itrAdvanced = true;
39    }
40
41    return itrAdvanced;
42}
43
44bool Volume_writeLocalData(const osg::Object& obj, osgDB::Output& fw)
45{
46    const osgVolume::Volume& volume = static_cast<const osgVolume::Volume&>(obj);
47
48    osg::notify(osg::NOTICE)<<"Volume write"<<std::endl;
49
50    if (volume.getVolumeTechniquePrototype())
51    {
52        fw.writeObject(*volume.getVolumeTechniquePrototype());
53    }
54
55    return true;
56}
Note: See TracBrowser for help on using the browser.