VTK-m  2.1
View1D.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_View1D_h
11 #define vtk_m_rendering_View1D_h
12 
15 #include <vtkm/rendering/View.h>
16 
17 namespace vtkm
18 {
19 namespace rendering
20 {
21 
26 {
27 public:
28  View1D(const vtkm::rendering::Scene& scene,
29  const vtkm::rendering::Mapper& mapper,
30  const vtkm::rendering::Canvas& canvas,
31  const vtkm::rendering::Color& backgroundColor = vtkm::rendering::Color(0, 0, 0, 1),
32  const vtkm::rendering::Color& foregroundColor = vtkm::rendering::Color(1, 1, 1, 1));
33 
34  View1D(const vtkm::rendering::Scene& scene,
35  const vtkm::rendering::Mapper& mapper,
36  const vtkm::rendering::Canvas& canvas,
37  const vtkm::rendering::Camera& camera,
38  const vtkm::rendering::Color& backgroundColor = vtkm::rendering::Color(0, 0, 0, 1),
39  const vtkm::rendering::Color& foregroundColor = vtkm::rendering::Color(1, 1, 1, 1));
40 
41  void Paint() override;
42  void RenderScreenAnnotations() override;
43  void RenderWorldAnnotations() override;
44  void RenderColorLegendAnnotations();
45 
46  void EnableLegend();
47  void DisableLegend();
48  void SetLegendLabelColor(vtkm::rendering::Color c) { this->Legend.SetLabelColor(c); }
49 
51  void SetLogX(bool l)
52  {
53  this->GetMapper().SetLogarithmX(l);
54  this->LogX = l;
55  }
56 
58  void SetLogY(bool l)
59  {
60  this->GetMapper().SetLogarithmY(l);
61  this->LogY = l;
62  }
63 
64 private:
65  void UpdateCameraProperties();
66 
67  // 1D-specific annotations
71  bool LegendEnabled = true;
72  bool LogX = false;
73  bool LogY = false;
74 };
75 }
76 } // namespace vtkm::rendering
77 
78 #endif //vtk_m_rendering_View1D_h
vtkm::rendering::ColorLegendAnnotation
Definition: ColorLegendAnnotation.h:26
vtkm::rendering::Color
Representation of a color.
Definition: Color.h:29
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::View1D::Legend
vtkm::rendering::ColorLegendAnnotation Legend
Definition: View1D.h:70
ColorLegendAnnotation.h
vtkm::rendering::View1D::SetLogX
void SetLogX(bool l)
Specify whether log scaling should be used on the X axis.
Definition: View1D.h:51
vtkm::rendering::View1D::SetLogY
void SetLogY(bool l)
Specify whether log scaling should be used on the Y axis.
Definition: View1D.h:58
vtkm::rendering::Mapper
Converts data into commands to a rendering system.
Definition: Mapper.h:29
vtkm::rendering::View1D::HorizontalAxisAnnotation
vtkm::rendering::AxisAnnotation2D HorizontalAxisAnnotation
Definition: View1D.h:68
vtkm::rendering::Canvas
Represents the image space that is the target of rendering.
Definition: Canvas.h:35
vtkm::rendering::AxisAnnotation2D
Definition: AxisAnnotation2D.h:29
AxisAnnotation2D.h
vtkm::rendering::View1D::SetLegendLabelColor
void SetLegendLabelColor(vtkm::rendering::Color c)
Definition: View1D.h:48
vtkm::rendering::View
The abstract class representing the view of a rendering scene.
Definition: View.h:31
vtkm::rendering::Camera
Specifies the viewport for a rendering.
Definition: Camera.h:37
vtkm::rendering::Scene
A simple collection of things to render.
Definition: Scene.h:30
vtkm::rendering::View1D
A view for a 1D data set.
Definition: View1D.h:25
View.h
vtkm::rendering::View1D::VerticalAxisAnnotation
vtkm::rendering::AxisAnnotation2D VerticalAxisAnnotation
Definition: View1D.h:69