root/OpenSceneGraph/trunk/src/osgWrappers/deprecated-dotosg/osgFX/IO_Scribe.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
  • Property svn:keywords set to Author Date Id Revision
Line 
1#include <osgFX/Scribe>
2#include <osg/io_utils>
3
4#include <osgDB/Registry>
5#include <osgDB/Input>
6#include <osgDB/Output>
7
8bool Scribe_readLocalData(osg::Object &obj, osgDB::Input &fr);
9bool Scribe_writeLocalData(const osg::Object &obj, osgDB::Output &fw);
10
11REGISTER_DOTOSGWRAPPER(Scribe_Proxy)
12(
13    new osgFX::Scribe,
14    "osgFX::Scribe",
15    "Object Node Group osgFX::Effect osgFX::Scribe",
16    Scribe_readLocalData,
17    Scribe_writeLocalData
18);
19
20bool Scribe_readLocalData(osg::Object &obj, osgDB::Input &fr)
21{
22    osgFX::Scribe &myobj = static_cast<osgFX::Scribe &>(obj);
23    bool itAdvanced = false;
24
25    if (fr[0].matchWord("wireframeColor")) {
26        osg::Vec4 w;
27        if (fr[1].getFloat(w.x()) && fr[2].getFloat(w.y()) &&
28            fr[3].getFloat(w.z()) && fr[4].getFloat(w.w())) {
29            myobj.setWireframeColor(w);
30            fr += 5;
31            itAdvanced = true;
32        }
33    }
34
35    if (fr[0].matchWord("wireframeLineWidth")) {
36        float f;
37        if (fr[1].getFloat(f)) {
38            myobj.setWireframeLineWidth(f);
39            fr += 2;
40            itAdvanced = true;
41        }
42    }
43
44    return itAdvanced;
45}
46
47bool Scribe_writeLocalData(const osg::Object &obj, osgDB::Output &fw)
48{
49    const osgFX::Scribe &myobj = static_cast<const osgFX::Scribe &>(obj);
50
51    fw.indent() << "wireframeColor " << myobj.getWireframeColor() << "\n";
52    fw.indent() << "wireframeLineWidth " << myobj.getWireframeLineWidth() << "\n";
53
54    return true;
55}
Note: See TracBrowser for help on using the browser.