fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / FileIO / OSB / OSGNFIOOptions.h
blobd663db87d645cc54bd22f6b7c7b345f9c49ddc62
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000,2001,2002 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
10 * *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
13 * License *
14 * *
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. *
18 * *
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. *
23 * *
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. *
27 * *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
30 * Changes *
31 * *
32 * *
33 * *
34 * *
35 * *
36 * *
37 \*---------------------------------------------------------------------------*/
39 #ifndef _OSGNFIOOPTIONS_H_
40 #define _OSGNFIOOPTIONS_H_
41 #ifdef __sgi
42 #pragma once
43 #endif
45 #include "OSGBaseTypes.h"
46 #include "OSGIOFileTypeBase.h"
48 #include <string>
49 #include <boost/lexical_cast.hpp>
51 OSG_BEGIN_NAMESPACE
53 /* \brief NFIOOptions class.
54 parses the reader/writer options.
55 \ingroup GrpFileIOOSB
56 \nohierarchy
59 class NFIOOptions
61 /*========================== PUBLIC =================================*/
62 public:
63 /*---------------------------------------------------------------------*/
64 /*! \name Public Types */
65 /*! \{ */
67 typedef IOFileTypeBase::IOOption IOOption;
68 typedef IOFileTypeBase::OptionSet OptionSet;
70 /*! \} */
71 /*---------------------------------------------------------------------*/
72 /*! \name Constructor */
73 /*! \{ */
75 NFIOOptions (void);
77 /*! \} */
78 /*---------------------------------------------------------------------*/
79 /*! \name Destructor */
80 /*! \{ */
82 virtual ~NFIOOptions (void);
84 /*! \} */
85 /*---------------------------------------------------------------------*/
86 /*! \name Init */
87 /*! \{ */
89 void init(const std::string &options);
90 void init(const OptionSet &options);
92 /*! \} */
93 /*---------------------------------------------------------------------*/
94 /*! \name Options */
95 /*! \{ */
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;
111 /*! \} */
112 /*========================= PROTECTED ===============================*/
113 protected:
115 /*========================== PRIVATE ================================*/
116 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;
137 bool _packIndices;
138 bool _unpack16BitIndices;
140 bool _forceVolumeExport;
143 OSG_END_NAMESPACE
145 #include "OSGNFIOOptions.inl"
147 #endif /* _OSGNFIOOPTIONS_H_ */