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

Revision 13041, 1.6 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
2#include <osgParticle/SectorPlacer>
3
4#include <iostream>
5
6#include <osgDB/Registry>
7#include <osgDB/Input>
8#include <osgDB/Output>
9
10bool  SectorPlacer_readLocalData(osg::Object &obj, osgDB::Input &fr);
11bool  SectorPlacer_writeLocalData(const osg::Object &obj, osgDB::Output &fw);
12
13REGISTER_DOTOSGWRAPPER(SectorPlacer_Proxy)
14(
15    new osgParticle::SectorPlacer,
16    "SectorPlacer",
17    "Object Placer CenteredPlacer SectorPlacer",
18    SectorPlacer_readLocalData,
19    SectorPlacer_writeLocalData
20);
21
22bool SectorPlacer_readLocalData(osg::Object &obj, osgDB::Input &fr)
23{
24    osgParticle::SectorPlacer &myobj = static_cast<osgParticle::SectorPlacer &>(obj);
25    bool itAdvanced = false;
26
27    osgParticle::rangef r;
28    if (fr[0].matchWord("radiusRange")) {
29        if (fr[1].getFloat(r.minimum) && fr[2].getFloat(r.maximum)) {
30            myobj.setRadiusRange(r);
31            fr += 3;
32            itAdvanced = true;
33        }
34    }
35
36    if (fr[0].matchWord("phiRange")) {
37        if (fr[1].getFloat(r.minimum) && fr[2].getFloat(r.maximum)) {
38            myobj.setPhiRange(r);
39            fr += 3;
40            itAdvanced = true;
41        }
42    }
43
44    return itAdvanced;
45}
46
47bool SectorPlacer_writeLocalData(const osg::Object &obj, osgDB::Output &fw)
48{
49    const osgParticle::SectorPlacer &myobj = static_cast<const osgParticle::SectorPlacer &>(obj);
50
51    osgParticle::rangef r;
52
53    r = myobj.getRadiusRange();
54    fw.indent() << "radiusRange " << r.minimum << " " << r.maximum << std::endl;
55    r = myobj.getPhiRange();
56    fw.indent() << "phiRange " << r.minimum << " " << r.maximum << std::endl;
57
58    return true;
59}
Note: See TracBrowser for help on using the browser.