Class SoAlgorithms
java.lang.Object
com.openinventor.inventor.Inventor
com.openinventor.inventor.algorithms.SoAlgorithms
Utility functions for loading algorithm modules.
This class provides convenience methods for loading an algorithm module, extracting specific algorithm interfaces and creating appropriate context and buffer objects for the device that implements the algorithms.
Examples:
-
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
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns an instance of theSoArithmetic
interface defined in the loaded module.Returns an instance of aSoBufferObject
according to the hardware used by the loaded module.Returns a DeviceContext that can be used with the algorithms module andSoBufferObject
returned by the createBufferObject function.Returns an instance of theSoConversion
interface defined in the loaded module.Returns an instance of theSoConvolution
interface defined in the loaded module.Returns an instance of theSoDataExtract
interface defined in the loaded module.Returns an instance of theSoSeismic
interface defined in the loaded module.static void
finish()
Static finish function to free the memory allocated by the algorithms module.static void
init()
Static init function to initialize the algorithms module.static boolean
Returns true if module is currently initialized.static SoAlgorithms
loadAlgorithmsModule
(String moduleFileName) Loads a module and returns an instance of the implementation ofSoAlgorithms
in this module.static boolean
unloadAlgorithmsModule
(String moduleFileName) Unloads a module.Methods inherited from class com.openinventor.inventor.Inventor
dispose, getNativeResourceHandle
-
Constructor Details
-
SoAlgorithms
public SoAlgorithms()Algorithms interface constructor.
-
-
Method Details
-
createConvolutionInterface
Returns an instance of theSoConvolution
interface defined in the loaded module. If there is no loaded module it returns the default CPU version.- Returns:
- Instance of the
SoConvolution
interface.
-
isInitialized
public static boolean isInitialized()Returns true if module is currently initialized. -
init
public static void init()Static init function to initialize the algorithms module. -
createBufferObject
Returns an instance of aSoBufferObject
according to the hardware used by the loaded module. If there is no loaded module this function returns anSoCpuBufferObject
.- Returns:
- An Instance of a
SoBufferObject
.
-
createArithmeticInterface
Returns an instance of theSoArithmetic
interface defined in the loaded module. If there is no loaded module it returns the default CPU version.- Returns:
- Instance of the
SoArithmetic
interface.
-
createConversionInterface
Returns an instance of theSoConversion
interface defined in the loaded module. If there is no loaded module it returns the default CPU version.- Returns:
- Instance of the
SoConversion
interface.
-
unloadAlgorithmsModule
Unloads a module. The module is unloaded only if it is not used anymore, it uses a references counter in order to figure out if the module can be unloaded or not.- Parameters:
moduleFileName
- The module filename to unload.
-
createContext
Returns a DeviceContext that can be used with the algorithms module andSoBufferObject
returned by the createBufferObject function.- Returns:
- An instance of an
SoDeviceContext
object.
-
createDataExtractInterface
Returns an instance of theSoDataExtract
interface defined in the loaded module. If there is no loaded module it returns the default CPU version.- Returns:
- Instance of the
SoDataExtract
interface.
-
finish
public static void finish()Static finish function to free the memory allocated by the algorithms module. -
createSeismicInterface
Returns an instance of theSoSeismic
interface defined in the loaded module. If there is no loaded module it returns the default CPU version.- Returns:
- Instance of the
SoSeismic
interface.
-
loadAlgorithmsModule
Loads a module and returns an instance of the implementation ofSoAlgorithms
in this module. If the module is already loaded this function just increments the reference count and returns a new instance of the algorithms interface.- Parameters:
moduleFileName
- The module filename. See the description of this class for more information.- Returns:
- An instance of the Algorithms interface from the module, or NULL if the module cannot be load.
-