| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | |
|---|
| 20 | #include <osg/Notify> |
|---|
| 21 | #include <osg/Group> |
|---|
| 22 | #include "Registry.h" |
|---|
| 23 | #include "Document.h" |
|---|
| 24 | #include "RecordInputStream.h" |
|---|
| 25 | |
|---|
| 26 | |
|---|
| 27 | namespace flt { |
|---|
| 28 | |
|---|
| 29 | |
|---|
| 30 | |
|---|
| 31 | class RoadSegment : public PrimaryRecord |
|---|
| 32 | { |
|---|
| 33 | osg::ref_ptr<osg::Group> _roadSegment; |
|---|
| 34 | |
|---|
| 35 | public: |
|---|
| 36 | |
|---|
| 37 | RoadSegment() {} |
|---|
| 38 | |
|---|
| 39 | META_Record(RoadSegment) |
|---|
| 40 | |
|---|
| 41 | META_setID(_roadSegment) |
|---|
| 42 | META_setComment(_roadSegment) |
|---|
| 43 | META_setMultitexture(_roadSegment) |
|---|
| 44 | META_addChild(_roadSegment) |
|---|
| 45 | META_dispose(_roadSegment) |
|---|
| 46 | |
|---|
| 47 | protected: |
|---|
| 48 | |
|---|
| 49 | virtual ~RoadSegment() {} |
|---|
| 50 | virtual void readRecord(RecordInputStream& in, Document& ) |
|---|
| 51 | { |
|---|
| 52 | _roadSegment = new osg::Group; |
|---|
| 53 | std::string id = in.readString(8); |
|---|
| 54 | |
|---|
| 55 | _roadSegment->setName(id); |
|---|
| 56 | |
|---|
| 57 | |
|---|
| 58 | if (_parent.valid()) |
|---|
| 59 | _parent->addChild(*_roadSegment); |
|---|
| 60 | } |
|---|
| 61 | }; |
|---|
| 62 | |
|---|
| 63 | REGISTER_FLTRECORD(RoadSegment, ROAD_SEGMENT_OP) |
|---|
| 64 | |
|---|
| 65 | |
|---|
| 66 | |
|---|
| 67 | |
|---|
| 68 | class RoadConstruction : public PrimaryRecord |
|---|
| 69 | { |
|---|
| 70 | osg::ref_ptr<osg::Group> _roadConstruction; |
|---|
| 71 | |
|---|
| 72 | public: |
|---|
| 73 | |
|---|
| 74 | RoadConstruction() {} |
|---|
| 75 | |
|---|
| 76 | META_Record(RoadConstruction) |
|---|
| 77 | |
|---|
| 78 | META_setID(_roadConstruction) |
|---|
| 79 | META_setComment(_roadConstruction) |
|---|
| 80 | META_setMultitexture(_roadConstruction) |
|---|
| 81 | META_addChild(_roadConstruction) |
|---|
| 82 | META_dispose(_roadConstruction) |
|---|
| 83 | |
|---|
| 84 | protected: |
|---|
| 85 | |
|---|
| 86 | virtual ~RoadConstruction() {} |
|---|
| 87 | virtual void readRecord(RecordInputStream& in, Document& ) |
|---|
| 88 | { |
|---|
| 89 | _roadConstruction = new osg::Group; |
|---|
| 90 | |
|---|
| 91 | std::string id = in.readString(8); |
|---|
| 92 | |
|---|
| 93 | _roadConstruction->setName(id); |
|---|
| 94 | |
|---|
| 95 | |
|---|
| 96 | if (_parent.valid()) |
|---|
| 97 | _parent->addChild(*_roadConstruction); |
|---|
| 98 | } |
|---|
| 99 | }; |
|---|
| 100 | |
|---|
| 101 | REGISTER_FLTRECORD(RoadConstruction, ROAD_CONSTRUCTION_OP) |
|---|
| 102 | |
|---|
| 103 | |
|---|
| 104 | |
|---|
| 105 | |
|---|
| 106 | |
|---|
| 107 | class RoadPath : public PrimaryRecord |
|---|
| 108 | { |
|---|
| 109 | osg::ref_ptr<osg::Group> _roadPath; |
|---|
| 110 | |
|---|
| 111 | public: |
|---|
| 112 | |
|---|
| 113 | RoadPath() {} |
|---|
| 114 | |
|---|
| 115 | META_Record(RoadPath) |
|---|
| 116 | |
|---|
| 117 | META_setID(_roadPath) |
|---|
| 118 | META_setComment(_roadPath) |
|---|
| 119 | META_setMultitexture(_roadPath) |
|---|
| 120 | META_addChild(_roadPath) |
|---|
| 121 | META_dispose(_roadPath) |
|---|
| 122 | |
|---|
| 123 | protected: |
|---|
| 124 | |
|---|
| 125 | virtual ~RoadPath() {} |
|---|
| 126 | virtual void readRecord(RecordInputStream& , Document& ) |
|---|
| 127 | { |
|---|
| 128 | _roadPath = new osg::Group; |
|---|
| 129 | |
|---|
| 130 | |
|---|
| 131 | if (_parent.valid()) |
|---|
| 132 | _parent->addChild(*_roadPath); |
|---|
| 133 | } |
|---|
| 134 | }; |
|---|
| 135 | |
|---|
| 136 | REGISTER_FLTRECORD(RoadPath, ROAD_PATH_OP) |
|---|
| 137 | |
|---|
| 138 | |
|---|
| 139 | |
|---|
| 140 | } |
|---|