VTK-m  2.1
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>
18 #include <vtkm/rendering/raytracing/Camera.h>
19 #include <vtkm/rendering/raytracing/PartialComposite.h>
20 #include <vtkm/rendering/raytracing/Ray.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 
31 {
32 public:
33  ConnectivityProxy(const vtkm::cont::DataSet& dataset, const std::string& fieldName);
34 
36  const std::string& fieldName,
37  const std::string& coordinateName);
38 
40  const vtkm::cont::CoordinateSystem& coords,
41  const vtkm::cont::Field& scalarField);
42 
44  ConnectivityProxy& operator=(const ConnectivityProxy&);
45 
47  ConnectivityProxy& operator=(ConnectivityProxy&&) noexcept;
48 
50 
51  enum struct RenderMode
52  {
53  Volume,
54  Energy,
55  };
56 
57  void SetRenderMode(RenderMode mode);
58  void SetSampleDistance(const vtkm::Float32&);
59  void SetScalarField(const std::string& fieldName);
60  void SetEmissionField(const std::string& fieldName);
61  void SetScalarRange(const vtkm::Range& range);
62  void SetColorMap(vtkm::cont::ArrayHandle<vtkm::Vec4f_32>& colormap);
63  void SetCompositeBackground(bool on);
64  void SetDebugPrints(bool on);
65  void SetUnitScalar(vtkm::Float32 unitScalar);
66  void SetEpsilon(vtkm::Float64 epsilon); // epsilon for bumping lost rays
67 
68  vtkm::Bounds GetSpatialBounds();
69  vtkm::Range GetScalarFieldRange();
70  vtkm::Range GetScalarRange();
71 
72  void Trace(const vtkm::rendering::Camera& camera, vtkm::rendering::CanvasRayTracer* canvas);
73  void Trace(vtkm::rendering::raytracing::Ray<vtkm::Float64>& rays);
74  void Trace(vtkm::rendering::raytracing::Ray<vtkm::Float32>& rays);
75 
76  PartialVector64 PartialTrace(vtkm::rendering::raytracing::Ray<vtkm::Float64>& rays);
77  PartialVector32 PartialTrace(vtkm::rendering::raytracing::Ray<vtkm::Float32>& rays);
78 
79 protected:
80  struct InternalsType;
81  std::unique_ptr<InternalsType> Internals;
82 };
83 }
84 } //namespace vtkm::rendering
85 #endif //vtk_m_rendering_ConnectivityProxy_h
vtkm::cont::ArrayHandle
Manages an array-worth of data.
Definition: ArrayHandle.h:300
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
VTKM_RENDERING_EXPORT
#define VTKM_RENDERING_EXPORT
Definition: vtkm_rendering_export.h:44
vtkm::rendering::ConnectivityProxy::Internals
std::unique_ptr< InternalsType > Internals
Definition: ConnectivityProxy.h:80
CanvasRayTracer.h
vtkm::cont::DataSet
Contains and manages the geometric data structures that VTK-m operates on.
Definition: DataSet.h:57
vtkm::cont::UnknownCellSet
A CellSet of an unknown type.
Definition: UnknownCellSet.h:48
vtkm::cont::CoordinateSystem
Manages a coordinate system for a DataSet.
Definition: CoordinateSystem.h:30
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: 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:51
vtkm::Float32
float Float32
Base type to use for 32-bit floating-point numbers.
Definition: Types.h:157
vtkm::Float64
double Float64
Base type to use for 64-bit floating-point numbers.
Definition: Types.h:161
vtkm::rendering::CanvasRayTracer
Represents the image space that is the target of rendering using the internal ray tracing code.
Definition: CanvasRayTracer.h:25
vtkm::rendering::Camera
Specifies the viewport for a rendering.
Definition: Camera.h:37
Mapper.h
View.h
vtkm::rendering::PartialVector32
std::vector< vtkm::rendering::raytracing::PartialComposite< vtkm::Float32 > > PartialVector32
Definition: ConnectivityProxy.h:28
DataSet.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