Class VoxelBuffer<T extends javax.vecmath.Tuple3d>

Type Parameters:
T - extending Tuple3d
All Implemented Interfaces:
CLResources

public class VoxelBuffer<T extends javax.vecmath.Tuple3d> extends WriteBufferGPU<T>
Buffer to hold 3D coordinates compatible with Tuple3d and it's descendants Even though 3 float values are stored, we need to allocate more space since OpenCL assumes the vector types (float3) to be aligned to match 4 * sizeof(component) boundary.
  • Constructor Summary Link icon

    Constructors
    Constructor
    Description
    VoxelBuffer(com.jogamp.opencl.CLContext context)
    Initializes buffer of Voxels
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    protected void
    allocateBuffer(int desiredSize)
    Allocate the buffer to fit the elements
    com.jogamp.opencl.CLBuffer<FloatBuffer>
    get()
    Get underlying CLBuffer
    Gets data, that are currently copied to GPU
    void
    put(int index, T point)
    Puts 3D coordinates into buffer
    void
    put(T point)
    Puts 3D coordinates into buffer + zero value to align the data
    void
    putAll(List<T> points)
    Populates buffer with 3D coordinates + adds zero values to align the data Overwrites previous data and resizes itself, if needed
    void
    Explicitly releases GPU resources held by this object
    protected void
    resizeSubBuffer(int desiredSize)
    Creating new SubBuffer of the main buffer to operate with smaller amount of memory
    void
    Rewinds the buffer
    void
    Copies contents to GPU

    Methods inherited from class cz.fidentis.analyst.opencl.memory.BufferGPU Link icon

    getClContext, getCount, getElementSize, getQueue, getSize, resize

    Methods inherited from class java.lang.Object Link icon

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details Link icon

    • VoxelBuffer Link icon

      public VoxelBuffer(com.jogamp.opencl.CLContext context)
      Initializes buffer of Voxels
  • Method Details Link icon

    • getOriginalData Link icon

      public List<T> getOriginalData()
      Description copied from class: WriteBufferGPU
      Gets data, that are currently copied to GPU
      Specified by:
      getOriginalData in class WriteBufferGPU<T extends javax.vecmath.Tuple3d>
      Returns:
      data
    • writeToGPU Link icon

      public void writeToGPU()
      Description copied from class: WriteBufferGPU
      Copies contents to GPU
      Specified by:
      writeToGPU in class WriteBufferGPU<T extends javax.vecmath.Tuple3d>
    • release Link icon

      public void release()
      Description copied from interface: CLResources
      Explicitly releases GPU resources held by this object
    • get Link icon

      public com.jogamp.opencl.CLBuffer<FloatBuffer> get()
      Description copied from class: BufferGPU
      Get underlying CLBuffer
      Specified by:
      get in class BufferGPU<FloatBuffer>
      Returns:
      CLBuffer
    • rewind Link icon

      public void rewind()
      Description copied from class: BufferGPU
      Rewinds the buffer
      Specified by:
      rewind in class BufferGPU<FloatBuffer>
    • put Link icon

      public void put(int index, T point)
      Puts 3D coordinates into buffer
      Parameters:
      index - index according to the original data
      point - 3D coordinates
    • put Link icon

      public void put(T point)
      Puts 3D coordinates into buffer + zero value to align the data
      Parameters:
      point - 3D coordinates extends Tuple3d. Can not be null
    • putAll Link icon

      public void putAll(List<T> points)
      Populates buffer with 3D coordinates + adds zero values to align the data Overwrites previous data and resizes itself, if needed
      Specified by:
      putAll in class WriteBufferGPU<T extends javax.vecmath.Tuple3d>
    • allocateBuffer Link icon

      protected void allocateBuffer(int desiredSize)
      Description copied from class: BufferGPU
      Allocate the buffer to fit the elements
      Specified by:
      allocateBuffer in class BufferGPU<FloatBuffer>
      Parameters:
      desiredSize - desired size of the buffer
    • resizeSubBuffer Link icon

      protected void resizeSubBuffer(int desiredSize)
      Description copied from class: BufferGPU
      Creating new SubBuffer of the main buffer to operate with smaller amount of memory
      Specified by:
      resizeSubBuffer in class BufferGPU<FloatBuffer>
      Parameters:
      desiredSize - desired size of the buffer