VTK-m  2.0
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 
22 class VTKM_RENDERING_EXPORT View1D : public vtkm::rendering::View
23 {
24 public:
25  View1D(const vtkm::rendering::Scene& scene,
26  const vtkm::rendering::Mapper& mapper,
27  const vtkm::rendering::Canvas& canvas,
28  const vtkm::rendering::Color& backgroundColor = vtkm::rendering::Color(0, 0, 0, 1),
29  const vtkm::rendering::Color& foregroundColor = vtkm::rendering::Color(1, 1, 1, 1));
30 
31  View1D(const vtkm::rendering::Scene& scene,
32  const vtkm::rendering::Mapper& mapper,
33  const vtkm::rendering::Canvas& canvas,
34  const vtkm::rendering::Camera& camera,
35  const vtkm::rendering::Color& backgroundColor = vtkm::rendering::Color(0, 0, 0, 1),
36  const vtkm::rendering::Color& foregroundColor = vtkm::rendering::Color(1, 1, 1, 1));
37 
38  ~View1D();
39 
40  void Paint() override;
41  void RenderScreenAnnotations() override;
42  void RenderWorldAnnotations() override;
43  void RenderColorLegendAnnotations();
44 
45  void EnableLegend();
46  void DisableLegend();
47  void SetLegendLabelColor(vtkm::rendering::Color c) { this->Legend.SetLabelColor(c); }
48 
49  void SetLogX(bool l)
50  {
51  this->GetMapper().SetLogarithmX(l);
52  this->LogX = l;
53  }
54 
55  void SetLogY(bool l)
56  {
57  this->GetMapper().SetLogarithmY(l);
58  this->LogY = l;
59  }
60 
61 private:
62  void UpdateCameraProperties();
63 
64  // 1D-specific annotations
68  bool LegendEnabled = true;
69  bool LogX = false;
70  bool LogY = false;
71 };
72 }
73 } // namespace vtkm::rendering
74 
75 #endif //vtk_m_rendering_View1D_h
vtkm::rendering::ColorLegendAnnotation
Definition: ColorLegendAnnotation.h:26
vtkm::rendering::Color
It's a color!
Definition: Color.h:28
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::rendering::View1D::Legend
vtkm::rendering::ColorLegendAnnotation Legend
Definition: View1D.h:67
ColorLegendAnnotation.h
vtkm::rendering::View1D::SetLogX
void SetLogX(bool l)
Definition: View1D.h:49
vtkm::rendering::View1D::SetLogY
void SetLogY(bool l)
Definition: View1D.h:55
vtkm::rendering::Mapper
Definition: Mapper.h:24
vtkm::rendering::View1D::HorizontalAxisAnnotation
vtkm::rendering::AxisAnnotation2D HorizontalAxisAnnotation
Definition: View1D.h:65
vtkm::rendering::Canvas
Definition: Canvas.h:34
vtkm::rendering::AxisAnnotation2D
Definition: AxisAnnotation2D.h:29
AxisAnnotation2D.h
vtkm::rendering::View1D::SetLegendLabelColor
void SetLegendLabelColor(vtkm::rendering::Color c)
Definition: View1D.h:47
vtkm::rendering::View
Definition: View.h:30
vtkm::rendering::Camera
Definition: Camera.h:28
vtkm::rendering::Scene
Definition: Scene.h:27
vtkm::rendering::View1D
Definition: View1D.h:22
View.h
vtkm::rendering::View1D::VerticalAxisAnnotation
vtkm::rendering::AxisAnnotation2D VerticalAxisAnnotation
Definition: View1D.h:66