Viskores  1.0
ConnectivityProxy.h
Go to the documentation of this file.
1 //============================================================================
2 // The contents of this file are covered by the Viskores license. See
3 // LICENSE.txt for details.
4 //
5 // By contributing to this file, all contributors agree to the Developer
6 // Certificate of Origin Version 1.1 (DCO 1.1) as stated in DCO.txt.
7 //============================================================================
8 
9 //============================================================================
10 // Copyright (c) Kitware, Inc.
11 // All rights reserved.
12 // See LICENSE.txt for details.
13 //
14 // This software is distributed WITHOUT ANY WARRANTY; without even
15 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16 // PURPOSE. See the above copyright notice for more information.
17 //============================================================================
18 #ifndef viskores_rendering_ConnectivityProxy_h
19 #define viskores_rendering_ConnectivityProxy_h
20 
21 #include <memory>
22 #include <viskores/cont/DataSet.h>
26 #include <viskores/rendering/raytracing/Camera.h>
27 #include <viskores/rendering/raytracing/PartialComposite.h>
28 #include <viskores/rendering/raytracing/Ray.h>
29 
30 namespace viskores
31 {
32 namespace rendering
33 {
34 
35 using PartialVector64 =
36  std::vector<viskores::rendering::raytracing::PartialComposite<viskores::Float64>>;
37 using PartialVector32 =
38  std::vector<viskores::rendering::raytracing::PartialComposite<viskores::Float32>>;
39 
40 class VISKORES_RENDERING_EXPORT ConnectivityProxy
41 {
42 public:
43  ConnectivityProxy(const viskores::cont::DataSet& dataset, const std::string& fieldName);
44 
46  const std::string& fieldName,
47  const std::string& coordinateName);
48 
51  const viskores::cont::Field& scalarField);
52 
54  ConnectivityProxy& operator=(const ConnectivityProxy&);
55 
57  ConnectivityProxy& operator=(ConnectivityProxy&&) noexcept;
58 
60 
61  enum struct RenderMode
62  {
63  Volume,
64  Energy,
65  };
66 
67  void SetRenderMode(RenderMode mode);
68  void SetSampleDistance(const viskores::Float32&);
69  void SetScalarField(const std::string& fieldName);
70  void SetEmissionField(const std::string& fieldName);
71  void SetScalarRange(const viskores::Range& range);
72  void SetColorMap(viskores::cont::ArrayHandle<viskores::Vec4f_32>& colormap);
73  void SetCompositeBackground(bool on);
74  void SetDebugPrints(bool on);
75  void SetUnitScalar(viskores::Float32 unitScalar);
76  void SetEpsilon(viskores::Float64 epsilon); // epsilon for bumping lost rays
77 
78  viskores::Bounds GetSpatialBounds();
79  viskores::Range GetScalarFieldRange();
80  viskores::Range GetScalarRange();
81 
82  void Trace(const viskores::rendering::Camera& camera,
84  void Trace(viskores::rendering::raytracing::Ray<viskores::Float64>& rays);
85  void Trace(viskores::rendering::raytracing::Ray<viskores::Float32>& rays);
86 
87  PartialVector64 PartialTrace(viskores::rendering::raytracing::Ray<viskores::Float64>& rays);
88  PartialVector32 PartialTrace(viskores::rendering::raytracing::Ray<viskores::Float32>& rays);
89 
90 protected:
91  struct InternalsType;
92  std::unique_ptr<InternalsType> Internals;
93 };
94 }
95 } //namespace viskores::rendering
96 #endif //viskores_rendering_ConnectivityProxy_h
viskores::rendering::PartialVector64
std::vector< viskores::rendering::raytracing::PartialComposite< viskores::Float64 > > PartialVector64
Definition: ConnectivityProxy.h:36
viskores::cont::DataSet
Contains and manages the geometric data structures that Viskores operates on.
Definition: DataSet.h:66
viskores::Bounds
Represent an axis-aligned 3D bounds in space.
Definition: Bounds.h:37
viskores::rendering::ConnectivityProxy::RenderMode
RenderMode
Definition: ConnectivityProxy.h:61
CanvasRayTracer.h
viskores::cont::ArrayHandle
Manages an array-worth of data.
Definition: ArrayHandle.h:313
viskores::rendering::PartialVector32
std::vector< viskores::rendering::raytracing::PartialComposite< viskores::Float32 > > PartialVector32
Definition: ConnectivityProxy.h:38
viskores::cont::CoordinateSystem
Manages a coordinate system for a DataSet.
Definition: CoordinateSystem.h:38
viskores::rendering::CanvasRayTracer
Represents the image space that is the target of rendering using the internal ray tracing code.
Definition: CanvasRayTracer.h:33
viskores
Groups connected points that have the same field value.
Definition: Atomic.h:27
viskores::Float32
float Float32
Base type to use for 32-bit floating-point numbers.
Definition: Types.h:165
viskores::rendering::ConnectivityProxy::Internals
std::unique_ptr< InternalsType > Internals
Definition: ConnectivityProxy.h:91
viskores::Range
Represent a continuous scalar range of values.
Definition: Range.h:39
viskores::cont::UnknownCellSet
A CellSet of an unknown type.
Definition: UnknownCellSet.h:56
viskores::rendering::Camera
Specifies the viewport for a rendering.
Definition: Camera.h:45
Mapper.h
viskores::rendering::ConnectivityProxy
Definition: ConnectivityProxy.h:40
View.h
viskores::Float64
double Float64
Base type to use for 64-bit floating-point numbers.
Definition: Types.h:169
viskores::cont::Field
A Field encapsulates an array on some piece of the mesh, such as the points, a cell set,...
Definition: Field.h:39
DataSet.h