Class 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:

    • Constructor Detail

      • SoAlgorithms

        public SoAlgorithms()
        Algorithms interface constructor.
    • Method Detail

      • createConvolutionInterface

        public SoConvolution createConvolutionInterface()
        Returns an instance of the SoConvolution 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.
      • createArithmeticInterface

        public SoArithmetic createArithmeticInterface()
        Returns an instance of the SoArithmetic 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 the SoConversion 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 and SoBufferObject returned by the createBufferObject function.

        Returns:
        An instance of an SoDeviceContext object.

      • createDataExtractInterface

        public SoDataExtract createDataExtractInterface()
        Returns an instance of the SoDataExtract 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 the SoSeismic 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 of SoAlgorithms 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.