- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgPlugins/terrain/ReaderWriterOsgTerrain.cpp
r12292 r13041 23 23 supportsExtension("terrain","OpenSceneGraph terrain ascii format"); 24 24 } 25 25 26 26 virtual const char* className() const { return "Terrain ReaderWriter"; } 27 27 … … 29 29 { 30 30 std::string ext = osgDB::getLowerCaseFileExtension(file); 31 31 32 32 if (osgDB::equalCaseInsensitive(ext,"terrain")) 33 33 { 34 #if 0 34 #if 0 35 35 KeywordValueMap keywordValueMap; 36 36 parseTerrainString(osgDB::getNameLessExtension(file), keywordValueMap); 37 37 38 38 for(KeywordValueMap::iterator itr = keywordValueMap.begin(); 39 39 itr != keywordValueMap.end(); … … 54 54 if (fileName.empty()) return ReadResult::FILE_NOT_FOUND; 55 55 56 // code for setting up the database path so that internally referenced file are searched for on relative paths. 56 // code for setting up the database path so that internally referenced file are searched for on relative paths. 57 57 osg::ref_ptr<Options> local_opt = opt ? static_cast<Options*>(opt->clone(osg::CopyOp::SHALLOW_COPY)) : new Options; 58 58 local_opt->setDatabasePath(osgDB::getFilePath(fileName)); … … 64 64 } 65 65 return 0L; 66 66 67 67 } 68 68 … … 120 120 pos = str.find_first_not_of(' ',pos); 121 121 if (pos == std::string::npos) break; 122 122 123 123 std::string::size_type semicolon = str.find_first_of(';', pos); 124 124 std::string::size_type startstatement = pos; … … 134 134 pos = std::string::npos; 135 135 } 136 136 137 137 if (startstatement<endstatement) endstatement = str.find_last_not_of(' ',endstatement); 138 138 … … 145 145 assignment = std::string::npos; 146 146 } 147 147 148 148 std::string::size_type startvariable = startstatement; 149 149 std::string::size_type endvariable = startstatement; 150 150 std::string::size_type startvalue = startstatement; 151 151 std::string::size_type endvalue = endstatement; 152 152 153 153 if (assignment!=std::string::npos) 154 154 { … … 166 166 } 167 167 } 168 168 169 169 170 170 if (startvalue<=endvalue) … … 172 172 startvalue = str.find_first_not_of(' ',startvalue); 173 173 } 174 174 175 175 if (startvalue<=endvalue) 176 176 { … … 179 179 keywordValueMap[str.substr(startvariable, endvariable-startvariable)] = str.substr(startvalue, endvalue-startvalue+1); 180 180 success = true; 181 } 181 } 182 182 else 183 183 { … … 186 186 } 187 187 } 188 189 } 190 } 191 188 189 } 190 } 191 192 192 return success; 193 193 }
