public class SoDB
extends java.lang.Object
SoDB
class holds all scene graphs, each representing a 3D scene used by an application. A scene graph is a collection of SoNode
objects which come in several varieties (see SoNode
).
All methods in this class are static.
Data Files:
Open Inventor also supports many standard CAD file formats. See SoCADInputReader for the current list. Also see SoCADFileFormat.
Version Number:
Please use the
See also:
SoDB
also provides convenient methods for reading data files, for example:
Open Inventor has built-in support for reading the following file formats:
SoSTLFileFormat
and SoSTLInputReader
)
SoLicensesInfo
class to query the Open Inventor version number.
SoBase
, SoNode
, SoEngine
, SoField
, SoInput
, SoFile
, SoPath
, SoOneShotSensor
, SoDataSensor
, SoWin
Modifier and Type | Class and Description |
---|---|
static class |
SoDB.RenderCacheModes
Render cache modes.
|
Modifier and Type | Field and Description |
---|---|
static int |
AUTO_RENDER_CACHE
Deprecated.
Use
SoDB.RenderCacheModes.AUTO_RENDER_CACHE instead. |
static int |
COMPILE
Deprecated.
Use
SoDB.RenderCacheModes.COMPILE instead. |
static int |
COMPILE_AND_EXECUTE
Deprecated.
Use
SoDB.RenderCacheModes.COMPILE_AND_EXECUTE instead. |
Modifier and Type | Method and Description |
---|---|
static void |
addConverter(java.lang.Class<? extends Inventor> fromField,
java.lang.Class<? extends Inventor> toField,
java.lang.Class<? extends Inventor> converterEngine)
Registers a field conversion engine that can be used to convert from one type of field to another.
|
static boolean |
addPlugin(java.lang.String fileName)
Loads a plugin library.
|
static boolean |
addPluginsDirectory(java.lang.String dirName)
Adds a directory to search for libraries defining new Open Inventor plugins.
|
static SoField |
createGlobalField(java.lang.String name,
java.lang.Class<? extends Inventor> type)
The database maintains a namespace for global fields, making sure that there is at most one instance of a global field with any given name in the database.
|
static void |
createRoute(SoNode pFromNode,
java.lang.String fromEventOutName,
SoNode pInNode,
java.lang.String toEventInName)
Creates a VRML 2.0 ROUTE-TO connection.
|
static java.lang.Class<? extends Inventor> |
getConverter(java.lang.Class<? extends Inventor> fromField,
java.lang.Class<? extends Inventor> toField)
Returns the field conversion engine registered for the two given field types.
|
static SbTime |
getCurrentTime()
Returns the current time.
|
static SbTime |
getDelaySensorTimeout()
Returns the current delay queue timeout value.
|
static SoField |
getGlobalField(java.lang.String name)
Returns the global field with the given name, or NULL if there is none.
|
static java.lang.String |
getHeaderString(int i)
Returns the i'th header.
|
static boolean |
getIvTuneAllowed()
Returns true if IvTune can be launched interactively using the keyboard shortcut.
|
static float |
getLicensingVersionNumber()
Deprecated.
As of Open Inventor 9800 See documentation for more details
|
static int |
getNumHeaders()
Returns the number of valid headers, including standard Open Inventor headers, and user-registered headers.
|
static int |
getNumRenderCaches()
Returns the current maximum number of render caches.
|
static SbTime |
getRealTimeInterval()
Returns how often the database is updating the realTime global field.
|
static SoDB.RenderCacheModes |
getRenderCacheMode()
Returns the current render cache mode.
|
static SoSensorManager |
getSensorManager()
Deprecated.
useless
|
static java.lang.String |
getVersion()
Deprecated.
As of Open Inventor 9800 See documentation for more details
|
static boolean |
isMultiThread()
Returns whether multi-thread support is enabled in Open Inventor.
|
static boolean |
isPrioritizedChildrenCaching()
Deprecated.
As of Open Inventor 9000 See documentation for more details
|
static boolean |
isValidHeader(java.lang.String testString)
This returns true if the given character string is one of the valid Open Inventor file headers, (e.g., "#Inventor V2.0 binary"), or if the string has been registered as a valid header through the registerHeader() method.
|
static int |
LicenseCheck(java.lang.String productName,
float version)
Deprecated.
|
static int |
LicenseCheck(java.lang.String productName,
float version,
java.lang.String licenseString)
Deprecated.
|
static int |
LicenseCheck(java.lang.String productName,
float version,
java.lang.String licenseString,
boolean printWarning)
Deprecated.
|
static int |
LicenseCheck(java.lang.String productName,
float version,
java.lang.String licenseString,
boolean printWarning,
java.lang.String[] errReport)
Deprecated.
As of Open Inventor 9800 See documentation for more details
|
static void |
prioritizeChildrenCaching(boolean onOff)
Deprecated.
As of Open Inventor 9000 See documentation for more details
|
static void |
processEvents()
Process Open Inventor sensor queues (TimerQueue and DelayQueue).
|
static SoNode |
read(SoInput in)
Reads a graph from the file specified by the given
SoInput , returning the resulting root node. |
static SoSeparator |
readAll(SoInput in)
Reads all graphs and paths from the file specified by the given
SoInput . |
static SoVRMLGroup |
readAllVRML(SoInput in)
Deprecated.
As of Open Inventor 9810 See documentation for more details
|
static void |
readlock()
Acquire a non-exclusive global scene graph read-lock.
|
static SoNode |
readNode(SoInput in) |
static SoPath |
readPath(SoInput in)
Reads a graph from the file specified by the given
SoInput , returning the resulting path. |
static SoVRMLPROTODef |
readPROTOFromFile(SoInput in,
java.lang.String name)
Reads all PROTOs in the specified input file up to and including the named PROTO and returns the definition of the named PROTO in protoDef.
|
static void |
readunlock()
Release a non-exclusive global scene graph read-lock.
|
static void |
removeConverter(java.lang.Class<? extends Inventor> fromField,
java.lang.Class<? extends Inventor> toField)
Remove a previously added converter.
|
static boolean |
removePlugin(java.lang.String fileName)
Unloads the specified plugin library.
|
static boolean |
removePluginsDirectory(java.lang.String dirName)
Remove directory from the list of search directories for plugin loading.
|
static void |
removeRoute(SoNode pFromNode,
java.lang.String fromEventOutName,
SoNode pInNode,
java.lang.String toEventInName)
Removes a VRML 2.0 ROUTE-TO connection.
|
static void |
renameGlobalField(java.lang.String oldName,
java.lang.String newName)
Renames the global field named oldName.
|
static void |
setDelaySensorTimeout(SbTime t)
This sets the timeout value for sensors that are delay queue sensors (one-shot sensors, data sensors).
|
static void |
setIvTuneAllowed(boolean ivTuneAllowed)
Specifies if launching IvTune interactively using the keyboard shortcut is allowed.
|
static void |
setNumRenderCaches(int num)
This method sets the maximum number of caches for nodes that create render caches.
|
static void |
setRealTimeInterval(SbTime deltaT)
The database automatically creates one global field when SoDB.init() is called.
|
static void |
setRenderCacheMode(SoDB.RenderCacheModes mode)
This method specifies the way render caches (display lists) will be created.
|
static void |
setSystemTimer(SoSystemTimer timer)
The system dependent timer allows Inventor to manage its sensor queue (for timers, animation) when creating custom viewers.
|
static void |
startInternalThreads()
Deprecated.
As of Open Inventor 9.2, use
Inventor.startInternalThreads()
instead. |
static void |
stopInternalThreads()
Deprecated.
As of Open Inventor 9.2, use
Inventor.stopInternalThreads()
instead. |
static void |
writelock()
Acquire the global scene graph write-lock.
|
static void |
writeunlock()
Release the global scene graph write-lock.
|
@Deprecated public static final int COMPILE
SoDB.RenderCacheModes.COMPILE
instead.@Deprecated public static final int COMPILE_AND_EXECUTE
SoDB.RenderCacheModes.COMPILE_AND_EXECUTE
instead.@Deprecated public static final int AUTO_RENDER_CACHE
SoDB.RenderCacheModes.AUTO_RENDER_CACHE
instead.public static SoSensorManager getSensorManager()
@Deprecated public static void startInternalThreads()
Inventor.startInternalThreads()
instead.@Deprecated public static void stopInternalThreads()
Inventor.stopInternalThreads()
instead.@Deprecated public static int LicenseCheck(java.lang.String productName, float version, java.lang.String licenseString)
@Deprecated public static int LicenseCheck(java.lang.String productName, float version)
@Deprecated public static int LicenseCheck(java.lang.String productName, float version, java.lang.String licenseString, boolean printWarning)
public static SbTime getRealTimeInterval()
setRealTimeInterval()
. The realTime global field can be accessed like this: SoSFTime* realTimeField = (SoSFTime*)SoDB.getGlobalField( "realTime" );
public static int getNumHeaders()
public static SoField getGlobalField(java.lang.String name)
createGlobalField()
. The type of the field may be checked using the SoField.isOfType(), SoField.getClassTypeId(), and SoField.getTypeId() methods.public static void renameGlobalField(java.lang.String oldName, java.lang.String newName)
getGlobalField()
method can be used to guard against this). See createGlobalField()
.public static void setRealTimeInterval(SbTime deltaT)
SoSFTime
, can be connected to engines and nodes for real-time animation. The database will automatically update the realTime global field 12 times per second, using a timer sensor. Typically, there will be a node sensor on the root of the scene graph which schedules a redraw whenever the scene graph changes; by updating the realTime global field periodically, scene graphs that are connected to realTime (and are therefore animating) will be redrawn. The rate at which the database updates realTime can be controlled with this routine. Passing in a zero time will disable automatic update of realTime . If there are no enabled connections from the realTime field to any other field, the sensor is automatically disabled. Note that the SoSceneManager
class automatically updates realTime immediately after redrawing, which will result in as high a frame rate as possible if the scene is continuously animating. This method ensures that engines that do not continuously animate (such as SoTimeCounter
) will eventually be scheduled. See also getRealTimeInterval()
. The realTime global field can be accessed like this: SoSFTime realTimeField = (SoSFTime)SoDB.getGlobalField( "realTime" );
public static java.lang.String getHeaderString(int i)
public static boolean isValidHeader(java.lang.String testString)
public static SoField createGlobalField(java.lang.String name, java.lang.Class<? extends Inventor> type)
All global fields must be derived from SoField
; typically the result of this routine is cast into the appropriate type. For example:
SoSFInt32 intField = (SoSFInt32)SoDB.createGlobalField("Frame", SoSFInt32.class);
public static void removeRoute(SoNode pFromNode, java.lang.String fromEventOutName, SoNode pInNode, java.lang.String toEventInName)
createRoute()
.public static SoNode read(SoInput in)
SoInput
, returning the resulting root node. There is an alternate read routine that returns the resulting path. The programmer is responsible for determining which routine to use, based on the contents of the input. These routines return null if any error occurred during reading.
If the passed SoInput
was used to open a file and the name of the file contains a directory, SoDB
automatically adds the directory to the end of the current directory search path in the SoInput
. This means that nested files named in SoFile
nodes may be found relative to that directory. The directory is removed from the search path when reading is complete.
public static SoPath readPath(SoInput in)
SoInput
, returning the resulting path.
There is an alternate read routine that returns the resulting root node. The programmer is responsible for determining which routine to use, based on the contents of the input. These routines return null if any error occurred during reading.
If the passed SoInput
was used to open a file and the name of the file contains a directory, SoDB
automatically adds the directory to the end of the current directory search path in the SoInput
. This means that nested files named in SoFile
nodes may be found relative to that directory. The directory is removed from the search path when reading is complete.
@Deprecated public static java.lang.String getVersion()
For a floating point version number see #getLicensingVersionNumber.Deprecated since Open Inventor 9800
please use SoLicensesInfo.getVersion()
instead
public static boolean addPlugin(java.lang.String fileName)
SoInputReader
.
A plugin library must implement the initPlugin() and exitPlugin() C-formatted entry-points. The initPlugin() function is responsible for registering the new class (or classes) in the Open Inventor database through the standard SoType type creation mechanism. The exitPlugin() function is used to disable the use of the custom class(s) by removing the corresponding type(s) from the Open Inventor database.
By default, Open Inventor attempts to load all files that may be plugins (files with the extension .dll or .so depending on the platform) from the following locations:
SoDB.addPluginsDirectory()
method.
Specific plugin libraries can be loaded and unloaded by direct calls to the SoDB.addPlugin()
and SoDB.removePlugin()
methods.
Different plugins can be designed depending on their usage. Please refer to the Open Inventor plugin section in the documentation
public static void setSystemTimer(SoSystemTimer timer)
SoRenderAreaCore
. However OpenInventor Java does not support an application that mixes any viewer from "com.openinventor.inventor.awt" package and viewers based on viewer components in "com.openinventor.inventor.viewercomponents" package.public static SoVRMLPROTODef readPROTOFromFile(SoInput in, java.lang.String name)
public static void createRoute(SoNode pFromNode, java.lang.String fromEventOutName, SoNode pInNode, java.lang.String toEventInName)
ROUTE pFromNode.fromEventOut
TO pToNode.toEventIn
in a VRML 2.0 file.
public static SoSeparator readAll(SoInput in)
SoInput
.
If there is only one graph in the file and its root is an SoSeparator
, the root is returned. In all other cases, this creates an SoSeparator
, adds the root nodes of all graphs read as children of it, and returns it. This returns NULL on error. This processes directory paths in the same way as the other reading routines.
Reading an OpenFlight file into Open Inventor is just like reading in an Open Inventor format file. Open Inventor will open the file and automatically detect that it is an OpenFlight file. Optionally, you can tell Open Inventor explicitly that the file type is OpenFlight. See SoInput
for details about support of the OpenFlight format.
Reading a DXF file into Open Inventor is just like reading in an Open Inventor format file. Open Inventor will open the file and automatically detect that it is a DXF file. Optionally, you can tell Open Inventor explicitly that the file type is DXF. See SoInput
for details about support of the DXF format.
@Deprecated public static SoVRMLGroup readAllVRML(SoInput in)
SoInput
.
If there is only one graph in the file and its root is an SoVRMLGroup
, the root is returned. In all other cases, this creates an SoVRMLGroup
, adds the root nodes to its children field, and returns it. This returns NULL on error. This processes directory paths in the same way as the other reading routines.Deprecated since Open Inventor 9810 public static void setDelaySensorTimeout(SbTime t)
The default timeout for delay queue sensors is 0.083 seconds. So if delay queue sensors are only triggered by the timeout, then by default the viewer animation can only run at about 12 frames per second. To trigger the delay queue sensors at, for example, 30 frames per second, make this call:
SoDB.setDelaySensorTimeout
( 0.03f );
public static boolean removePluginsDirectory(java.lang.String dirName)
addPlugin()
. Returns true if directory has been successfully removed.public static boolean getIvTuneAllowed()
setIvTuneAllowed()
.public static void setIvTuneAllowed(boolean ivTuneAllowed)
SoIvTune
to set the keyboard shortcut.public static SbTime getCurrentTime()
public static boolean removePlugin(java.lang.String fileName)
addPlugin()
. Returns true if plugin was successfully unloaded.public static boolean addPluginsDirectory(java.lang.String dirName)
addPlugin()
. Returns true if directory has been successfully added.@Deprecated public static float getLicensingVersionNumber()
LicenseCheck
.
If you need a descriptive string see getVersion
. If you just need the version number as an integer or string, see the macros in SoVersion.h.Deprecated since Open Inventor 9800
please use SoLicensesInfo.getLicensingVersionNumber()
instead
public static void addConverter(java.lang.Class<? extends Inventor> fromField, java.lang.Class<? extends Inventor> toField, java.lang.Class<? extends Inventor> converterEngine)
public static void removeConverter(java.lang.Class<? extends Inventor> fromField, java.lang.Class<? extends Inventor> toField)
addConverter()
.@Deprecated public static void prioritizeChildrenCaching(boolean onOff)
When set to false, render caches are built from the top down, meaning caches are built for the highest level separators in the scene graph first.
Setting true may increase rendering performance because of a finer granularity in cache creation and calling. The default is true. Prior to Open Inventor version 6.0, the default was false. The value can also be set using the OIV_PRIORITIZE_CHILDREN_CACHING configuration parameter.Deprecated since Open Inventor 9000
No longer used.
@Deprecated public static int LicenseCheck(java.lang.String productName, float version, java.lang.String licenseString, boolean printWarning, java.lang.String[] errReport)
productName
- : Product to be licensed (no blanks), e.g. OpenInventor or VolumeVizLDM.
version
- : Version to be licensed (see getLicensingVersionNumber
).
licenseString
- : (optional) Embedded application password string, if any.
printWarning
- : If true, error and warning messages (if any) will be displayed to user.
errReport
- : If not NULL, will be set to point to the text of the error or warning messages (if any). SoLicensesInfo.check()
instead
@Deprecated public static boolean isPrioritizedChildrenCaching()
public static boolean isMultiThread()
public static void writelock()
writeunlock()
.
Note: Be sure the global write-lock is always released or there is a good chance the application will "dead lock" because all standard actions automatically attempt to acquire a global read-lock.
public static void writeunlock()
writelock()
.public static SbTime getDelaySensorTimeout()
setDelaySensorTimeout()
.public static void processEvents()
public static java.lang.Class<? extends Inventor> getConverter(java.lang.Class<? extends Inventor> fromField, java.lang.Class<? extends Inventor> toField)
addConverter()
.public static int getNumRenderCaches()
setNumRenderCaches()
.public static void setRenderCacheMode(SoDB.RenderCacheModes mode)
COMPILE
). This can increase performances on some graphics board. With this method you can ask OIV to execute GL commands as they are compiled into the display list (mode = COMPILE_AND_EXECUTE
). You can also use the AUTO_RENDER_CACHE
to allow Open Inventor to detect the best mode.public static SoDB.RenderCacheModes getRenderCacheMode()
setRenderCacheMode()
.public static void readlock()
SoDB.writelock
). See readunlock()
.public static void readunlock()
readunlock()
.public static void setNumRenderCaches(int num)
SoSeparator
(OpenGL display lists) and SoTexture2
(OpenGL texture objects). This method affects only nodes that are created after it is called, not nodes that were created before it. Setting the number of caches to zero disables render caching for all nodes created after the call.
By default, each node maintains 2 render caches. (This is to allow two different representations, e.g., filled and wireframe, to both be cached.) Each render cache uses memory, so decreasing this number may decrease the memory requirements of the application. However multi-pipe applications should generally set the number of render caches equal to the number of pipes because pipes may not be able to share display lists.
This value can also be specified globally using the environment variable OIV_MAX_CACHES. This value can also be specified separately for classes that have a setNumRenderCaches method.
Generated on January 23, 2025, Copyright © Thermo Fisher Scientific. All rights reserved. http://www.openinventor.com