1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000 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 _OSGSCENEFILETYPE_H_
40 #define _OSGSCENEFILETYPE_H_
45 #include "OSGIOFileTypeBase.h"
46 #include "OSGSystemDef.h"
47 #include "OSGBaseTypes.h"
56 class SceneFileHandlerBase
;
58 /*! \brief OSGSceneFileType
59 \ingroup GrpSystemFileIOBase
60 \ingroup GrpLibOSGSystem
63 class OSG_SYSTEM_DLLMAPPING SceneFileType
: public IOFileTypeBase
65 /*========================== PUBLIC =================================*/
69 /*---------------------------------------------------------------------*/
70 /*! \name Public Types */
73 typedef IOFileTypeBase Inherited
;
74 typedef SceneFileType Self
;
76 typedef boost::function
<FieldContainer
*(const Char8
*,
81 /*---------------------------------------------------------------------*/
82 /*! \name Class Get */
85 virtual const Char8
*getName(void) const = 0;
88 /*---------------------------------------------------------------------*/
89 /*! \name Destructors */
92 virtual ~SceneFileType(void);
95 /*---------------------------------------------------------------------*/
99 virtual std::list
<std::string
> &suffixList (void);
101 bool doOverride (void);
102 UInt32
getOverridePriority(void);
105 /*---------------------------------------------------------------------*/
109 virtual NodeTransitPtr
read ( std::istream
&is
,
110 const Char8
*fileNameOrExtension
,
111 Resolver resolver
= NULL
) const;
113 #ifndef OSG_DISABLE_DEPRECATED
114 virtual NodeTransitPtr
readFile(const Char8
*fileName
) const;
118 /*---------------------------------------------------------------------*/
122 virtual bool write (Node
* const node
,
124 Char8
const *fileNameOrExtension
) const;
126 #ifndef OSG_DISABLE_DEPRECATED
127 virtual bool writeFile(Node
* const node
,
128 Char8
const *fileName
) const;
132 /*---------------------------------------------------------------------*/
139 /*========================= PROTECTED ===============================*/
143 /*---------------------------------------------------------------------*/
147 /*! List of valid suffixes for this loader. */
148 std::list
<std::string
> _suffixList
;
150 /*! If true loader can override others. */
152 /*! The priority for overriding. */
153 UInt32 _overridePriority
;
156 /*---------------------------------------------------------------------*/
157 /*! \name Constructors */
160 SceneFileType(const Char8
*suffixArray
[],
161 UInt16 suffixByteCount
,
163 UInt32 overridePriority
,
164 UInt32 flags
= OSG_READ_SUPPORTED
);
166 SceneFileType(const SceneFileType
&obj
);
169 /*---------------------------------------------------------------------*/
170 /*! \name Termination */
173 virtual void terminate(void);
176 /*========================== PRIVATE ================================*/
180 friend class SceneFileHandlerBase
;
182 /*!\brief prohibit default function (move to 'public' if needed) */
183 void operator =(const SceneFileType
&source
);
186 typedef SceneFileType
* SceneFileTypeP
;
190 #endif // _OSGSCENEFILETYPE_H_