Class SoInputReader
- java.lang.Object
-
- com.openinventor.inventor.Inventor
-
- com.openinventor.inventor.SoInputReader
-
- All Implemented Interfaces:
SafeDisposable
- Direct Known Subclasses:
SoCADInputReader
,SoSTLInputReader
public abstract class SoInputReader extends Inventor implements SafeDisposable
Base class for custom readers that create an Open Inventor scene graph. This class defines the base interface for loading a scene graph from an data format that is not directly supported by Open Inventor.Input readers should be loaded and managed as plugins. Open Inventor automtically attempts to load all files that may be plugin libraries (files with the extension .dll or .so depending on the platform). Plugin libraries may also be explicitly loaded using
SoDB.addPlugin()
. See more details on that page. The file name convention (not required) for readers is "Iv*Reader.dll (or .so)".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.
When
SoDB.readAll()
(for example) is called to create a scene graph from a file or buffer, Open Inventor first attempts to handle the data as .iv format. If that fails, Open Inventor will call thecanConvert()
method for each loaded plugin class, that is derived fromSoInputReader
, in the order they were loaded. The first reader plugin that returns true from this method will be used to handle the data.SoInput
,SoDB.addPlugin()
SoDB.removePlugin()
SoDB.getPlugins()SoDB.addPluginsDirectory()
SoDB.removePluginsDirectory()
SoDB.getPluginsDirectories()
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
-
Field Summary
-
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canConvert(SoInput in)
Returns true if the specified input source can be converted by this plugin.SoSeparator
convert(SoInput name_13597)
Returns the specified input source in the form of an Open Inventor scene graph.boolean
dispose()
Explicitly call this method to force object to dispose its unmanaged resources.boolean
isDisposable()
Returns a boolean flag which indicates if it is safe to callSafeDisposable.dispose()
on the object.-
Methods inherited from class com.openinventor.inventor.Inventor
getNativeResourceHandle
-
-
-
-
Method Detail
-
isDisposable
public boolean isDisposable()
Description copied from interface:SafeDisposable
Returns a boolean flag which indicates if it is safe to callSafeDisposable.dispose()
on the object.- Specified by:
isDisposable
in interfaceSafeDisposable
- Returns:
true
if the object can be disposed in a safe manner
-
dispose
public boolean dispose()
Description copied from class:Inventor
Explicitly call this method to force object to dispose its unmanaged resources. The object may not be reused in the application code after this call.- Specified by:
dispose
in interfaceSafeDisposable
- Overrides:
dispose
in classInventor
- Returns:
true
if this object native resources were successfully disposed;false
if it was already disposed or no native resources has been registered for this object.
-
convert
public SoSeparator convert(SoInput name_13597)
Returns the specified input source in the form of an Open Inventor scene graph. Note that the input source (SoInput
object) may be a file or a buffer (memory). This method should return NULL if the input source is a buffer and the reader does not support reading from a buffer. SoInput.getCurFile() returns NULL if the input source is a buffer.
-
canConvert
public boolean canConvert(SoInput in)
Returns true if the specified input source can be converted by this plugin. Note that the input source (SoInput
object) may be a file or a buffer (memory). This method should return false if the input source is a buffer and the reader does not support reading from a buffer. SoInput.getCurFile() returns NULL if the input source is a buffer.
-
-