Interface OctreeOpenCL
- All Superinterfaces:
CLResources
- All Known Implementing Classes:
OctreeOpenCLImpl
Creates octree in OpenCL memory
Octree is static - Does not support modifications after creation
The implementation is thread-safe
-
Method Summary
Modifier and TypeMethodDescriptionvoid
build
(Collection<MeshFacet> facets) Builds the octree with provided facets.static OctreeOpenCL
create
(com.jogamp.opencl.CLContext clContext) Creates empty instance of OpenCL Octree.getBBox()
Gets BBox calculated during the Octree creation.com.jogamp.opencl.CLBuffer
<FloatBuffer> Gets Octree Bounding Box in bufferint
Largest existing leaf - maximal number of trianglescom.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.getTriangle
(int index) Gets triangle corresponding to its index from GPU buffercom.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
release
-
Method Details
-
create
Creates empty instance of OpenCL Octree.- Returns:
- a new OpenCL Octree
-
build
Builds the octree with provided facets. Reuses allocated memory if possible- Parameters:
facets
- Facets to be loaded in octree
-
getTriangles
WriteBufferGPU<MeshTriangle> getTriangles()Gets Triangles from the octree. The triangles are loaded inMeshTriangleBuffer
- Returns:
- MeshTriangleBuffer instance
-
getMaxTrianglesPerLeaf
int getMaxTrianglesPerLeaf()Largest existing leaf - maximal number of triangles- Returns:
- The Largest existing leaf
-
getTriangleIndices
com.jogamp.opencl.CLBuffer<IntBuffer> getTriangleIndices()Triangle indexes stored in array to represent leaves. Each leaf has reserved length ofgetMayTrianglesPerLeaf
- Returns:
- leaves to triangles indexation
-
getTriangle
Gets triangle corresponding to its index from GPU buffer- Parameters:
index
- of triangle from GPU- Returns:
- MeshTriangle instance
-
getBBox
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
com.jogamp.opencl.CLBuffer<FloatBuffer> getBBoxBuffer()Gets Octree Bounding Box in buffer- Returns:
- CLBuffer containing Bounding Box
-
getTree
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
-