From Farshid Lasharki, added IO suppoty fo osgParticle::ConstantRateContour

This commit is contained in:
Robert Osfield 2006-03-18 07:07:19 +00:00
parent fd76b4f87b
commit 7f731f330a
3 changed files with 61 additions and 0 deletions

View File

@ -116,6 +116,10 @@ SOURCE=..\..\..\src\osgPlugins\osgParticle\IO_ConnectedParticleSystem.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\src\osgPlugins\osgParticle\IO_ConstantRateCounter.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\src\osgPlugins\osgParticle\IO_Emitter.cpp
# End Source File
# Begin Source File

View File

@ -7,6 +7,7 @@ CXXFILES =\
IO_BoxPlacer.cpp\
IO_CenteredPlacer.cpp\
IO_ConnectedParticleSystem.cpp\
IO_ConstantRateCounter.cpp\
IO_Emitter.cpp\
IO_FluidFrictionOperator.cpp\
IO_ForceOperator.cpp\

View File

@ -0,0 +1,56 @@
#include <osgParticle/ConstantRateCounter>
#include <iostream>
#include <osgDB/Registry>
#include <osgDB/Input>
#include <osgDB/Output>
bool ConstantRateCounter_readLocalData(osg::Object &obj, osgDB::Input &fr);
bool ConstantRateCounter_writeLocalData(const osg::Object &obj, osgDB::Output &fw);
osgDB::RegisterDotOsgWrapperProxy ConstantRateCounter_Proxy
(
new osgParticle::ConstantRateCounter,
"ConstantRateCounter",
"Object Counter ConstantRateCounter",
ConstantRateCounter_readLocalData,
ConstantRateCounter_writeLocalData
);
bool ConstantRateCounter_readLocalData(osg::Object &obj, osgDB::Input &fr)
{
osgParticle::ConstantRateCounter &myobj = static_cast<osgParticle::ConstantRateCounter &>(obj);
bool itAdvanced = false;
if (fr[0].matchWord("minimumNumberOfParticlesToCreate")) {
int v;
if (fr[1].getInt(v)) {
myobj.setMinimumNumberOfParticlesToCreate(v);
fr += 2;
itAdvanced = true;
}
}
if (fr[0].matchWord("numberOfParticlesPerSecondToCreate")) {
float v;
if (fr[1].getFloat(v)) {
myobj.setNumberOfParticlesPerSecondToCreate(v);
fr += 2;
itAdvanced = true;
}
}
return itAdvanced;
}
bool ConstantRateCounter_writeLocalData(const osg::Object &obj, osgDB::Output &fw)
{
const osgParticle::ConstantRateCounter &myobj = static_cast<const osgParticle::ConstantRateCounter &>(obj);
fw.indent() << "minimumNumberOfParticlesToCreate " << myobj.getMinimumNumberOfParticlesToCreate() << std::endl;
fw.indent() << "numberOfParticlesPerSecondToCreate " << myobj.getNumberOfParticlesPerSecondToCreate() << std::endl;
return true;
}