Viskores  1.0
Mapper.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_Mapper_h
19 #define viskores_rendering_Mapper_h
20 
23 #include <viskores/cont/Field.h>
28 namespace viskores
29 {
30 namespace rendering
31 {
32 
37 class VISKORES_RENDERING_EXPORT Mapper
38 {
39 public:
41  Mapper() {}
42 
43  virtual ~Mapper();
44 
45  virtual void RenderCells(const viskores::cont::UnknownCellSet& cellset,
47  const viskores::cont::Field& scalarField,
48  const viskores::cont::ColorTable& colorTable,
49  const viskores::rendering::Camera& camera,
50  const viskores::Range& scalarRange);
51 
52  void RenderCells(const viskores::cont::UnknownCellSet& cellset,
54  const viskores::cont::Field& scalarField,
55  const viskores::cont::ColorTable& colorTable,
56  const viskores::rendering::Camera& camera,
57  const viskores::Range& scalarRange,
58  const viskores::cont::Field& ghostField);
59 
60  virtual void RenderCellsPartitioned(const viskores::cont::PartitionedDataSet partitionedData,
61  const std::string fieldName,
62  const viskores::cont::ColorTable& colorTable,
63  const viskores::rendering::Camera& camera,
64  const viskores::Range& scalarRange);
65 
66  virtual void SetActiveColorTable(const viskores::cont::ColorTable& ct);
67 
68  virtual void SetCanvas(viskores::rendering::Canvas* canvas) = 0;
69  virtual viskores::rendering::Canvas* GetCanvas() const = 0;
70 
71  virtual viskores::rendering::Mapper* NewCopy() const = 0;
72 
73  virtual void SetLogarithmX(bool l);
74  virtual void SetLogarithmY(bool l);
75 
76 protected:
78  bool LogarithmX = false;
79  bool LogarithmY = false;
80 
81  // for the volume renderer sorting back to front gives better results for transarent colors, which is the default
82  // but for the raytracer front to back is better.
83  bool SortBackToFront = true;
84 
85  virtual void RenderCellsImpl(const viskores::cont::UnknownCellSet& cellset,
87  const viskores::cont::Field& scalarField,
88  const viskores::cont::ColorTable& colorTable,
89  const viskores::rendering::Camera& camera,
90  const viskores::Range& scalarRange,
91  const viskores::cont::Field& ghostField) = 0;
92 };
93 }
94 } //namespace viskores::rendering
95 #endif //viskores_rendering_Mapper_h
UnknownCellSet.h
viskores::cont::ArrayHandle
Manages an array-worth of data.
Definition: ArrayHandle.h:313
viskores::cont::CoordinateSystem
Manages a coordinate system for a DataSet.
Definition: CoordinateSystem.h:38
ColorTable.h
CoordinateSystem.h
viskores::rendering::Mapper::ColorMap
viskores::cont::ArrayHandle< viskores::Vec4f_32 > ColorMap
Definition: Mapper.h:77
viskores::rendering::Mapper::Mapper
Mapper()
Definition: Mapper.h:41
VISKORES_CONT
#define VISKORES_CONT
Definition: ExportMacros.h:65
viskores
Groups connected points that have the same field value.
Definition: Atomic.h:27
viskores::cont::ColorTable
Color Table for coloring arbitrary fields.
Definition: cont/ColorTable.h:97
Field.h
viskores::rendering::Mapper
Converts data into commands to a rendering system.
Definition: Mapper.h:37
viskores::cont::PartitionedDataSet
Comprises a set of viskores::cont::DataSet objects.
Definition: PartitionedDataSet.h:34
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
PartitionedDataSet.h
Camera.h
Canvas.h
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
viskores::rendering::Canvas
Represents the image space that is the target of rendering.
Definition: Canvas.h:43