root/OpenSceneGraph/trunk/src/osgWrappers/deprecated-dotosg/osgParticle/IO_ConstantRateCounter.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 <osgParticle/ConstantRateCounter>
2
3#include <iostream>
4
5#include <osgDB/Registry>
6#include <osgDB/Input>
7#include <osgDB/Output>
8
9bool  ConstantRateCounter_readLocalData(osg::Object &obj, osgDB::Input &fr);
10bool  ConstantRateCounter_writeLocalData(const osg::Object &obj, osgDB::Output &fw);
11
12REGISTER_DOTOSGWRAPPER(ConstantRateCounter_Proxy)
13(
14    new osgParticle::ConstantRateCounter,
15    "ConstantRateCounter",
16    "Object Counter ConstantRateCounter",
17    ConstantRateCounter_readLocalData,
18    ConstantRateCounter_writeLocalData
19);
20
21bool ConstantRateCounter_readLocalData(osg::Object &obj, osgDB::Input &fr)
22{
23    osgParticle::ConstantRateCounter &myobj = static_cast<osgParticle::ConstantRateCounter &>(obj);
24    bool itAdvanced = false;
25
26    if (fr[0].matchWord("minimumNumberOfParticlesToCreate")) {
27        int v;
28        if (fr[1].getInt(v)) {
29            myobj.setMinimumNumberOfParticlesToCreate(v);
30            fr += 2;
31            itAdvanced = true;
32        }
33    }
34
35    if (fr[0].matchWord("numberOfParticlesPerSecondToCreate")) {
36        float v;
37        if (fr[1].getFloat(v)) {
38            myobj.setNumberOfParticlesPerSecondToCreate(v);
39            fr += 2;
40            itAdvanced = true;
41        }
42    }
43
44    return itAdvanced;
45}
46
47bool ConstantRateCounter_writeLocalData(const osg::Object &obj, osgDB::Output &fw)
48{
49    const osgParticle::ConstantRateCounter &myobj = static_cast<const osgParticle::ConstantRateCounter &>(obj);
50
51    fw.indent() << "minimumNumberOfParticlesToCreate " << myobj.getMinimumNumberOfParticlesToCreate() << std::endl;
52    fw.indent() << "numberOfParticlesPerSecondToCreate " << myobj.getNumberOfParticlesPerSecondToCreate() << std::endl;
53
54    return true;
55}
Note: See TracBrowser for help on using the browser.