1 #include <osgParticle/SectorPlacer> 2 #include <osgDB/ObjectWrapper> 3 #include <osgDB/InputStream> 4 #include <osgDB/OutputStream> 5 6 #define SECTORPLACER_FUNCTION( PROP ) \ 7 static bool check##PROP( const osgParticle::SectorPlacer& obj ) { return true; } \ 8 static bool read##PROP( osgDB::InputStream& is, osgParticle::SectorPlacer& obj ) { \ 9 float min, max; is >> min >> max; \ 10 obj.set##PROP( min, max ); return true; \ 11 } \ 12 static bool write##PROP( osgDB::OutputStream& os, const osgParticle::SectorPlacer& obj ) { \ 13 const osgParticle::rangef& range = obj.get##PROP(); \ 14 os << range.minimum << range.maximum << std::endl; \ 15 return true; \ 16 } 17 18 SECTORPLACER_FUNCTION( RadiusRange ) SECTORPLACER_FUNCTION(PhiRange)19SECTORPLACER_FUNCTION( PhiRange ) 20 21 REGISTER_OBJECT_WRAPPER( osgParticleSectorPlacer, 22 new osgParticle::SectorPlacer, 23 osgParticle::SectorPlacer, 24 "osg::Object osgParticle::Placer osgParticle::CenteredPlacer osgParticle::SectorPlacer" ) 25 { 26 ADD_USER_SERIALIZER( RadiusRange ); // _rad_range 27 ADD_USER_SERIALIZER( PhiRange ); // _phi_range 28 } 29