1 // Copyright (C) 2007 Tim Moore timoore@redhat.com
2 // Copyright (C) 2008 Till Busch buti@bux.at
3 // Copyright (C) 2011 Mathias Froehlich
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License as
7 // published by the Free Software Foundation; either version 2 of the
8 // License, or (at your option) any later version.
10 // This program is distributed in the hope that it will be useful, but
11 // WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 #ifndef SGREADERWRITEROPTIONS_HXX
21 #define SGREADERWRITEROPTIONS_HXX 1
23 #include <osgDB/Options>
24 #include <simgear/scene/model/modellib.hxx>
25 #include <simgear/props/props.hxx>
33 class SGReaderWriterOptions : public osgDB::Options {
35 SGReaderWriterOptions() :
39 _instantiateEffects(false)
41 SGReaderWriterOptions(const std::string& str) :
42 osgDB::ReaderWriter::Options(str),
46 _instantiateEffects(false)
48 SGReaderWriterOptions(const osgDB::Options& options,
49 const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY) :
50 osgDB::ReaderWriter::Options(options, copyop),
54 _instantiateEffects(false)
56 SGReaderWriterOptions(const SGReaderWriterOptions& options,
57 const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY) :
58 osgDB::ReaderWriter::Options(options, copyop),
59 _propertyNode(options._propertyNode),
60 _materialLib(options._materialLib),
61 _load_panel(options._load_panel),
62 _model_data(options._model_data),
63 _instantiateEffects(options._instantiateEffects)
66 META_Object(simgear, SGReaderWriterOptions);
68 const SGSharedPtr<SGPropertyNode>& getPropertyNode() const
69 { return _propertyNode; }
70 void setPropertyNode(const SGSharedPtr<SGPropertyNode>& propertyNode)
71 { _propertyNode = propertyNode; }
73 SGMaterialLib* getMaterialLib() const
74 { return _materialLib; }
75 void setMaterialLib(SGMaterialLib* materialLib)
76 { _materialLib = materialLib; }
78 typedef osg::Node *(*panel_func)(SGPropertyNode *);
80 panel_func getLoadPanel() const
81 { return _load_panel; }
82 void setLoadPanel(panel_func pf)
85 SGModelData *getModelData() const
86 { return _model_data.get(); }
87 void setModelData(SGModelData *modelData)
88 { _model_data=modelData; }
90 bool getInstantiateEffects() const
91 { return _instantiateEffects; }
92 void setInstantiateEffects(bool instantiateEffects)
93 { _instantiateEffects = instantiateEffects; }
96 virtual ~SGReaderWriterOptions() {}
99 SGSharedPtr<SGPropertyNode> _propertyNode;
100 SGMaterialLib* _materialLib;
101 osg::Node *(*_load_panel)(SGPropertyNode *);
102 osg::ref_ptr<SGModelData> _model_data;
103 bool _instantiateEffects;