| http://www.sim.no/ http://www.coin3d.org/

- Main Page
- Related Pages
- Modules
- Classes
- Files

- File List
- File Members

SoDB.h
1 #ifndef COIN_SODB_H
2 #define COIN_SODB_H
3
4 /**************************************************************************\
5 *
6 * This file is part of the Coin 3D visualization library.
7 * Copyright (C) by Kongsberg Oil & Gas Technologies.
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * ("GPL") version 2 as published by the Free Software Foundation.
12 * See the file LICENSE.GPL at the root directory of this source
13 * distribution for additional information about the GNU GPL.
14 *
15 * For using Coin with software that can not be combined with the GNU
16 * GPL, and for taking advantage of the additional benefits of our
17 * support services, please contact Kongsberg Oil & Gas Technologies
18 * about acquiring a Coin Professional Edition License.
19 *
20 * See http://www.coin3d.org/ for more information.
21 *
22 * Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
23 * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
24 *
25 \**************************************************************************/
26
27 #include <Inventor/SbBasic.h>
28 #include <Inventor/SbString.h>
29 #include <Inventor/SoType.h>
30 #include <Inventor/sensors/SoSensorManager.h>
31
32 class SbName;
33 class SbTime;
34 class SoBase;
35 class SoField;
36 class SoInput;
37 class SoNode;
38 class SoPath;
39 class SoSeparator;
40 class SoVRMLGroup;
41 class SoGroup;
42
43 typedef void SoDBHeaderCB(void * data, SoInput * input);
44
45
46 class COIN_DLL_API SoDB {
47 public:
48 static void init(void);
49 static void finish(void);
50 static void cleanup(void);
51
52 static const char * getVersion(void);
53 static SbBool read(SoInput * input, SoPath *& path);
54 static SbBool read(SoInput * input, SoBase *& base);
55 static SbBool read(SoInput * input, SoNode *& rootnode);
56 static SoSeparator * readAll(SoInput * input);
57 static SoVRMLGroup * readAllVRML(SoInput * input);
58 static SbBool isValidHeader(const char * teststring);
59 static SbBool registerHeader(const SbString & headerstring,
60 SbBool isbinary,
61 float ivversion,
62 SoDBHeaderCB * precallback,
63 SoDBHeaderCB * postcallback,
64 void * userdata = NULL);
65 static SbBool getHeaderData(const SbString & headerstring,
66 SbBool & isbinary,
67 float & ivversion,
68 SoDBHeaderCB *& precallback,
69 SoDBHeaderCB *& postcallback,
70 void *& userdata,
71 SbBool substringok = FALSE);
72 static int getNumHeaders(void);
73 static SbString getHeaderString(const int i);
74 static SoField * createGlobalField(const SbName & name, SoType type);
75 static SoField * getGlobalField(const SbName & name);
76 static void renameGlobalField(const SbName & from, const SbName & to);
77
78 static void setRealTimeInterval(const SbTime & interval);
79 static const SbTime & getRealTimeInterval(void);
80 static void enableRealTimeSensor(SbBool on);
81
82 static SoSensorManager * getSensorManager(void);
83 static void setDelaySensorTimeout(const SbTime & t);
84 static const SbTime & getDelaySensorTimeout(void);
85 static int doSelect(int nfds, void * readfds, void * writefds,
86 void * exceptfds, struct timeval * usertimeout);
87
88 static void addConverter(SoType from, SoType to, SoType converter);
89 static SoType getConverter(SoType from, SoType to);
90
91 static SbBool isInitialized(void);
92
93 static void startNotify(void);
94 static SbBool isNotifying(void);
95 static void endNotify(void);
96
97 typedef SbBool ProgressCallbackType(const SbName & itemid, float fraction,
98 SbBool interruptible, void * userdata);
99 static void addProgressCallback(ProgressCallbackType * func, void * userdata);
100 static void removeProgressCallback(ProgressCallbackType * func, void * userdata);
101
102 static SbBool isMultiThread(void);
103 static void readlock(void);
104 static void readunlock(void);
105 static void writelock(void);
106 static void writeunlock(void);
107
108 static void createRoute(SoNode * from, const char * eventout,
109 SoNode * to, const char * eventin);
110 static void removeRoute(SoNode * from, const char * eventout,
111 SoNode * to, const char * eventin);
112
113 private:
114 static SoGroup * readAllWrapper(SoInput * input, const SoType & grouptype);
115 };
116
117 #endif // !COIN_SODB_H

Copyright © 1998-2010 by Kongsberg Oil & Gas Technologies. All rights reserved.