VTK-m  2.2
AxisAnnotation3D.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_AxisAnnotation3D_h
11 #define vtk_m_rendering_AxisAnnotation3D_h
12 
14 
15 #include <vtkm/Range.h>
16 
17 #include <vtkm/cont/DataSet.h>
19 #include <vtkm/rendering/Camera.h>
20 #include <vtkm/rendering/Color.h>
21 #include <vtkm/rendering/Scene.h>
24 
25 #include <memory>
26 
27 namespace vtkm
28 {
29 namespace rendering
30 {
31 
33 {
34 private:
35 protected:
36  vtkm::Float64 TickMajorSize, TickMajorOffset;
37  vtkm::Float64 TickMinorSize, TickMinorOffset;
38  int Axis;
46  std::vector<std::unique_ptr<TextAnnotationBillboard>> Labels;
48 
49 public:
51 
52  AxisAnnotation3D(const AxisAnnotation3D&) = delete;
53 
54  AxisAnnotation3D& operator=(const AxisAnnotation3D&) = delete;
55 
56  VTKM_CONT
57  void SetMoreOrLessTickAdjustment(int offset) { this->MoreOrLessTickAdjustment = offset; }
58 
59  VTKM_CONT
60  void SetColor(vtkm::rendering::Color c) { this->Color = c; }
61 
62  VTKM_CONT
63  void SetAxis(int a) { this->Axis = a; }
64 
65  void SetTickInvert(bool x, bool y, bool z);
66 
70  VTKM_CONT
72  {
73  this->TickMajorSize = size;
74  this->TickMajorOffset = offset;
75  }
76  VTKM_CONT
78  {
79  this->TickMinorSize = size;
80  this->TickMinorOffset = offset;
81  }
82 
83  VTKM_CONT
84  void SetWorldPosition(const vtkm::Vec3f_64& point0, const vtkm::Vec3f_64& point1)
85  {
86  this->Point0 = point0;
87  this->Point1 = point1;
88  }
89 
90  VTKM_CONT
92  vtkm::Float64 y0,
93  vtkm::Float64 z0,
94  vtkm::Float64 x1,
95  vtkm::Float64 y1,
96  vtkm::Float64 z1)
97  {
98  this->SetWorldPosition(vtkm::make_Vec(x0, y0, z0), vtkm::make_Vec(x1, y1, z1));
99  }
100 
101  void SetLabelFontScale(vtkm::Float64 s);
102 
103  void SetLabelFontOffset(vtkm::Float32 off) { this->FontOffset = off; }
104 
105  void SetRange(const vtkm::Range& range) { this->Range = range; }
106 
108  {
109  this->SetRange(vtkm::Range(lower, upper));
110  }
111 
112  void Render(const vtkm::rendering::Camera& camera,
113  const vtkm::rendering::WorldAnnotator& worldAnnotator,
114  vtkm::rendering::Canvas& canvas) override;
115 };
116 }
117 } //namespace vtkm::rendering
118 
119 #endif // vtk_m_rendering_AxisAnnotation3D_h
TextAnnotationBillboard.h
vtkm::rendering::AxisAnnotation3D
Definition: AxisAnnotation3D.h:32
vtkm::rendering::AxisAnnotation3D::Invert
vtkm::Vec3f_32 Invert
Definition: AxisAnnotation3D.h:39
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::AxisAnnotation3D::Labels
std::vector< std::unique_ptr< TextAnnotationBillboard > > Labels
Definition: AxisAnnotation3D.h:46
vtkm::rendering::AxisAnnotation3D::Range
vtkm::Range Range
Definition: AxisAnnotation3D.h:41
vtkm::make_Vec
constexpr vtkm::Vec< T, vtkm::IdComponent(sizeof...(Ts)+1)> make_Vec(T value0, Ts &&... args)
Initializes and returns a Vec containing all the arguments.
Definition: Types.h:1250
vtkm::rendering::AxisAnnotation3D::TickMinorSize
vtkm::Float64 TickMinorSize
Definition: AxisAnnotation3D.h:37
vtkm::rendering::AxisAnnotation3D::Axis
int Axis
Definition: AxisAnnotation3D.h:38
vtkm::rendering::AxisAnnotation3D::SetMajorTickSize
void SetMajorTickSize(vtkm::Float64 size, vtkm::Float64 offset)
offset of 0 means the tick is inside the frame offset of 1 means the tick is outside the frame offset...
Definition: AxisAnnotation3D.h:71
vtkm::rendering::AxisAnnotation3D::MoreOrLessTickAdjustment
int MoreOrLessTickAdjustment
Definition: AxisAnnotation3D.h:47
vtkm_rendering_export.h
vtkm::rendering::AxisAnnotation3D::SetRange
void SetRange(vtkm::Float64 lower, vtkm::Float64 upper)
Definition: AxisAnnotation3D.h:107
Scene.h
vtkm::rendering::Canvas
Represents the image space that is the target of rendering.
Definition: Canvas.h:35
vtkm::rendering::AxisAnnotation3D::SetWorldPosition
void SetWorldPosition(vtkm::Float64 x0, vtkm::Float64 y0, vtkm::Float64 z0, vtkm::Float64 x1, vtkm::Float64 y1, vtkm::Float64 z1)
Definition: AxisAnnotation3D.h:91
vtkm::rendering::AxisAnnotation3D::SetAxis
void SetAxis(int a)
Definition: AxisAnnotation3D.h:63
WorldAnnotator.h
Range.h
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::rendering::AxisAnnotation3D::SetMoreOrLessTickAdjustment
void SetMoreOrLessTickAdjustment(int offset)
Definition: AxisAnnotation3D.h:57
vtkm::rendering::AxisAnnotation3D::SetColor
void SetColor(vtkm::rendering::Color c)
Definition: AxisAnnotation3D.h:60
vtkm::rendering::AxisAnnotation3D::SetMinorTickSize
void SetMinorTickSize(vtkm::Float64 size, vtkm::Float64 offset)
Definition: AxisAnnotation3D.h:77
vtkm::rendering::WorldAnnotator
Definition: WorldAnnotator.h:27
vtkm::rendering::AxisAnnotation3D::TickMajorSize
vtkm::Float64 TickMajorSize
Definition: AxisAnnotation3D.h:36
vtkm::Vec< vtkm::Float32, 3 >
vtkm::rendering::AxisAnnotation3D::SetRange
void SetRange(const vtkm::Range &range)
Definition: AxisAnnotation3D.h:105
vtkm::rendering::AxisAnnotation3D::SetLabelFontOffset
void SetLabelFontOffset(vtkm::Float32 off)
Definition: AxisAnnotation3D.h:103
vtkm::Float32
float Float32
Base type to use for 32-bit floating-point numbers.
Definition: Types.h:157
vtkm::rendering::AxisAnnotation3D::Color
vtkm::rendering::Color Color
Definition: AxisAnnotation3D.h:45
Camera.h
vtkm::Float64
double Float64
Base type to use for 64-bit floating-point numbers.
Definition: Types.h:161
AxisAnnotation.h
Color.h
vtkm::rendering::Camera
Specifies the viewport for a rendering.
Definition: Camera.h:37
vtkm::rendering::AxisAnnotation3D::SetWorldPosition
void SetWorldPosition(const vtkm::Vec3f_64 &point0, const vtkm::Vec3f_64 &point1)
Definition: AxisAnnotation3D.h:84
vtkm::rendering::AxisAnnotation3D::FontOffset
vtkm::Float32 FontOffset
Definition: AxisAnnotation3D.h:43
vtkm::rendering::AxisAnnotation
Definition: AxisAnnotation.h:24
vtkm::rendering::AxisAnnotation3D::Point1
vtkm::Vec3f_64 Point1
Definition: AxisAnnotation3D.h:40
vtkm::rendering::AxisAnnotation3D::FontScale
vtkm::Float64 FontScale
Definition: AxisAnnotation3D.h:42
DataSet.h
vtkm::rendering::AxisAnnotation3D::LineWidth
vtkm::Float32 LineWidth
Definition: AxisAnnotation3D.h:44
vtkm::Range
Represent a continuous scalar range of values.
Definition: Range.h:31