root/OpenSceneGraph/trunk/src/osgWrappers/deprecated-dotosg/osgParticle/IO_BoxPlacer.cpp @ 13041

Revision 13041, 1.8 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
2#include <osgParticle/BoxPlacer>
3
4#include <iostream>
5
6#include <osgDB/Registry>
7#include <osgDB/Input>
8#include <osgDB/Output>
9
10bool  BoxPlacer_readLocalData(osg::Object &obj, osgDB::Input &fr);
11bool  BoxPlacer_writeLocalData(const osg::Object &obj, osgDB::Output &fw);
12
13REGISTER_DOTOSGWRAPPER(BoxPlacer_Proxy)
14(
15    new osgParticle::BoxPlacer,
16    "BoxPlacer",
17    "Object Placer CenteredPlacer BoxPlacer",
18    BoxPlacer_readLocalData,
19    BoxPlacer_writeLocalData
20);
21
22bool BoxPlacer_readLocalData(osg::Object &obj, osgDB::Input &fr)
23{
24    osgParticle::BoxPlacer &myobj = static_cast<osgParticle::BoxPlacer &>(obj);
25    bool itAdvanced = false;
26
27    osgParticle::rangef r;
28    if (fr[0].matchWord("xRange")) {
29        if (fr[1].getFloat(r.minimum) && fr[2].getFloat(r.maximum)) {
30            myobj.setXRange(r);
31            fr += 3;
32            itAdvanced = true;
33        }
34    }
35
36    if (fr[0].matchWord("yRange")) {
37        if (fr[1].getFloat(r.minimum) && fr[2].getFloat(r.maximum)) {
38            myobj.setYRange(r);
39            fr += 3;
40            itAdvanced = true;
41        }
42    }
43
44    if (fr[0].matchWord("zRange")) {
45        if (fr[1].getFloat(r.minimum) && fr[2].getFloat(r.maximum)) {
46            myobj.setZRange(r);
47            fr += 3;
48            itAdvanced = true;
49        }
50    }
51
52    return itAdvanced;
53}
54
55bool BoxPlacer_writeLocalData(const osg::Object &obj, osgDB::Output &fw)
56{
57    const osgParticle::BoxPlacer &myobj = static_cast<const osgParticle::BoxPlacer &>(obj);
58
59    osgParticle::rangef r;
60
61    r = myobj.getXRange();
62    fw.indent() << "xRange " << r.minimum << " " << r.maximum << std::endl;
63    r = myobj.getYRange();
64    fw.indent() << "yRange " << r.minimum << " " << r.maximum << std::endl;
65    r = myobj.getZRange();
66    fw.indent() << "zRange " << r.minimum << " " << r.maximum << std::endl;
67
68    return true;
69}
Note: See TracBrowser for help on using the browser.