Class SoAlgorithms
- java.lang.Object
-
- com.openinventor.inventor.Inventor
-
- com.openinventor.inventor.algorithms.SoAlgorithms
-
public class SoAlgorithms extends Inventor
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 Constructor Description SoAlgorithms()Algorithms interface constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SoArithmeticcreateArithmeticInterface()Returns an instance of theSoArithmeticinterface defined in the loaded module.SoBufferObjectcreateBufferObject()Returns an instance of aSoBufferObjectaccording to the hardware used by the loaded module.SoDeviceContextcreateContext()Returns a DeviceContext that can be used with the algorithms module andSoBufferObjectreturned by the createBufferObject function.SoConversioncreateConversionInterface()Returns an instance of theSoConversioninterface defined in the loaded module.SoConvolutioncreateConvolutionInterface()Returns an instance of theSoConvolutioninterface defined in the loaded module.SoDataExtractcreateDataExtractInterface()Returns an instance of theSoDataExtractinterface defined in the loaded module.SoSeismiccreateSeismicInterface()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 booleanisInitialized()Returns true if module is currently initialized.static SoAlgorithmsloadAlgorithmsModule(java.lang.String moduleFileName)Loads a module and returns an instance of the implementation ofSoAlgorithmsin this module.static booleanunloadAlgorithmsModule(java.lang.String moduleFileName)Unloads a module.-
Methods inherited from class com.openinventor.inventor.Inventor
dispose, getNativeResourceHandle
-
-
-
-
Method Detail
-
createConvolutionInterface
public SoConvolution 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
public SoBufferObject 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
public SoArithmetic 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
public SoConversion 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
public static boolean unloadAlgorithmsModule(java.lang.String moduleFileName)
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
public SoDeviceContext createContext()
Returns a DeviceContext that can be used with the algorithms module andSoBufferObjectreturned by the createBufferObject function.- Returns:
- An instance of an
SoDeviceContextobject.
-
createDataExtractInterface
public SoDataExtract 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
public SoSeismic 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
public static SoAlgorithms loadAlgorithmsModule(java.lang.String moduleFileName)
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.
-
-