Show
Ignore:
Timestamp:
11/26/10 18:35:06 (3 years ago)
Author:
robert
Message:

From Eduardo Poyart, OSG patch: made it read ancillary IndexedStrings? into MultiSwitch?

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgPlugins/OpenFlight/AncillaryRecords.cpp

    r10283 r11961  
    317317REGISTER_FLTRECORD(Replicate, REPLICATE_OP) 
    318318 
     319 
     320/** IndexedString - 
     321  */ 
     322class IndexedString : public Record 
     323{ 
     324    public: 
     325 
     326        IndexedString() {} 
     327 
     328        META_Record(IndexedString) 
     329 
     330    protected: 
     331 
     332        virtual ~IndexedString() {} 
     333 
     334        virtual void readRecord(RecordInputStream& in, Document& /*document*/) 
     335        { 
     336            std::streamsize size = in.getRecordSize(); 
     337            uint32 index = in.readUInt32(); 
     338            std::string name = in.readString(size-8); 
     339 
     340            if (_parent.valid()) 
     341                _parent->setMultiSwitchValueName(index, name); 
     342        } 
     343}; 
     344 
     345REGISTER_FLTRECORD(IndexedString, INDEXED_STRING_OP) 
     346 
     347 
    319348// Prevent "unknown record" message for the following ancillary records: 
    320349REGISTER_FLTRECORD(DummyRecord, OLD_TRANSLATE2_OP) 
     
    328357REGISTER_FLTRECORD(DummyRecord, OLD_PUT_TRANSFORM_OP) 
    329358REGISTER_FLTRECORD(DummyRecord, OLD_BOUNDING_BOX_OP) 
    330 REGISTER_FLTRECORD(DummyRecord, INDEXED_STRING_OP) 
    331359REGISTER_FLTRECORD(DummyRecord, ROAD_ZONE_OP) 
    332360REGISTER_FLTRECORD(DummyRecord, ROTATE_ABOUT_EDGE_OP)