VTK-m  2.1
Mapper.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_Mapper_h
11 #define vtk_m_rendering_Mapper_h
12 
13 #include <vtkm/cont/ColorTable.h>
15 #include <vtkm/cont/Field.h>
18 #include <vtkm/rendering/Camera.h>
19 #include <vtkm/rendering/Canvas.h>
20 namespace vtkm
21 {
22 namespace rendering
23 {
24 
30 {
31 public:
32  VTKM_CONT
33  Mapper() {}
34 
35  virtual ~Mapper();
36 
37  virtual void RenderCells(const vtkm::cont::UnknownCellSet& cellset,
38  const vtkm::cont::CoordinateSystem& coords,
39  const vtkm::cont::Field& scalarField,
40  const vtkm::cont::ColorTable& colorTable,
41  const vtkm::rendering::Camera& camera,
42  const vtkm::Range& scalarRange);
43 
44  void RenderCells(const vtkm::cont::UnknownCellSet& cellset,
45  const vtkm::cont::CoordinateSystem& coords,
46  const vtkm::cont::Field& scalarField,
47  const vtkm::cont::ColorTable& colorTable,
48  const vtkm::rendering::Camera& camera,
49  const vtkm::Range& scalarRange,
50  const vtkm::cont::Field& ghostField);
51 
52  virtual void RenderCellsPartitioned(const vtkm::cont::PartitionedDataSet partitionedData,
53  const std::string fieldName,
54  const vtkm::cont::ColorTable& colorTable,
55  const vtkm::rendering::Camera& camera,
56  const vtkm::Range& scalarRange);
57 
58  virtual void SetActiveColorTable(const vtkm::cont::ColorTable& ct);
59 
60  virtual void SetCanvas(vtkm::rendering::Canvas* canvas) = 0;
61  virtual vtkm::rendering::Canvas* GetCanvas() const = 0;
62 
63  virtual vtkm::rendering::Mapper* NewCopy() const = 0;
64 
65  virtual void SetLogarithmX(bool l);
66  virtual void SetLogarithmY(bool l);
67 
68 protected:
70  bool LogarithmX = false;
71  bool LogarithmY = false;
72 
73  // for the volume renderer sorting back to front gives better results for transarent colors, which is the default
74  // but for the raytracer front to back is better.
75  bool SortBackToFront = true;
76 
77  virtual void RenderCellsImpl(const vtkm::cont::UnknownCellSet& cellset,
78  const vtkm::cont::CoordinateSystem& coords,
79  const vtkm::cont::Field& scalarField,
80  const vtkm::cont::ColorTable& colorTable,
81  const vtkm::rendering::Camera& camera,
82  const vtkm::Range& scalarRange,
83  const vtkm::cont::Field& ghostField) = 0;
84 };
85 }
86 } //namespace vtkm::rendering
87 #endif //vtk_m_rendering_Mapper_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::cont::ColorTable
Color Table for coloring arbitrary fields.
Definition: cont/ColorTable.h:89
VTKM_RENDERING_EXPORT
#define VTKM_RENDERING_EXPORT
Definition: vtkm_rendering_export.h:44
UnknownCellSet.h
vtkm::cont::UnknownCellSet
A CellSet of an unknown type.
Definition: UnknownCellSet.h:48
ColorTable.h
CoordinateSystem.h
vtkm::cont::CoordinateSystem
Manages a coordinate system for a DataSet.
Definition: CoordinateSystem.h:30
vtkm::rendering::Mapper
Converts data into commands to a rendering system.
Definition: Mapper.h:29
vtkm::rendering::Canvas
Represents the image space that is the target of rendering.
Definition: Canvas.h:35
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_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
Field.h
vtkm::rendering::Mapper::Mapper
Mapper()
Definition: Mapper.h:33
PartitionedDataSet.h
Camera.h
vtkm::rendering::Camera
Specifies the viewport for a rendering.
Definition: Camera.h:37
Canvas.h
vtkm::cont::PartitionedDataSet
Comprises a set of vtkm::cont::DataSet objects.
Definition: PartitionedDataSet.h:26
vtkm::rendering::Mapper::ColorMap
vtkm::cont::ArrayHandle< vtkm::Vec4f_32 > ColorMap
Definition: Mapper.h:69
vtkm::Range
Represent a continuous scalar range of values.
Definition: Range.h:31