00001 #ifndef COIN_SODB_H
00002 #define COIN_SODB_H
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 #include <Inventor/SbBasic.h>
00028 #include <Inventor/SbString.h>
00029 #include <Inventor/SoType.h>
00030 #include <Inventor/sensors/SoSensorManager.h>
00031
00032 class SbName;
00033 class SbTime;
00034 class SoBase;
00035 class SoField;
00036 class SoInput;
00037 class SoNode;
00038 class SoPath;
00039 class SoSeparator;
00040 class SoVRMLGroup;
00041 class SoGroup;
00042
00043 typedef void SoDBHeaderCB(void * data, SoInput * in);
00044
00045
00046 class COIN_DLL_API SoDB {
00047 public:
00048 static void init(void);
00049 static void cleanup(void);
00050
00051 static const char * getVersion(void);
00052 static SbBool read(SoInput * in, SoPath *& path);
00053 static SbBool read(SoInput * in, SoBase *& base);
00054 static SbBool read(SoInput * in, SoNode *& rootnode);
00055 static SoSeparator * readAll(SoInput * in);
00056 static SoVRMLGroup * readAllVRML(SoInput * in);
00057 static SbBool isValidHeader(const char * teststring);
00058 static SbBool registerHeader(const SbString & headerstring,
00059 SbBool isbinary,
00060 float ivversion,
00061 SoDBHeaderCB * precallback,
00062 SoDBHeaderCB * postcallback,
00063 void * userdata = NULL);
00064 static SbBool getHeaderData(const SbString & headerstring,
00065 SbBool & isbinary,
00066 float & ivversion,
00067 SoDBHeaderCB *& precallback,
00068 SoDBHeaderCB *& postcallback,
00069 void *& userdata,
00070 SbBool substringok = FALSE);
00071 static int getNumHeaders(void);
00072 static SbString getHeaderString(const int i);
00073 static SoField * createGlobalField(const SbName & name, SoType type);
00074 static SoField * getGlobalField(const SbName & name);
00075 static void renameGlobalField(const SbName & from, const SbName & to);
00076
00077 static void setRealTimeInterval(const SbTime & interval);
00078 static const SbTime & getRealTimeInterval(void);
00079 static void enableRealTimeSensor(SbBool on);
00080
00081 static SoSensorManager * getSensorManager(void);
00082 static void setDelaySensorTimeout(const SbTime & t);
00083 static const SbTime & getDelaySensorTimeout(void);
00084 static int doSelect(int nfds, void * readfds, void * writefds,
00085 void * exceptfds, struct timeval * usertimeout);
00086
00087 static void addConverter(SoType from, SoType to, SoType converter);
00088 static SoType getConverter(SoType from, SoType to);
00089
00090 static SbBool isInitialized(void);
00091
00092 static void startNotify(void);
00093 static SbBool isNotifying(void);
00094 static void endNotify(void);
00095
00096 private:
00097 static SoGroup * readAllWrapper(SoInput * in, const SoType & grouptype);
00098 };
00099
00100 #endif // !COIN_SODB_H