Removed no longer used code

This commit is contained in:
Robert Osfield
2016-06-30 09:09:54 +01:00
parent 9b1107eb64
commit 05d97aad28

View File

@@ -31,20 +31,8 @@ class ReaderWriterTerrain : public osgDB::ReaderWriter
if (osgDB::equalCaseInsensitive(ext,"terrain"))
{
#if 0
KeywordValueMap keywordValueMap;
parseTerrainString(osgDB::getNameLessExtension(file), keywordValueMap);
for(KeywordValueMap::iterator itr = keywordValueMap.begin();
itr != keywordValueMap.end();
++itr)
{
OSG_NOTICE<<"["<<itr->first<<"] = "<<"["<<itr->second<<"]"<<std::endl;
}
#else
std::istringstream fin(osgDB::getNameLessExtension(file));
if (fin) return readNode(fin,opt);
#endif
return 0;
}
@@ -109,89 +97,6 @@ class ReaderWriterTerrain : public osgDB::ReaderWriter
else return 0;
}
typedef std::map<std::string, std::string> KeywordValueMap;
bool parseTerrainString(const std::string& str, KeywordValueMap& keywordValueMap) const
{
bool success = false;
std::string::size_type pos = 0;
while(pos != std::string::npos)
{
pos = str.find_first_not_of(' ',pos);
if (pos == std::string::npos) break;
std::string::size_type semicolon = str.find_first_of(';', pos);
std::string::size_type startstatement = pos;
std::string::size_type endstatement = std::string::npos;
if (semicolon!=std::string::npos)
{
endstatement = semicolon-1;
pos = semicolon+1;
}
else
{
endstatement = str.length()-1;
pos = std::string::npos;
}
if (startstatement<endstatement) endstatement = str.find_last_not_of(' ',endstatement);
if (startstatement<=endstatement)
{
// OSG_NOTICE<<"statement = ["<<str.substr(startstatement, endstatement-startstatement+1)<<"]"<<std::endl;
std::string::size_type assignment = str.find_first_of('=', startstatement);
if (assignment!=std::string::npos && assignment>endstatement)
{
assignment = std::string::npos;
}
std::string::size_type startvariable = startstatement;
std::string::size_type endvariable = startstatement;
std::string::size_type startvalue = startstatement;
std::string::size_type endvalue = endstatement;
if (assignment!=std::string::npos)
{
endvariable = assignment-1;
startvalue = assignment+1;
if (startvariable<=endvariable)
{
endvariable = str.find_last_not_of(' ',endvariable);
}
if (startvariable<=endvariable)
{
++endvariable;
}
}
if (startvalue<=endvalue)
{
startvalue = str.find_first_not_of(' ',startvalue);
}
if (startvalue<=endvalue)
{
if (startvariable<endvariable)
{
keywordValueMap[str.substr(startvariable, endvariable-startvariable)] = str.substr(startvalue, endvalue-startvalue+1);
success = true;
}
else
{
keywordValueMap[""] = str.substr(startvalue, endvalue-startvalue+1);
success = true;
}
}
}
}
return success;
}
};
// now register with Registry to instantiate the above