Class SoArithmetic

    • Constructor Detail

      • SoArithmetic

        public SoArithmetic()
        Constructor.
    • Method Detail

      • computeMinMaxWithUndefinedValue

        public double[] computeMinMaxWithUndefinedValue​(SoBufferObject inputBuffer,
                                                        SbDataType dataType,
                                                        double undefinedValue)
        Compute min max of all values contained in a buffer that are not equal to the specified undefined value.

        Parameters:
        inputBuffer - The source buffer object.

        dataType - The type of the data in the source buffer object.

        undefinedValue - ignored value

        min - max Result values
      • computeMinMaxWithUndefinedValue

        public double[] computeMinMaxWithUndefinedValue​(SoCpuBufferObject inputBuffer,
                                                        SbDataType dataType,
                                                        SbVec3i32 arrayDim,
                                                        SbBox3i32 range,
                                                        double undefinedValue)
        Compute min max of values contained in the specified range of the buffer that are not equal to the specified undefined value.
        Fast version for Cpu buffers.
      • computeMinMaxWithUndefinedValue

        public double[] computeMinMaxWithUndefinedValue​(SoBufferObject inputBuffer,
                                                        SbDataType dataType,
                                                        SbVec3i32 arrayDim,
                                                        SbBox3i32 range,
                                                        double undefinedValue)
        Compute min max of values contained in the specified range of the buffer that are not equal to the specified undefined value.

        Assumes the buffer contains a 3D array of values. However 1D and 2D arrays can be handled as degenerate cases. For example, to use a 1D array of length N and compute over the range I to J:
        • Set arrayDim = N,1,1 (do not use 0 for any dimension)
        • Set range = I,0,0,J,1,1 (be sure min and max for each axis are not the same)

        Parameters:
        inputBuffer - The source buffer object.

        dataType - The type of the data in the source buffer object.

        arrayDim - Dimensions of the array (can be degenerate, e.g. N,1,1)

        range - Subset of the array to consider

        undefinedValue - ignored value

        min - max Result values
      • computeMinMax

        public double[] computeMinMax​(SoCpuBufferObject inputBuffer,
                                      SbDataType dataType,
                                      SbVec3i32 arrayDim,
                                      SbBox3i32 range)
        Compute min max of values contained in the specified range of the buffer.
        Fast version for Cpu buffers.
      • scale

        public int scale​(SoBufferObject inputBufferA,
                         SbDataType typeA,
                         SoBufferObject outputBufferB,
                         SbDataType typeB,
                         float scaleValue)
        B = A * scaleFactor
        Note: B can be a reference to A
        Limitation: typeA must be the same as typeC.
      • shift

        public int shift​(SoBufferObject inputBufferA,
                         SbDataType typeA,
                         SoBufferObject outputBufferB,
                         SbDataType typeB,
                         float shiftFactor)
        B = A + shiftFactor
        Note: B can be a reference to A
        Limitation: typeA must be the same as typeC.
      • computeMinMax

        public double[] computeMinMax​(SoBufferObject inputBuffer,
                                      SbDataType dataType,
                                      SbVec3i32 arrayDim,
                                      SbBox3i32 range)
        Compute min max of values contained in the specified range of the buffer.

        Assumes the buffer contains a 3D array of values. However 1D and 2D arrays can be handled as degenerate cases. For example, to use a 1D array of length N and compute over the range I to J:
        • Set arrayDim = N,1,1 (do not use 0 for any dimension)
        • Set range = I,0,0,J,1,1 (be sure min and max for each axis are not the same)

        Parameters:
        inputBuffer - The source buffer object.

        dataType - The type of the data in the source buffer object.

        arrayDim - Dimensions of the array (can be degenerate, e.g. N,1,1)

        range - Subset of the array to consider

        min - max Result values
      • computeMinMax

        public double[] computeMinMax​(SoBufferObject inputBuffer,
                                      SbDataType dataType)
        Compute min max of all values contained in a buffer.

        Parameters:
        inputBuffer - The source buffer object.

        dataType - The type of the data in the source buffer object.

        min - max Result values