1
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
3
* This library is open source and may be redistributed and/or modified under
4
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5
* (at your option) any later version. The full license is in LICENSE file
6
* included with this distribution, and on the openscenegraph.org website.
8
* This library is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* OpenSceneGraph Public License for more details.
14
#include <osgDB/Options>
15
#include <osgDB/Registry>
17
using namespace osgDB;
19
Options::Options(const Options& options,const osg::CopyOp& copyop):
20
osg::Object(options,copyop),
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) {}
35
void Options::parsePluginStringData(const std::string& str, char separator1, char separator2)
38
split(str, valueList, separator1);
39
if (valueList.size() > 0)
41
StringList keyAndValue;
42
for (StringList::iterator itr=valueList.begin(); itr!=valueList.end(); ++itr)
44
split(*itr, keyAndValue, separator2);
45
if (keyAndValue.size() > 1)
47
setPluginStringData(keyAndValue.front(), keyAndValue.back());
49
else if (keyAndValue.size() > 0)
51
setPluginStringData(keyAndValue.front(), "true");