VTK-m  2.0
RayTracer.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_rendering_raytracing_RayTracer_h
11 #define vtk_m_rendering_raytracing_RayTracer_h
12 
13 #include <memory>
14 #include <vector>
15 
16 #include <vtkm/cont/DataSet.h>
17 
20 namespace vtkm
21 {
22 namespace rendering
23 {
24 namespace raytracing
25 {
26 
27 class VTKM_RENDERING_EXPORT RayTracer
28 {
29 protected:
30  std::vector<std::shared_ptr<ShapeIntersector>> Intersectors;
36  bool Shade;
37 
38  template <typename Precision>
39  void RenderOnDevice(Ray<Precision>& rays);
40 
41 public:
42  VTKM_CONT
43  RayTracer();
44  VTKM_CONT
45  ~RayTracer();
46 
47  VTKM_CONT
48  Camera& GetCamera();
49 
50  VTKM_CONT
51  void AddShapeIntersector(std::shared_ptr<ShapeIntersector> intersector);
52 
53  VTKM_CONT
54  void SetField(const vtkm::cont::Field& scalarField, const vtkm::Range& scalarRange);
55 
56  VTKM_CONT
57  void SetColorMap(const vtkm::cont::ArrayHandle<vtkm::Vec4f_32>& colorMap);
58 
59  VTKM_CONT
60  void SetShadingOn(bool on);
61 
62  VTKM_CONT
64 
65  VTKM_CONT
67 
68  VTKM_CONT
69  vtkm::Id GetNumberOfShapes() const;
70 
71  VTKM_CONT
72  void Clear();
73 
74 }; //class RayTracer
75 }
76 }
77 } // namespace vtkm::rendering::raytracing
78 #endif //vtk_m_rendering_raytracing_RayTracer_h
vtkm::rendering::raytracing::RayTracer::ScalarRange
vtkm::Range ScalarRange
Definition: RayTracer.h:35
vtkm::cont::ArrayHandle< vtkm::Vec4f_32 >
vtkm::rendering::raytracing::RayTracer::Intersectors
std::vector< std::shared_ptr< ShapeIntersector > > Intersectors
Definition: RayTracer.h:30
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::rendering::raytracing::RayTracer
Definition: RayTracer.h:27
vtkm::rendering::raytracing::RayTracer::ScalarField
vtkm::cont::Field ScalarField
Definition: RayTracer.h:32
vtkm::rendering::raytracing::RayTracer::ColorMap
vtkm::cont::ArrayHandle< vtkm::Vec4f_32 > ColorMap
Definition: RayTracer.h:34
vtkm::rendering::raytracing::RayTracer::Shade
bool Shade
Definition: RayTracer.h:36
vtkm::Id
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
vtkm::rendering::raytracing::Camera
Definition: raytracing/Camera.h:25
vtkm::rendering::raytracing::Ray
Definition: Ray.h:37
vtkm::cont::Field
A Field encapsulates an array on some piece of the mesh, such as the points, a cell set,...
Definition: cont/Field.h:31
vtkm::rendering::raytracing::RayTracer::camera
Camera camera
Definition: RayTracer.h:31
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::rendering::raytracing::RayTracer::NumberOfShapes
vtkm::Id NumberOfShapes
Definition: RayTracer.h:33
Camera.h
TriangleIntersector.h
DataSet.h
vtkm::Range
Represent a continuous scalar range of values.
Definition: Range.h:31