VTK-m  2.0
ColorBarAnnotation.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_ColorBarAnnotation_h
11 #define vtk_m_rendering_ColorBarAnnotation_h
12 
13 #include <vtkm/rendering/vtkm_rendering_export.h>
14 
15 #include <vtkm/cont/ColorTable.h>
16 #include <vtkm/cont/DataSet.h>
18 #include <vtkm/rendering/Camera.h>
19 #include <vtkm/rendering/Canvas.h>
20 
21 namespace vtkm
22 {
23 namespace rendering
24 {
25 
26 class VTKM_RENDERING_EXPORT ColorBarAnnotation
27 {
28 protected:
32  bool Horizontal;
33  std::string FieldName;
34 
35 public:
37 
38  virtual ~ColorBarAnnotation();
39 
40  VTKM_CONT
41  void SetColorTable(const vtkm::cont::ColorTable& colorTable) { this->ColorTable = colorTable; }
42 
43  VTKM_CONT
44  void SetRange(const vtkm::Range& range, vtkm::IdComponent numTicks);
45 
46  VTKM_CONT
47  void SetFieldName(const std::string& fieldName);
48 
49  VTKM_CONT
51  {
52  this->SetRange(vtkm::Range(l, h), numTicks);
53  }
54 
55 
56  VTKM_CONT
57  void SetPosition(const vtkm::Bounds& position);
58 
59  virtual void Render(const vtkm::rendering::Camera& camera,
60  const vtkm::rendering::WorldAnnotator& worldAnnotator,
61  vtkm::rendering::Canvas& canvas);
62 };
63 }
64 } //namespace vtkm::rendering
65 
66 #endif // vtk_m_rendering_ColorBarAnnotation_h
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::ColorBarAnnotation::SetColorTable
VTKM_CONT void SetColorTable(const vtkm::cont::ColorTable &colorTable)
Definition: ColorBarAnnotation.h:41
vtkm::IdComponent
vtkm::Int32 IdComponent
Represents a component ID (index of component in a vector).
Definition: Types.h:168
vtkm::rendering::ColorBarAnnotation::Horizontal
bool Horizontal
Definition: ColorBarAnnotation.h:32
ColorTable.h
vtkm::rendering::Canvas
Definition: Canvas.h:34
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::rendering::ColorBarAnnotation::ColorTable
vtkm::cont::ColorTable ColorTable
Definition: ColorBarAnnotation.h:29
vtkm::rendering::ColorBarAnnotation::Position
vtkm::Bounds Position
Definition: ColorBarAnnotation.h:31
vtkm::rendering::AxisAnnotation2D
Definition: AxisAnnotation2D.h:29
vtkm::Bounds
Represent an axis-aligned 3D bounds in space.
Definition: Bounds.h:29
vtkm::rendering::ColorBarAnnotation::Axis
vtkm::rendering::AxisAnnotation2D Axis
Definition: ColorBarAnnotation.h:30
AxisAnnotation2D.h
vtkm::rendering::WorldAnnotator
Definition: WorldAnnotator.h:27
Camera.h
vtkm::Float64
double Float64
Definition: Types.h:155
vtkm::rendering::ColorBarAnnotation::FieldName
std::string FieldName
Definition: ColorBarAnnotation.h:33
vtkm::rendering::Camera
Definition: Camera.h:28
Canvas.h
vtkm::rendering::ColorBarAnnotation
Definition: ColorBarAnnotation.h:26
vtkm::rendering::ColorBarAnnotation::SetRange
VTKM_CONT void SetRange(vtkm::Float64 l, vtkm::Float64 h, vtkm::IdComponent numTicks)
Definition: ColorBarAnnotation.h:50
DataSet.h
vtkm::Range
Represent a continuous scalar range of values.
Definition: Range.h:31