- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgWrappers/serializers/osgSim/ScalarBar.cpp
r12292 r13041 13 13 is >> osgDB::BEGIN_BRACKET; 14 14 is >> osgDB::PROPERTY("Range") >> min >> max; 15 15 16 16 bool hasColorRange = false; 17 17 unsigned int colorSize = 0; … … 32 32 } 33 33 is >> osgDB::END_BRACKET; 34 34 35 35 osgSim::ColorRange* cr = new osgSim::ColorRange(min, max, colors); 36 36 bar.setScalarsToColors( cr ); … … 45 45 os << osgDB::PROPERTY("Range") << stc->getMin() << stc->getMax() << std::endl; 46 46 os << osgDB::PROPERTY("Colors"); 47 47 48 48 unsigned int colorSize = 0; 49 49 const osgSim::ColorRange* cr = dynamic_cast<const osgSim::ColorRange*>(stc); … … 52 52 const std::vector<osg::Vec4>& colors = cr->getColors(); 53 53 colorSize = colors.size(); 54 54 55 55 os << true << colorSize << osgDB::BEGIN_BRACKET << std::endl; 56 56 for ( unsigned int i=0; i<colorSize; ++i ) … … 78 78 osgSim::ScalarBar::ScalarPrinter* sp = 79 79 dynamic_cast<osgSim::ScalarBar::ScalarPrinter*>( is.readObject() ); 80 if ( sp ) bar.setScalarPrinter( sp ); 80 if ( sp ) bar.setScalarPrinter( sp ); 81 81 is >> osgDB::END_BRACKET; 82 82 return true; … … 86 86 { 87 87 os << osgDB::BEGIN_BRACKET << std::endl; 88 os.writeObject( dynamic_cast<const osg::Object*>(bar.getScalarPrinter()) ); 88 os.writeObject( dynamic_cast<const osg::Object*>(bar.getScalarPrinter()) ); 89 89 os << osgDB::END_BRACKET << std::endl; 90 90 return true; … … 105 105 is >> osgDB::PROPERTY("Color") >> prop._fontFile; 106 106 is >> osgDB::END_BRACKET; 107 107 108 108 prop._fontResolution = std::pair<int, int>(resX, resY); 109 109 bar.setTextProperties( prop ); … … 136 136 ADD_FLOAT_SERIALIZER( Width, 0.0f ); // _width 137 137 ADD_FLOAT_SERIALIZER( AspectRatio, 0.0f ); // _aspectRatio 138 138 139 139 BEGIN_ENUM_SERIALIZER( Orientation, HORIZONTAL ); 140 140 ADD_ENUM_VALUE( HORIZONTAL ); 141 141 ADD_ENUM_VALUE( VERTICAL ); 142 142 END_ENUM_SERIALIZER(); // _orientation 143 143 144 144 ADD_USER_SERIALIZER( ScalarPrinter ); // _sp 145 145 ADD_USER_SERIALIZER( TextProperties ); // _textProperties
