VTK-m  2.0
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 
23 class VTKM_RENDERING_EXPORT ScalarRenderer
24 {
25 public:
27 
28  ~ScalarRenderer();
29 
30  void SetInput(vtkm::cont::DataSet& dataSet);
31 
32  void SetWidth(const vtkm::Int32 width);
33  void SetHeight(const vtkm::Int32 height);
34  void SetDefaultValue(vtkm::Float32 value);
35 
36  struct VTKM_RENDERING_EXPORT Result
37  {
41  std::vector<vtkm::cont::ArrayHandle<vtkm::Float32>> Scalars;
42  std::vector<std::string> ScalarNames;
43  std::map<std::string, vtkm::Range> Ranges;
44 
45  vtkm::cont::DataSet ToDataSet();
46  };
47 
48  ScalarRenderer::Result Render(const vtkm::rendering::Camera& camera);
49 
50 
51 private:
52  struct InternalsType;
53  std::shared_ptr<InternalsType> Internals;
54 };
55 }
56 } //namespace vtkm::rendering
57 
58 #endif //vtk_m_rendering_ScalarRenderer_h
vtkm::rendering::ScalarRenderer::Result::ScalarNames
std::vector< std::string > ScalarNames
Definition: ScalarRenderer.h:42
vtkm::rendering::ScalarRenderer::Result::Height
vtkm::Int32 Height
Definition: ScalarRenderer.h:39
vtkm::cont::ArrayHandle< vtkm::Float32 >
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::rendering::ScalarRenderer::Result::Scalars
std::vector< vtkm::cont::ArrayHandle< vtkm::Float32 > > Scalars
Definition: ScalarRenderer.h:41
vtkm::cont::DataSet
Definition: DataSet.h:34
vtkm::rendering::ScalarRenderer::Result::Depths
vtkm::cont::ArrayHandle< vtkm::Float32 > Depths
Definition: ScalarRenderer.h:40
vtkm::rendering::ScalarRenderer::Internals
std::shared_ptr< InternalsType > Internals
Definition: ScalarRenderer.h:52
vtkm::rendering::ScalarRenderer::Result
Definition: ScalarRenderer.h:36
vtkm::rendering::ScalarRenderer::Result::Ranges
std::map< std::string, vtkm::Range > Ranges
Definition: ScalarRenderer.h:43
vtkm::rendering::ScalarRenderer
Definition: ScalarRenderer.h:23
vtkm::rendering::ScalarRenderer::Result::Width
vtkm::Int32 Width
Definition: ScalarRenderer.h:38
vtkm::Float32
float Float32
Definition: Types.h:154
Camera.h
vtkm::Int32
int32_t Int32
Definition: Types.h:160
vtkm::rendering::Camera
Definition: Camera.h:28
DataSet.h