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 theSoArithmeticinterface defined in the loaded module.Returns an instance of aSoBufferObjectaccording to the hardware used by the loaded module.Returns a DeviceContext that can be used with the algorithms module andSoBufferObjectreturned by the createBufferObject function.Returns an instance of theSoConversioninterface defined in the loaded module.Returns an instance of theSoConvolutioninterface defined in the loaded module.Returns an instance of theSoDataExtractinterface defined in the loaded module.Returns an instance of theSoSeismicinterface defined in the loaded module.static voidfinish()Static finish function to free the memory allocated by the algorithms module.static voidinit()Static init function to initialize the algorithms module.static booleanReturns true if module is currently initialized.static SoAlgorithmsloadAlgorithmsModule(String moduleFileName) Loads a module and returns an instance of the implementation ofSoAlgorithmsin this module.static booleanunloadAlgorithmsModule(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 theSoConvolutioninterface defined in the loaded module. If there is no loaded module it returns the default CPU version.- Returns:
- Instance of the
SoConvolutioninterface.
-
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 aSoBufferObjectaccording 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 theSoArithmeticinterface defined in the loaded module. If there is no loaded module it returns the default CPU version.- Returns:
- Instance of the
SoArithmeticinterface.
-
createConversionInterface
Returns an instance of theSoConversioninterface defined in the loaded module. If there is no loaded module it returns the default CPU version.- Returns:
- Instance of the
SoConversioninterface.
-
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 andSoBufferObjectreturned by the createBufferObject function.- Returns:
- An instance of an
SoDeviceContextobject.
-
createDataExtractInterface
Returns an instance of theSoDataExtractinterface defined in the loaded module. If there is no loaded module it returns the default CPU version.- Returns:
- Instance of the
SoDataExtractinterface.
-
finish
public static void finish()Static finish function to free the memory allocated by the algorithms module. -
createSeismicInterface
Returns an instance of theSoSeismicinterface defined in the loaded module. If there is no loaded module it returns the default CPU version.- Returns:
- Instance of the
SoSeismicinterface.
-
loadAlgorithmsModule
Loads a module and returns an instance of the implementation ofSoAlgorithmsin 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.
-