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

Revision 13041, 1.5 kB (checked in by robert, 3 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 CompositeProperty_readLocalData(osg::Object &obj, osgDB::Input &fr);
17bool CompositeProperty_writeLocalData(const osg::Object &obj, osgDB::Output &fw);
18
19REGISTER_DOTOSGWRAPPER(CompositeProperty_Proxy)
20(
21    new osgVolume::CompositeProperty,
22    "CompositeProperty",
23    "Object CompositeProperty",
24    CompositeProperty_readLocalData,
25    CompositeProperty_writeLocalData
26);
27
28
29bool CompositeProperty_readLocalData(osg::Object& obj, osgDB::Input &fr)
30{
31    osgVolume::CompositeProperty& cp = static_cast<osgVolume::CompositeProperty&>(obj);
32
33    bool itrAdvanced = false;
34
35    osg::ref_ptr<osg::Object> readObject;
36    do
37    {
38        readObject = fr.readObjectOfType(osgDB::type_wrapper<osgVolume::Property>());
39        if (readObject.valid()) itrAdvanced = true;
40
41        osgVolume::Property* property = dynamic_cast<osgVolume::Property*>(readObject.get());
42        if (property) cp.addProperty(property);
43
44    } while (readObject.valid());
45
46    return itrAdvanced;
47}
48
49bool CompositeProperty_writeLocalData(const osg::Object& obj, osgDB::Output& fw)
50{
51    const osgVolume::CompositeProperty& cp = static_cast<const osgVolume::CompositeProperty&>(obj);
52
53
54    for(unsigned int i=0; i<cp.getNumProperties(); ++i)
55    {
56        fw.writeObject(*cp.getProperty(i));
57    }
58
59    return true;
60}
Note: See TracBrowser for help on using the browser.