VTK-m  2.2
ScalarRenderer.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_ScalarRenderer_h
11 #define vtk_m_rendering_ScalarRenderer_h
12 
13 #include <vtkm/cont/DataSet.h>
14 #include <vtkm/rendering/Camera.h>
15 
16 #include <memory>
17 
18 namespace vtkm
19 {
20 namespace rendering
21 {
22 
24 {
25 public:
27 
28  // Disable copying due to unique_ptr;
29  ScalarRenderer(const ScalarRenderer&) = delete;
30  ScalarRenderer& operator=(const ScalarRenderer&) = delete;
31 
32  ScalarRenderer(ScalarRenderer&&) noexcept;
33  ScalarRenderer& operator=(ScalarRenderer&&) noexcept;
34  // Default destructor implemented in source file to support PIMPL idiom.
35  ~ScalarRenderer();
36 
37  void SetInput(vtkm::cont::DataSet& dataSet);
38 
39  void SetWidth(vtkm::Int32 width);
40  void SetHeight(vtkm::Int32 height);
41  void SetDefaultValue(vtkm::Float32 value);
42 
44  {
48  std::vector<vtkm::cont::ArrayHandle<vtkm::Float32>> Scalars;
49  std::vector<std::string> ScalarNames;
50  std::map<std::string, vtkm::Range> Ranges;
51 
52  vtkm::cont::DataSet ToDataSet();
53  };
54 
55  ScalarRenderer::Result Render(const vtkm::rendering::Camera& camera);
56 
57 private:
58  struct InternalsType;
59  std::unique_ptr<InternalsType> Internals;
60 };
61 }
62 } //namespace vtkm::rendering
63 
64 #endif //vtk_m_rendering_ScalarRenderer_h
vtkm::rendering::ScalarRenderer::Result::ScalarNames
std::vector< std::string > ScalarNames
Definition: ScalarRenderer.h:49
vtkm::rendering::ScalarRenderer::Result::Height
vtkm::Int32 Height
Definition: ScalarRenderer.h:46
vtkm::cont::ArrayHandle< vtkm::Float32 >
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::ScalarRenderer::Result::Scalars
std::vector< vtkm::cont::ArrayHandle< vtkm::Float32 > > Scalars
Definition: ScalarRenderer.h:48
vtkm::cont::DataSet
Contains and manages the geometric data structures that VTK-m operates on.
Definition: DataSet.h:57
vtkm::rendering::ScalarRenderer::Internals
std::unique_ptr< InternalsType > Internals
Definition: ScalarRenderer.h:58
vtkm::rendering::ScalarRenderer::Result::Depths
vtkm::cont::ArrayHandle< vtkm::Float32 > Depths
Definition: ScalarRenderer.h:47
vtkm::rendering::ScalarRenderer::Result
Definition: ScalarRenderer.h:43
vtkm::rendering::ScalarRenderer::Result::Ranges
std::map< std::string, vtkm::Range > Ranges
Definition: ScalarRenderer.h:50
vtkm::rendering::ScalarRenderer
Definition: ScalarRenderer.h:23
vtkm::rendering::ScalarRenderer::Result::Width
vtkm::Int32 Width
Definition: ScalarRenderer.h:45
vtkm::Float32
float Float32
Base type to use for 32-bit floating-point numbers.
Definition: Types.h:157
Camera.h
vtkm::Int32
int32_t Int32
Base type to use for 32-bit signed integer numbers.
Definition: Types.h:181
vtkm::rendering::Camera
Specifies the viewport for a rendering.
Definition: Camera.h:37
DataSet.h