00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
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
00071
00074 BINSceneFileType &BINSceneFileType::the(void)
00075 {
00076 return _the;
00077 }
00078
00079
00080
00081
00084 BINSceneFileType::~BINSceneFileType(void)
00085 {
00086 return;
00087 }
00088
00089 #ifdef __sgi
00090 #pragma set woff 1209
00091 #endif
00092
00093
00094
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
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
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
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
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 }