Interface OctreeOpenCL

All Superinterfaces:
CLResources
All Known Implementing Classes:
OctreeOpenCLImpl

public interface OctreeOpenCL extends CLResources
Creates octree in OpenCL memory Octree is static - Does not support modifications after creation The implementation is thread-safe
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    void
    Builds the octree with provided facets.
    create(com.jogamp.opencl.CLContext clContext)
    Creates empty instance of OpenCL Octree.
    Gets BBox calculated during the Octree creation.
    com.jogamp.opencl.CLBuffer<FloatBuffer>
    Gets Octree Bounding Box in buffer
    int
    Largest existing leaf - maximal number of triangles
    com.jogamp.opencl.CLBuffer<IntBuffer>
    Get indexes pointing from parent nodes to their children and leaves to their respective triangle content index -1 --> reserved as empty value indexes > -1 --> Pointers to nodes, each value points to where node's children are stored continuously For example: If we find 64 at index 5, it means children of node 5 are stored at indexes 64-72 indexes invalid input: '<' -1 --> To save memory, the negative value signify the child is leaf.
    getTriangle(int index)
    Gets triangle corresponding to its index from GPU buffer
    com.jogamp.opencl.CLBuffer<IntBuffer>
    Triangle indexes stored in array to represent leaves.
    Gets Triangles from the octree.

    Methods inherited from interface cz.fidentis.analyst.opencl.memory.CLResources Link icon

    release
  • Method Details Link icon

    • create Link icon

      static OctreeOpenCL create(com.jogamp.opencl.CLContext clContext)
      Creates empty instance of OpenCL Octree.
      Returns:
      a new OpenCL Octree
    • build Link icon

      void build(Collection<MeshFacet> facets)
      Builds the octree with provided facets. Reuses allocated memory if possible
      Parameters:
      facets - Facets to be loaded in octree
    • getTriangles Link icon

      WriteBufferGPU<MeshTriangle> getTriangles()
      Gets Triangles from the octree. The triangles are loaded in MeshTriangleBuffer
      Returns:
      MeshTriangleBuffer instance
    • getMaxTrianglesPerLeaf Link icon

      int getMaxTrianglesPerLeaf()
      Largest existing leaf - maximal number of triangles
      Returns:
      The Largest existing leaf
    • getTriangleIndices Link icon

      com.jogamp.opencl.CLBuffer<IntBuffer> getTriangleIndices()
      Triangle indexes stored in array to represent leaves. Each leaf has reserved length of getMayTrianglesPerLeaf
      Returns:
      leaves to triangles indexation
    • getTriangle Link icon

      MeshTriangle getTriangle(int index)
      Gets triangle corresponding to its index from GPU buffer
      Parameters:
      index - of triangle from GPU
      Returns:
      MeshTriangle instance
    • getBBox Link icon

      Box getBBox()
      Gets BBox calculated during the Octree creation. Equal to Bounding Box of all vertices of the submitted facets
      Returns:
      Octree Bounding Box
    • getBBoxBuffer Link icon

      com.jogamp.opencl.CLBuffer<FloatBuffer> getBBoxBuffer()
      Gets Octree Bounding Box in buffer
      Returns:
      CLBuffer containing Bounding Box
    • getTree Link icon

      com.jogamp.opencl.CLBuffer<IntBuffer> getTree()
      Get indexes pointing from parent nodes to their children and leaves to their respective triangle content index -1 --> reserved as empty value indexes > -1 --> Pointers to nodes, each value points to where node's children are stored continuously For example: If we find 64 at index 5, it means children of node 5 are stored at indexes 64-72 indexes invalid input: '<' -1 --> To save memory, the negative value signify the child is leaf. Making the value positive gives us pointer to the leaf's triangles in Triangle Indices
      Returns:
      CLBuffer of integers