1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2002,2007 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 \*---------------------------------------------------------------------------*/
42 #include "OSGConfig.h"
49 #include "OSGGeometry.h"
50 #include "OSGGeoProperty.h"
51 #include "OSGSimpleMaterial.h"
53 #include "OSGNFIOSceneFileType.h"
55 #include "OSGOSBDriver.h"
59 /*! \class OSG::NFIOSceneFileType
60 \ingroup GrpSystemFileIO
62 Loader for the binary file type. (.osb)
65 #if defined(OSG_WIN32_ICL) && !defined(OSG_CHECK_FIELDSETARG)
66 #pragma warning(disable : 383)
69 /*-------------------------------------------------------------------------*/
72 /*! Returns the singleton instance.
74 NFIOSceneFileType
&NFIOSceneFileType::the(void)
79 /*-------------------------------------------------------------------------*/
82 /*! Destructor, does nothing.
84 NFIOSceneFileType::~NFIOSceneFileType(void)
92 /*-------------------------------------------------------------------------*/
95 /*! Read from the given input stream.
98 NodeTransitPtr
NFIOSceneFileType::read( std::istream
&is
,
102 return OSBDriver::read(is
, getOptions());
106 #pragma reset woff 1209
109 /*-------------------------------------------------------------------------*/
112 /*! Writes the given \a node and its subtree to the given output stream.
115 \param[in] node Root of the subtree to write.
116 \param[in] os Output stream to write to.
117 \param[in] fileNameOrExtension filename or file extension
118 \return True if the operation succeeded, false otherwise.
120 bool NFIOSceneFileType::write(Node
* const node
,
122 Char8
const *fileNameOrExtension
) const
124 return OSBDriver::write(node
, os
, getOptions());
127 /*-------------------------------------------------------------------------*/
131 \see SceneFileType::SceneFileType
133 NFIOSceneFileType::NFIOSceneFileType(const Char8
*suffixArray
[],
134 UInt16 suffixByteCount
,
136 UInt32 overridePriority
,
138 : SceneFileType(suffixArray
, suffixByteCount
, override
,
139 overridePriority
, flags
)
143 /*! Copy constructor.
145 NFIOSceneFileType::NFIOSceneFileType(const NFIOSceneFileType
&obj
) :
150 /*! Returns a descriptive name for the type of files read.
152 const Char8
*NFIOSceneFileType::getName(void) const
157 /*-------------------------------------------------------------------------*/
158 /* static elements */
160 const Char8
* NFIOSceneFileType::_suffixA
[] = { "osb" };
161 NFIOSceneFileType
NFIOSceneFileType::_the(_suffixA
,
162 sizeof(_suffixA
), false, 10,
164 OSG_WRITE_SUPPORTED
);