| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | #include <osgDB/Options> |
|---|
| 15 | #include <osgDB/Registry> |
|---|
| 16 | |
|---|
| 17 | using namespace osgDB; |
|---|
| 18 | |
|---|
| 19 | Options::Options(const Options& options,const osg::CopyOp& copyop): |
|---|
| 20 | osg::Object(options,copyop), |
|---|
| 21 | _str(options._str), |
|---|
| 22 | _databasePaths(options._databasePaths), |
|---|
| 23 | _objectCacheHint(options._objectCacheHint), |
|---|
| 24 | _precisionHint(options._precisionHint), |
|---|
| 25 | _buildKdTreesHint(options._buildKdTreesHint), |
|---|
| 26 | _pluginData(options._pluginData), |
|---|
| 27 | _pluginStringData(options._pluginStringData), |
|---|
| 28 | _findFileCallback(options._findFileCallback), |
|---|
| 29 | _readFileCallback(options._readFileCallback), |
|---|
| 30 | _writeFileCallback(options._writeFileCallback), |
|---|
| 31 | _fileLocationCallback(options._fileLocationCallback), |
|---|
| 32 | _fileCache(options._fileCache), |
|---|
| 33 | _terrain(options._terrain) {} |
|---|
| 34 | |
|---|
| 35 | void Options::parsePluginStringData(const std::string& str, char separator1, char separator2) |
|---|
| 36 | { |
|---|
| 37 | StringList valueList; |
|---|
| 38 | split(str, valueList, separator1); |
|---|
| 39 | if (valueList.size() > 0) |
|---|
| 40 | { |
|---|
| 41 | StringList keyAndValue; |
|---|
| 42 | for (StringList::iterator itr=valueList.begin(); itr!=valueList.end(); ++itr) |
|---|
| 43 | { |
|---|
| 44 | split(*itr, keyAndValue, separator2); |
|---|
| 45 | if (keyAndValue.size() > 1) |
|---|
| 46 | { |
|---|
| 47 | setPluginStringData(keyAndValue.front(), keyAndValue.back()); |
|---|
| 48 | } |
|---|
| 49 | else if (keyAndValue.size() > 0) |
|---|
| 50 | { |
|---|
| 51 | setPluginStringData(keyAndValue.front(), "true"); |
|---|
| 52 | } |
|---|
| 53 | keyAndValue.clear(); |
|---|
| 54 | } |
|---|
| 55 | } |
|---|
| 56 | } |
|---|