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 #ifndef _OSGSCENEFILETYPE_H_
00040 #define _OSGSCENEFILETYPE_H_
00041 #ifdef __sgi
00042 #pragma once
00043 #endif
00044
00045 #include <OSGSystemDef.h>
00046 #include <list>
00047 #include <iostream>
00048 #include <string>
00049
00050 #include <OSGBaseTypes.h>
00051 #include <OSGIDString.h>
00052 #include <OSGNodePtr.h>
00053
00054 OSG_BEGIN_NAMESPACE
00055
00060 class OSG_SYSTEMLIB_DLLMAPPING SceneFileType
00061 {
00062
00063 public:
00064
00065 typedef std::vector<FieldContainerPtr> FCPtrStore;
00066
00067
00071 virtual const Char8 *getName(void) const = 0;
00072
00074
00078 enum
00079 {
00080 OSG_READ_SUPPORTED = 1,
00081 OSG_WRITE_SUPPORTED = 2
00082 };
00083
00085
00089 virtual ~SceneFileType(void);
00090
00092
00096 void setOptions(const Char8 *options);
00097
00098
00100
00104 virtual std::list<IDString> &suffixList (void);
00105
00106 bool doOverride (void);
00107 UInt32 getOverridePriority(void);
00108 UInt32 getFlags (void);
00109
00110 const Char8 *getOptions (void);
00111
00113
00117 virtual NodePtr read (std::istream &is,
00118 const Char8 *fileNameOrExtension) const;
00119
00120 #ifndef OSG_DISABLE_DEPRECATED
00121 virtual NodePtr readFile (const Char8 *fileName) const;
00122 #endif
00123
00125
00129 virtual bool write(const NodePtr &node, std::ostream &os,
00130 const Char8 *fileNameOrExtension) const;
00131
00132 #ifndef OSG_DISABLE_DEPRECATED
00133 virtual bool writeFile(const NodePtr &node,
00134 const Char8 *fileName) const;
00135 #endif
00136
00138
00142 void print(void);
00143
00145
00146 protected:
00147
00148
00152 std::list<IDString> _suffixList;
00153
00154 bool _override;
00155 UInt32 _overridePriority;
00156 UInt32 _flags;
00157
00158 std::string _options;
00159
00161
00165 SceneFileType(const Char8 *suffixArray[],
00166 UInt16 suffixByteCount,
00167 bool override,
00168 UInt32 overridePriority,
00169 UInt32 flags = OSG_READ_SUPPORTED);
00170
00171 SceneFileType(const SceneFileType &obj);
00172
00174
00175 private:
00176
00178 void operator =(const SceneFileType &source);
00179 };
00180
00181 typedef SceneFileType* SceneFileTypeP;
00182
00183 OSG_END_NAMESPACE
00184
00185 #define OSGSCENEFILETYPE_HEADER_CVSID "@(#)$Id: $"
00186
00187 #endif // _OSGSCENEFILETYPE_H_