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 SoArithmetic
createArithmeticInterface()
Returns an instance of theSoArithmetic
interface defined in the loaded module.SoBufferObject
createBufferObject()
Returns an instance of aSoBufferObject
according to the hardware used by the loaded module.SoDeviceContext
createContext()
Returns a DeviceContext that can be used with the algorithms module andSoBufferObject
returned by the createBufferObject function.SoConversion
createConversionInterface()
Returns an instance of theSoConversion
interface defined in the loaded module.SoConvolution
createConvolutionInterface()
Returns an instance of theSoConvolution
interface defined in the loaded module.SoDataExtract
createDataExtractInterface()
Returns an instance of theSoDataExtract
interface defined in the loaded module.SoSeismic
createSeismicInterface()
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
isInitialized()
Returns true if module is currently initialized.static SoAlgorithms
loadAlgorithmsModule(java.lang.String moduleFileName)
Loads a module and returns an instance of the implementation ofSoAlgorithms
in this module.static boolean
unloadAlgorithmsModule(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 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
public SoBufferObject 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
public SoArithmetic 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
public SoConversion 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
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 andSoBufferObject
returned by the createBufferObject function.- Returns:
- An instance of an
SoDeviceContext
object.
-
createDataExtractInterface
public SoDataExtract 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
public SoSeismic 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
public static SoAlgorithms loadAlgorithmsModule(java.lang.String moduleFileName)
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.
-
-