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

Revision 13041, 1.8 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/ModularEmitter>
3#include <osgParticle/Counter>
4#include <osgParticle/Placer>
5#include <osgParticle/Shooter>
6
7#include <osgDB/Registry>
8#include <osgDB/Input>
9#include <osgDB/Output>
10
11bool  ModularEmitter_readLocalData(osg::Object &obj, osgDB::Input &fr);
12bool  ModularEmitter_writeLocalData(const osg::Object &obj, osgDB::Output &fw);
13
14REGISTER_DOTOSGWRAPPER(ModularEmitter_Proxy)
15(
16    new osgParticle::ModularEmitter,
17    "ModularEmitter",
18    "Object Node ParticleProcessor Emitter ModularEmitter",
19    ModularEmitter_readLocalData,
20    ModularEmitter_writeLocalData
21);
22
23bool ModularEmitter_readLocalData(osg::Object &obj, osgDB::Input &fr)
24{
25    osgParticle::ModularEmitter &myobj = static_cast<osgParticle::ModularEmitter &>(obj);
26    bool itAdvanced = false;
27
28    osgParticle::Counter *counter = static_cast<osgParticle::Counter *>(fr.readObjectOfType(osgDB::type_wrapper<osgParticle::Counter>()));
29    if (counter) {
30        myobj.setCounter(counter);
31        itAdvanced = true;
32    }
33
34    osgParticle::Placer *placer = static_cast<osgParticle::Placer *>(fr.readObjectOfType(osgDB::type_wrapper<osgParticle::Placer>()));
35    if (placer) {
36        myobj.setPlacer(placer);
37        itAdvanced = true;
38    }
39
40    osgParticle::Shooter *shooter = static_cast<osgParticle::Shooter *>(fr.readObjectOfType(osgDB::type_wrapper<osgParticle::Shooter>()));
41    if (shooter) {
42        myobj.setShooter(shooter);
43        itAdvanced = true;
44    }
45
46    return itAdvanced;
47}
48
49bool ModularEmitter_writeLocalData(const osg::Object &obj, osgDB::Output &fw)
50{
51    const osgParticle::ModularEmitter &myobj = static_cast<const osgParticle::ModularEmitter &>(obj);
52
53    if (myobj.getCounter()) fw.writeObject(*myobj.getCounter());
54    if (myobj.getPlacer()) fw.writeObject(*myobj.getPlacer());
55    if (myobj.getShooter()) fw.writeObject(*myobj.getShooter());
56
57    return true;
58}
Note: See TracBrowser for help on using the browser.