root/OpenSceneGraph/trunk/src/osgWrappers/deprecated-dotosg/osgFX/IO_Cartoon.cpp @ 13041

Revision 13041, 1.7 kB (checked in by robert, 3 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/Cartoon>
2#include <osg/io_utils>
3
4#include <osgDB/Registry>
5#include <osgDB/Input>
6#include <osgDB/Output>
7
8bool Cartoon_readLocalData(osg::Object &obj, osgDB::Input &fr);
9bool Cartoon_writeLocalData(const osg::Object &obj, osgDB::Output &fw);
10
11REGISTER_DOTOSGWRAPPER(Cartoon_Proxy)
12(
13    new osgFX::Cartoon,
14    "osgFX::Cartoon",
15    "Object Node Group osgFX::Effect osgFX::Cartoon",
16    Cartoon_readLocalData,
17    Cartoon_writeLocalData
18);
19
20bool Cartoon_readLocalData(osg::Object &obj, osgDB::Input &fr)
21{
22    osgFX::Cartoon &myobj = static_cast<osgFX::Cartoon &>(obj);
23    bool itAdvanced = false;
24
25    if (fr[0].matchWord("lightNumber")) {
26        int n;
27        if (fr[1].getInt(n)) {
28            myobj.setLightNumber(n);
29            fr += 2;
30            itAdvanced = true;
31        }
32    }
33
34    if (fr[0].matchWord("outlineColor")) {
35        osg::Vec4 w;
36        if (fr[1].getFloat(w.x()) && fr[2].getFloat(w.y()) &&
37            fr[3].getFloat(w.z()) && fr[4].getFloat(w.w())) {
38            myobj.setOutlineColor(w);
39            fr += 5;
40            itAdvanced = true;
41        }
42    }
43
44    if (fr[0].matchWord("outlineLineWidth")) {
45        float f;
46        if (fr[1].getFloat(f)) {
47            myobj.setOutlineLineWidth(f);
48            fr += 2;
49            itAdvanced = true;
50        }
51    }
52
53    return itAdvanced;
54}
55
56bool Cartoon_writeLocalData(const osg::Object &obj, osgDB::Output &fw)
57{
58    const osgFX::Cartoon &myobj = static_cast<const osgFX::Cartoon &>(obj);
59
60    fw.indent() << "lightNumber " << myobj.getLightNumber() << "\n";
61    fw.indent() << "outlineColor " << myobj.getOutlineColor() << "\n";
62    fw.indent() << "outlineLineWidth " << myobj.getOutlineLineWidth() << "\n";
63
64    return true;
65}
Note: See TracBrowser for help on using the browser.