1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000,2001,2002 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
37 \*---------------------------------------------------------------------------*/
39 #ifndef _OSGNFIOOPTIONS_H_
40 #define _OSGNFIOOPTIONS_H_
45 #include "OSGBaseTypes.h"
46 #include "OSGIOFileTypeBase.h"
49 #include <boost/lexical_cast.hpp>
53 /* \brief NFIOOptions class.
54 parses the reader/writer options.
61 /*========================== PUBLIC =================================*/
63 /*---------------------------------------------------------------------*/
64 /*! \name Public Types */
67 typedef IOFileTypeBase::IOOption IOOption
;
68 typedef IOFileTypeBase::OptionSet OptionSet
;
71 /*---------------------------------------------------------------------*/
72 /*! \name Constructor */
78 /*---------------------------------------------------------------------*/
79 /*! \name Destructor */
82 virtual ~NFIOOptions (void);
85 /*---------------------------------------------------------------------*/
89 void init(const std::string
&options
);
90 void init(const OptionSet
&options
);
93 /*---------------------------------------------------------------------*/
97 bool inlineTextures(void) const;
98 bool compressTextures(void) const;
99 UInt32
texturesCompressionQuality(void) const;
100 std::string
texturesImageType(void) const;
102 UInt8
quantizePositions(void) const;
103 UInt8
quantizeNormals(void) const;
104 UInt8
quantizeTexCoords(void) const;
106 bool packIndices(void) const;
107 bool unpack16BitIndices(void) const;
109 bool forceVolumeExport(void) const;
112 /*========================= PROTECTED ===============================*/
115 /*========================== PRIVATE ================================*/
118 Int32
getInteger(const std::string
&str
);
119 std::string
getString (const std::string
&str
);
121 bool getBoolOption (const IOOption
&option
);
122 UInt8
getQuantizeOption(const IOOption
&option
);
124 template <class ValueTypeT
>
125 ValueTypeT
getValue (const IOOption
&option
,
126 const ValueTypeT
&defaultValue
);
128 bool _inlineTextures
;
129 bool _compressTextures
;
130 UInt32 _texturesCompressionQuality
;
131 std::string _texturesImageType
;
133 UInt8 _quantizePositions
;
134 UInt8 _quantizeNormals
;
135 UInt8 _quantizeTexCoords
;
138 bool _unpack16BitIndices
;
140 bool _forceVolumeExport
;
145 #include "OSGNFIOOptions.inl"
147 #endif /* _OSGNFIOOPTIONS_H_ */