From ab7043ea45fae1c27bc300f4abe600be9b840438 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 7 Dec 2007 13:28:02 +0000 Subject: [PATCH] From Tony Horrobin, "Attached is a small fix for the openflight loader with regard to road segment and construction records. It just uses the id field to set the name of the osg node as with other types." --- src/osgPlugins/OpenFlight/RoadRecords.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/osgPlugins/OpenFlight/RoadRecords.cpp b/src/osgPlugins/OpenFlight/RoadRecords.cpp index 82933129d..4dac0d21b 100644 --- a/src/osgPlugins/OpenFlight/RoadRecords.cpp +++ b/src/osgPlugins/OpenFlight/RoadRecords.cpp @@ -35,9 +35,12 @@ class RoadSegment : public PrimaryRecord virtual ~RoadSegment() {} - virtual void readRecord(RecordInputStream& /*in*/, Document& /*document*/) + virtual void readRecord(RecordInputStream& in, Document& /*document*/) { _roadSegment = new osg::Group; + std::string id = in.readString(8); + + _roadSegment->setName(id); // Add to parent. if (_parent.valid()) @@ -70,10 +73,14 @@ class RoadConstruction : public PrimaryRecord virtual ~RoadConstruction() {} - virtual void readRecord(RecordInputStream& /*in*/, Document& /*document*/) + virtual void readRecord(RecordInputStream& in, Document& /*document*/) { _roadConstruction = new osg::Group; + std::string id = in.readString(8); + + _roadConstruction->setName(id); + // Add to parent. if (_parent.valid()) _parent->addChild(*_roadConstruction);