1 // Copyright (C) 2007 Tim Moore timoore@redhat.com
2 // Copyright (C) 2008 Till Busch buti@bux.at
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License as
6 // published by the Free Software Foundation; either version 2 of the
7 // License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful, but
10 // WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 #ifndef SGREADERWRITERXMLOPTIONS_HXX
19 #define SGREADERWRITERXMLOPTIONS_HXX 1
21 #include <osgDB/Registry>
22 #include <simgear/scene/model/modellib.hxx>
23 #include <simgear/props/props.hxx>
31 class SGReaderWriterXMLOptions : public osgDB::ReaderWriter::Options
34 typedef osg::Node *(*panel_func)(SGPropertyNode *);
36 SGReaderWriterXMLOptions():
37 osgDB::ReaderWriter::Options(),
41 _instantiateEffects(false)
44 SGReaderWriterXMLOptions(const std::string& str):
45 osgDB::ReaderWriter::Options(str),
49 _instantiateEffects(false)
52 SGReaderWriterXMLOptions(const SGReaderWriterXMLOptions& options,
53 const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY):
54 osgDB::ReaderWriter::Options(options, copyop),
55 _prop_root(options._prop_root),
56 _load_panel(options._load_panel),
57 _model_data(options._model_data),
58 _instantiateEffects(options._instantiateEffects)
61 SGReaderWriterXMLOptions(const osgDB::ReaderWriter::Options& options,
62 const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY):
63 osgDB::ReaderWriter::Options(options, copyop),
67 _instantiateEffects(false)
70 SGPropertyNode *getPropRoot() const {
73 panel_func getLoadPanel() const {
76 SGModelData *getModelData() const {
77 return _model_data.get();
79 bool getInstantiateEffects() const
81 return _instantiateEffects;
84 void setPropRoot(SGPropertyNode *p) {
87 void setLoadPanel(panel_func pf) {
90 void setModelData(SGModelData *d) {
93 void setInstantiateEffects(bool doit)
95 _instantiateEffects = doit;
100 virtual ~SGReaderWriterXMLOptions() {}
102 SGPropertyNode_ptr _prop_root;
103 osg::Node *(*_load_panel)(SGPropertyNode *);
104 osg::ref_ptr<SGModelData> _model_data;
105 bool _instantiateEffects;