fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / FileIO / OpenFlight / OSGOpenFlightSceneFileType.cpp
blob5a9a23d56d516f1fd0a3f64b8ae49ba7dbe01973
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-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 //---------------------------------------------------------------------------
40 // Includes
41 //---------------------------------------------------------------------------
43 #include <cstdlib>
44 #include <cstdio>
46 #include "OSGConfig.h"
48 #include "OSGOpenFlightSceneFileType.h"
50 #include "OSGOFDatabase.h"
52 OSG_USING_NAMESPACE
55 /*! \class OSG::OSGSceneFileType
56 \ingroup GrpSystemFileIO
60 /***************************************************************************\
61 * Types *
62 \***************************************************************************/
64 /***************************************************************************\
65 * Class variables *
66 \***************************************************************************/
68 const Char8 *OpenFlightSceneFileType::_suffixA[] = { "flt" };
70 OpenFlightSceneFileType OpenFlightSceneFileType::_the(_suffixA,
71 sizeof(_suffixA),
72 false,
73 10,
74 OSG_READ_SUPPORTED);
76 /***************************************************************************\
77 * Class methods *
78 \***************************************************************************/
80 /*-------------------------------------------------------------------------*\
81 - public -
82 \*-------------------------------------------------------------------------*/
84 OpenFlightSceneFileType &OpenFlightSceneFileType::the(void)
86 return _the;
89 /*-------------------------------------------------------------------------*\
90 - protected -
91 \*-------------------------------------------------------------------------*/
93 /*-------------------------------------------------------------------------*\
94 - private -
95 \*-------------------------------------------------------------------------*/
97 /***************************************************************************\
98 * Instance methods *
99 \***************************************************************************/
101 /*-------------------------------------------------------------------------*\
102 - public -
103 \*-------------------------------------------------------------------------*/
105 /*------------------------------ access -----------------------------------*/
107 const Char8 *OpenFlightSceneFileType::getName(void) const
109 return "OpenFlight file format";
113 NodeTransitPtr OpenFlightSceneFileType::read( std::istream &is,
114 const Char8 *,
115 Resolver resolver) const
117 NodeTransitPtr returnValue(NULL);
118 OFDatabase db;
120 bool rc = db.read(is);
122 if(rc == true)
124 returnValue = db.convert();
127 commitChanges();
129 return returnValue;
133 /*---------------------------- properties ---------------------------------*/
135 /*-------------------------- your_category---------------------------------*/
137 /*-------------------------- assignment -----------------------------------*/
139 /*-------------------------- comparison -----------------------------------*/
142 /*-------------------------------------------------------------------------*\
143 - protected -
144 \*-------------------------------------------------------------------------*/
147 /** \brief Constructor
150 OpenFlightSceneFileType::OpenFlightSceneFileType(const char *suffixArray[],
151 UInt16 suffixByteCount,
152 bool override,
153 UInt32 overridePriority,
154 UInt32 flags) :
155 Inherited(suffixArray,
156 suffixByteCount,
157 override,
158 overridePriority,
159 flags)
161 return;
165 /** \brief Destructor
168 OpenFlightSceneFileType::~OpenFlightSceneFileType(void)