Coin Logo http://www.sim.no/
http://www.coin3d.org/

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
32class SbName;
33class SbTime;
34class SoBase;
35class SoField;
36class SoInput;
37class SoNode;
38class SoPath;
39class SoSeparator;
40class SoVRMLGroup;
41class SoGroup;
42
43typedef void SoDBHeaderCB(void * data, SoInput * input);
44
45
46class COIN_DLL_API SoDB {
47public:
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
113private:
114 static SoGroup * readAllWrapper(SoInput * input, const SoType & grouptype);
115};
116
117#endif // !COIN_SODB_H
The SbName class stores strings by reference.
Definition SbName.h:31
The SbString class is a string class with convenience functions for string operations.
Definition SbString.h:42
The SbTime class instances represents time values.
Definition SbTime.h:41
The SoBase class is the top-level superclass for a number of class-hierarchies.
Definition SoBase.h:36
The SoDB class keeps track of internal global data.
Definition SoDB.h:46
SbBool ProgressCallbackType(const SbName &itemid, float fraction, SbBool interruptible, void *userdata)
Definition SoDB.h:97
The SoField class is the top-level abstract base class for fields.
Definition SoField.h:38
The SoGroup class is a node which managed other node instances.
Definition SoGroup.h:31
The SoInput class is an abstraction of file import functionality.
Definition SoInput.h:52
The SoNode class is the base class for nodes used in scene graphs.
Definition SoNode.h:47
The SoPath class is a container class for traversal path descriptions.
Definition SoPath.h:43
The SoSensorManager class handles the sensor queues.
Definition SoSensorManager.h:34
The SoSeparator class is a state-preserving group node.
Definition SoSeparator.h:35
The SoType class is the basis for the run-time type system in Coin.
Definition SoType.h:50
The SoVRMLGroup class is used for grouping VRML nodes.
Definition SoVRMLGroup.h:36

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

Generated on Wed Jul 17 2024 for Coin by Doxygen 1.12.0.