VTK-m  2.0
BoundingVolumeHierarchy.h
Go to the documentation of this file.
1 //============================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //============================================================================
10 #ifndef vtk_m_worklet_BoundingVolumeHierachy_h
11 #define vtk_m_worklet_BoundingVolumeHierachy_h
12 
13 #include <vtkm/cont/ArrayHandle.h>
14 #include <vtkm/cont/DataSet.h>
15 #include <vtkm/rendering/vtkm_rendering_export.h>
16 
17 namespace vtkm
18 {
19 namespace rendering
20 {
21 namespace raytracing
22 {
23 
24 struct AABBs
25 {
32 };
33 
34 //
35 // This is the data structure that is passed to the ray tracer.
36 //
37 class VTKM_RENDERING_EXPORT LinearBVH
38 {
39 public:
47 
48 protected:
51 
52 public:
53  LinearBVH();
54 
55  VTKM_CONT
56  LinearBVH(AABBs& aabbs);
57 
58  VTKM_CONT
59  LinearBVH(const LinearBVH& other);
60 
61  VTKM_CONT void Allocate(const vtkm::Id& leafCount);
62 
63  VTKM_CONT
64  void Construct();
65 
66  VTKM_CONT
67  void SetData(AABBs& aabbs);
68 
69  VTKM_CONT
70  AABBs& GetAABBs();
71 
72  VTKM_CONT
73  bool GetIsConstructed() const;
74 
75  vtkm::Id GetNumberOfAABBs() const;
76 }; // class LinearBVH
77 }
78 }
79 } // namespace vtkm::rendering::raytracing
80 #endif //vtk_m_worklet_BoundingVolumeHierachy_h
vtkm::rendering::raytracing::LinearBVH::Leafs
LeafNodesHandle Leafs
Definition: BoundingVolumeHierarchy.h:44
vtkm::cont::ArrayHandle< vtkm::Float32 >
ArrayHandle.h
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::rendering::raytracing::AABBs::xmins
vtkm::cont::ArrayHandle< vtkm::Float32 > xmins
Definition: BoundingVolumeHierarchy.h:26
vtkm::rendering::raytracing::LinearBVH::LeafCount
vtkm::Id LeafCount
Definition: BoundingVolumeHierarchy.h:46
vtkm::rendering::raytracing::LinearBVH::TotalBounds
vtkm::Bounds TotalBounds
Definition: BoundingVolumeHierarchy.h:45
vtkm::rendering::raytracing::AABBs
Definition: BoundingVolumeHierarchy.h:24
vtkm::Id
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
vtkm::rendering::raytracing::AABBs::zmins
vtkm::cont::ArrayHandle< vtkm::Float32 > zmins
Definition: BoundingVolumeHierarchy.h:28
vtkm::rendering::raytracing::LinearBVH::AABB
AABBs AABB
Definition: BoundingVolumeHierarchy.h:42
vtkm::rendering::raytracing::AABBs::xmaxs
vtkm::cont::ArrayHandle< vtkm::Float32 > xmaxs
Definition: BoundingVolumeHierarchy.h:29
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::rendering::raytracing::LinearBVH::FlatBVH
InnerNodesHandle FlatBVH
Definition: BoundingVolumeHierarchy.h:43
vtkm::Bounds
Represent an axis-aligned 3D bounds in space.
Definition: Bounds.h:29
vtkm::rendering::raytracing::LinearBVH::CanConstruct
bool CanConstruct
Definition: BoundingVolumeHierarchy.h:50
vtkm::rendering::raytracing::LinearBVH::IsConstructed
bool IsConstructed
Definition: BoundingVolumeHierarchy.h:49
vtkm::rendering::raytracing::AABBs::ymins
vtkm::cont::ArrayHandle< vtkm::Float32 > ymins
Definition: BoundingVolumeHierarchy.h:27
vtkm::rendering::raytracing::AABBs::zmaxs
vtkm::cont::ArrayHandle< vtkm::Float32 > zmaxs
Definition: BoundingVolumeHierarchy.h:31
DataSet.h
vtkm::rendering::raytracing::AABBs::ymaxs
vtkm::cont::ArrayHandle< vtkm::Float32 > ymaxs
Definition: BoundingVolumeHierarchy.h:30
vtkm::rendering::raytracing::LinearBVH
Definition: BoundingVolumeHierarchy.h:37