Viskores  1.0
View1D.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_View1D_h
19 #define viskores_rendering_View1D_h
20 
24 
25 namespace viskores
26 {
27 namespace rendering
28 {
29 
33 class VISKORES_RENDERING_EXPORT View1D : public viskores::rendering::View
34 {
35 public:
36  View1D(
37  const viskores::rendering::Scene& scene,
38  const viskores::rendering::Mapper& mapper,
39  const viskores::rendering::Canvas& canvas,
40  const viskores::rendering::Color& backgroundColor = viskores::rendering::Color(0, 0, 0, 1),
41  const viskores::rendering::Color& foregroundColor = viskores::rendering::Color(1, 1, 1, 1));
42 
43  View1D(
44  const viskores::rendering::Scene& scene,
45  const viskores::rendering::Mapper& mapper,
46  const viskores::rendering::Canvas& canvas,
47  const viskores::rendering::Camera& camera,
48  const viskores::rendering::Color& backgroundColor = viskores::rendering::Color(0, 0, 0, 1),
49  const viskores::rendering::Color& foregroundColor = viskores::rendering::Color(1, 1, 1, 1));
50 
51  void Paint() override;
52  void RenderScreenAnnotations() override;
53  void RenderWorldAnnotations() override;
54  void RenderColorLegendAnnotations();
55 
56  void EnableLegend();
57  void DisableLegend();
58  void SetLegendLabelColor(viskores::rendering::Color c) { this->Legend.SetLabelColor(c); }
59 
61  void SetLogX(bool l)
62  {
63  this->GetMapper().SetLogarithmX(l);
64  this->LogX = l;
65  }
66 
68  void SetLogY(bool l)
69  {
70  this->GetMapper().SetLogarithmY(l);
71  this->LogY = l;
72  }
73 
74 private:
75  void UpdateCameraProperties();
76 
77  // 1D-specific annotations
81  bool LegendEnabled = true;
82  bool LogX = false;
83  bool LogY = false;
84 };
85 }
86 } // namespace viskores::rendering
87 
88 #endif //viskores_rendering_View1D_h
viskores::rendering::View1D
A view for a 1D data set.
Definition: View1D.h:33
viskores::rendering::View
The abstract class representing the view of a rendering scene.
Definition: View.h:39
viskores::rendering::ColorLegendAnnotation
Definition: ColorLegendAnnotation.h:34
ColorLegendAnnotation.h
viskores::rendering::View1D::SetLogY
void SetLogY(bool l)
Specify whether log scaling should be used on the Y axis.
Definition: View1D.h:68
viskores::rendering::Scene
A simple collection of things to render.
Definition: Scene.h:38
viskores::rendering::View1D::Legend
viskores::rendering::ColorLegendAnnotation Legend
Definition: View1D.h:80
viskores::rendering::View1D::HorizontalAxisAnnotation
viskores::rendering::AxisAnnotation2D HorizontalAxisAnnotation
Definition: View1D.h:78
viskores
Groups connected points that have the same field value.
Definition: Atomic.h:27
viskores::rendering::Mapper
Converts data into commands to a rendering system.
Definition: Mapper.h:37
AxisAnnotation2D.h
viskores::rendering::Camera
Specifies the viewport for a rendering.
Definition: Camera.h:45
viskores::rendering::View1D::SetLogX
void SetLogX(bool l)
Specify whether log scaling should be used on the X axis.
Definition: View1D.h:61
viskores::rendering::View1D::VerticalAxisAnnotation
viskores::rendering::AxisAnnotation2D VerticalAxisAnnotation
Definition: View1D.h:79
View.h
viskores::rendering::Canvas
Represents the image space that is the target of rendering.
Definition: Canvas.h:43
viskores::rendering::Color
Representation of a color.
Definition: Color.h:37
viskores::rendering::AxisAnnotation2D
Definition: AxisAnnotation2D.h:37
viskores::rendering::View1D::SetLegendLabelColor
void SetLegendLabelColor(viskores::rendering::Color c)
Definition: View1D.h:58