Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

OSGBINSceneFileType.cpp

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002  *                                OpenSG                                     *
00003  *                                                                           *
00004  *                                                                           *
00005  *             Copyright (C) 2000-2002 by the OpenSG Forum                   *
00006  *                                                                           *
00007  *                            www.opensg.org                                 *
00008  *                                                                           *
00009  *   contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de          *
00010  *                                                                           *
00011 \*---------------------------------------------------------------------------*/
00012 /*---------------------------------------------------------------------------*\
00013  *                                License                                    *
00014  *                                                                           *
00015  * This library is free software; you can redistribute it and/or modify it   *
00016  * under the terms of the GNU Library General Public License as published    *
00017  * by the Free Software Foundation, version 2.                               *
00018  *                                                                           *
00019  * This library is distributed in the hope that it will be useful, but       *
00020  * WITHOUT ANY WARRANTY; without even the implied warranty of                *
00021  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
00022  * Library General Public License for more details.                          *
00023  *                                                                           *
00024  * You should have received a copy of the GNU Library General Public         *
00025  * License along with this library; if not, write to the Free Software       *
00026  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                 *
00027  *                                                                           *
00028 \*---------------------------------------------------------------------------*/
00029 /*---------------------------------------------------------------------------*\
00030  *                                Changes                                    *
00031  *                                                                           *
00032  *                                                                           *
00033  *                                                                           *
00034  *                                                                           *
00035  *                                                                           *
00036  *                                                                           *
00037 \*---------------------------------------------------------------------------*/
00038 
00039 #include <stdlib.h>
00040 #include <stdio.h>
00041 
00042 #include "OSGConfig.h"
00043 
00044 #include <iostream>
00045 #include <fstream>
00046 
00047 #include <OSGLog.h>
00048 #include <OSGNode.h>
00049 #include <OSGGeometry.h>
00050 #include <OSGGeoProperty.h>
00051 #include <OSGSimpleMaterial.h>
00052 
00053 #include "OSGBINSceneFileType.h"
00054 #include "OSGBINLoader.h"
00055 #include "OSGBINWriter.h"
00056 
00057 OSG_USING_NAMESPACE
00058 
00065 #if defined(OSG_WIN32_ICL) && !defined(OSG_CHECK_FIELDSETARG)
00066 #pragma warning(disable : 383)
00067 #endif
00068 
00069 /*-------------------------------------------------------------------------*/
00070 /*                            static get                                   */
00071 
00074 BINSceneFileType &BINSceneFileType::the(void)
00075 {
00076     return _the;
00077 }
00078 
00079 /*-------------------------------------------------------------------------*/
00080 /*                            destructor                                   */
00081 
00084 BINSceneFileType::~BINSceneFileType(void)
00085 {
00086     return;
00087 }
00088 
00089 #ifdef __sgi
00090 #pragma set woff 1209
00091 #endif
00092 
00093 /*-------------------------------------------------------------------------*/
00094 /*                            read                                         */
00095 
00098 NodePtr BINSceneFileType::read(std::istream &is, const Char8 *) const
00099 {
00100     BINLoader loader(is);
00101     loader.read();
00102     return loader.getRootNode();
00103 }
00104 
00105 #ifdef __sgi
00106 #pragma reset woff 1209
00107 #endif
00108 
00109 /*-------------------------------------------------------------------------*/
00110 /*                            write                                        */
00111 
00114 bool BINSceneFileType::write(const NodePtr &node,
00115                              std::ostream &os, const Char8 *) const
00116 {
00117     BINWriter writer(os);
00118     return writer.write(node);
00119 }
00120 
00121 /*-------------------------------------------------------------------------*/
00122 /*                            Constructors                                 */
00123 
00126 BINSceneFileType::BINSceneFileType(const Char8 *suffixArray[],
00127                                    UInt16 suffixByteCount, bool override,
00128                                    UInt32 overridePriority,
00129                                    UInt32 flags) :
00130         SceneFileType(suffixArray, suffixByteCount, override, overridePriority,
00131                       flags)
00132 {
00133 }
00134 
00137 BINSceneFileType::BINSceneFileType(const BINSceneFileType &obj) :
00138     SceneFileType(obj)
00139 {
00140     return;
00141 }
00142 
00145 const Char8 *BINSceneFileType::getName(void) const
00146 {
00147     return "BIN GEOMETRY";
00148 }
00149 
00150 /*-------------------------------------------------------------------------*/
00151 /*                              static elements                            */
00152 
00153 const Char8 *    BINSceneFileType::_suffixA[] = { "bin" };
00154 BINSceneFileType BINSceneFileType:: _the(_suffixA,
00155                                          sizeof(_suffixA), false, 10,
00156                                          OSG_READ_SUPPORTED | 
00157                                          OSG_WRITE_SUPPORTED);
00158 
00159 /*-------------------------------------------------------------------------*/
00160 /*                              cvs id's                                   */
00161 
00162 #ifdef __sgi
00163 #pragma set woff 1174
00164 #endif
00165 #ifdef OSG_LINUX_ICC
00166 #pragma warning(disable : 177)
00167 #endif
00168 
00169 namespace
00170 {
00171     static Char8    cvsid_cpp[] = "@(#)$Id: $";
00172     static Char8    cvsid_hpp[] = OSGBINSCENEFILETYPE_HEADER_CVSID;
00173 }

Generated on Thu Aug 25 04:01:19 2005 for OpenSG by  doxygen 1.4.3