VTK-m  2.0
ConnectivityProxy.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_ConnectivityProxy_h
11 #define vtk_m_rendering_ConnectivityProxy_h
12 
13 #include <memory>
14 #include <vtkm/cont/DataSet.h>
16 #include <vtkm/rendering/Mapper.h>
17 #include <vtkm/rendering/View.h>
21 
22 namespace vtkm
23 {
24 namespace rendering
25 {
26 
27 using PartialVector64 = std::vector<vtkm::rendering::raytracing::PartialComposite<vtkm::Float64>>;
28 using PartialVector32 = std::vector<vtkm::rendering::raytracing::PartialComposite<vtkm::Float32>>;
29 
30 class VTKM_RENDERING_EXPORT ConnectivityProxy
31 {
32 public:
33  ConnectivityProxy(const vtkm::cont::DataSet& dataset, const std::string& fieldName);
35  const vtkm::cont::CoordinateSystem& coords,
36  const vtkm::cont::Field& scalarField);
37  // Do not allow the default constructor
38  ConnectivityProxy() = delete;
40  enum struct RenderMode
41  {
42  Volume,
43  Energy,
44  };
45 
46  void SetRenderMode(RenderMode mode);
47  void SetSampleDistance(const vtkm::Float32&);
48  void SetCanvas(vtkm::rendering::Canvas* canvas);
49  void SetScalarField(const std::string& fieldName);
50  void SetEmissionField(const std::string& fieldName);
51  void SetCamera(const vtkm::rendering::Camera& camera);
52  void SetScalarRange(const vtkm::Range& range);
53  void SetColorMap(vtkm::cont::ArrayHandle<vtkm::Vec4f_32>& colormap);
54  void SetCompositeBackground(bool on);
55  void SetDebugPrints(bool on);
56  void SetUnitScalar(vtkm::Float32 unitScalar);
57  void SetEpsilon(vtkm::Float64 epsilon); // epsilon for bumping lost rays
58 
59  vtkm::Bounds GetSpatialBounds();
60  vtkm::Range GetScalarFieldRange();
61  vtkm::Range GetScalarRange();
62 
63  void Trace(const vtkm::rendering::Camera& camera, vtkm::rendering::CanvasRayTracer* canvas);
66 
69 
70 protected:
71  struct InternalsType;
72  struct BoundsFunctor;
73  std::shared_ptr<InternalsType> Internals;
74 };
75 }
76 } //namespace vtkm::rendering
77 #endif //vtk_m_rendering_SceneRendererVolume_h
vtkm::cont::ArrayHandle< vtkm::Vec4f_32 >
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::rendering::ConnectivityProxy::Internals
std::shared_ptr< InternalsType > Internals
Definition: ConnectivityProxy.h:72
CanvasRayTracer.h
vtkm::cont::DataSet
Definition: DataSet.h:34
vtkm::cont::UnknownCellSet
A CellSet of an unknown type.
Definition: UnknownCellSet.h:48
vtkm::cont::CoordinateSystem
Definition: CoordinateSystem.h:25
vtkm::rendering::raytracing::Ray
Definition: Ray.h:37
vtkm::rendering::Canvas
Definition: Canvas.h:34
PartialComposite.h
vtkm::rendering::ConnectivityProxy
Definition: ConnectivityProxy.h:30
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::Bounds
Represent an axis-aligned 3D bounds in space.
Definition: Bounds.h:29
vtkm::rendering::ConnectivityProxy::RenderMode
RenderMode
Definition: ConnectivityProxy.h:40
Camera.h
vtkm::Float32
float Float32
Definition: Types.h:154
vtkm::Float64
double Float64
Definition: Types.h:155
vtkm::rendering::CanvasRayTracer
Definition: CanvasRayTracer.h:23
vtkm::rendering::Camera
Definition: Camera.h:28
Mapper.h
View.h
vtkm::rendering::PartialVector32
std::vector< vtkm::rendering::raytracing::PartialComposite< vtkm::Float32 > > PartialVector32
Definition: ConnectivityProxy.h:28
DataSet.h
Ray.h
vtkm::rendering::PartialVector64
std::vector< vtkm::rendering::raytracing::PartialComposite< vtkm::Float64 > > PartialVector64
Definition: ConnectivityProxy.h:27
vtkm::Range
Represent a continuous scalar range of values.
Definition: Range.h:31