Viskores  1.0
AxisAnnotation3D.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_AxisAnnotation3D_h
19 #define viskores_rendering_AxisAnnotation3D_h
20 
22 
23 #include <viskores/Range.h>
24 
25 #include <viskores/cont/DataSet.h>
32 
33 #include <memory>
34 
35 namespace viskores
36 {
37 namespace rendering
38 {
39 
40 class VISKORES_RENDERING_EXPORT AxisAnnotation3D : public AxisAnnotation
41 {
42 private:
43 protected:
44  viskores::Float64 TickMajorSize, TickMajorOffset;
45  viskores::Float64 TickMinorSize, TickMinorOffset;
46  int Axis;
54  std::vector<std::unique_ptr<TextAnnotationBillboard>> Labels;
56 
57 public:
59 
60  AxisAnnotation3D(const AxisAnnotation3D&) = delete;
61 
62  AxisAnnotation3D& operator=(const AxisAnnotation3D&) = delete;
63 
65  void SetMoreOrLessTickAdjustment(int offset) { this->MoreOrLessTickAdjustment = offset; }
66 
68  void SetColor(viskores::rendering::Color c) { this->Color = c; }
69 
71  void SetAxis(int a) { this->Axis = a; }
72 
73  void SetTickInvert(bool x, bool y, bool z);
74 
80  {
81  this->TickMajorSize = size;
82  this->TickMajorOffset = offset;
83  }
86  {
87  this->TickMinorSize = size;
88  this->TickMinorOffset = offset;
89  }
90 
92  void SetWorldPosition(const viskores::Vec3f_64& point0, const viskores::Vec3f_64& point1)
93  {
94  this->Point0 = point0;
95  this->Point1 = point1;
96  }
97 
105  {
106  this->SetWorldPosition(viskores::make_Vec(x0, y0, z0), viskores::make_Vec(x1, y1, z1));
107  }
108 
109  void SetLabelFontScale(viskores::Float64 s);
110 
111  void SetLabelFontOffset(viskores::Float32 off) { this->FontOffset = off; }
112 
113  void SetRange(const viskores::Range& range) { this->Range = range; }
114 
116  {
117  this->SetRange(viskores::Range(lower, upper));
118  }
119 
120  void Render(const viskores::rendering::Camera& camera,
121  const viskores::rendering::WorldAnnotator& worldAnnotator,
122  viskores::rendering::Canvas& canvas) override;
123 };
124 }
125 } //namespace viskores::rendering
126 
127 #endif // viskores_rendering_AxisAnnotation3D_h
viskores::rendering::AxisAnnotation3D::Invert
viskores::Vec3f_32 Invert
Definition: AxisAnnotation3D.h:47
TextAnnotationBillboard.h
viskores::rendering::AxisAnnotation3D::TickMajorSize
viskores::Float64 TickMajorSize
Definition: AxisAnnotation3D.h:44
viskores::rendering::AxisAnnotation3D::SetLabelFontOffset
void SetLabelFontOffset(viskores::Float32 off)
Definition: AxisAnnotation3D.h:111
viskores::rendering::AxisAnnotation3D::FontScale
viskores::Float64 FontScale
Definition: AxisAnnotation3D.h:50
viskores::rendering::AxisAnnotation3D::Point1
viskores::Vec3f_64 Point1
Definition: AxisAnnotation3D.h:48
viskores::rendering::AxisAnnotation3D::Axis
int Axis
Definition: AxisAnnotation3D.h:46
viskores::rendering::AxisAnnotation3D::SetMoreOrLessTickAdjustment
void SetMoreOrLessTickAdjustment(int offset)
Definition: AxisAnnotation3D.h:65
viskores::rendering::AxisAnnotation3D::SetMajorTickSize
void SetMajorTickSize(viskores::Float64 size, viskores::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:79
viskores::rendering::AxisAnnotation3D::Color
viskores::rendering::Color Color
Definition: AxisAnnotation3D.h:53
viskores::rendering::AxisAnnotation3D::SetWorldPosition
void SetWorldPosition(const viskores::Vec3f_64 &point0, const viskores::Vec3f_64 &point1)
Definition: AxisAnnotation3D.h:92
Scene.h
viskores::rendering::AxisAnnotation3D
Definition: AxisAnnotation3D.h:40
VISKORES_CONT
#define VISKORES_CONT
Definition: ExportMacros.h:65
viskores
Groups connected points that have the same field value.
Definition: Atomic.h:27
viskores::rendering::AxisAnnotation3D::SetAxis
void SetAxis(int a)
Definition: AxisAnnotation3D.h:71
viskores::Float32
float Float32
Base type to use for 32-bit floating-point numbers.
Definition: Types.h:165
viskores::rendering::AxisAnnotation3D::Range
viskores::Range Range
Definition: AxisAnnotation3D.h:49
WorldAnnotator.h
viskores::rendering::AxisAnnotation3D::TickMinorSize
viskores::Float64 TickMinorSize
Definition: AxisAnnotation3D.h:45
viskores::rendering::AxisAnnotation
Definition: AxisAnnotation.h:32
viskores::rendering::AxisAnnotation3D::LineWidth
viskores::Float32 LineWidth
Definition: AxisAnnotation3D.h:52
Range.h
viskores::rendering::AxisAnnotation3D::SetWorldPosition
void SetWorldPosition(viskores::Float64 x0, viskores::Float64 y0, viskores::Float64 z0, viskores::Float64 x1, viskores::Float64 y1, viskores::Float64 z1)
Definition: AxisAnnotation3D.h:99
viskores::rendering::AxisAnnotation3D::FontOffset
viskores::Float32 FontOffset
Definition: AxisAnnotation3D.h:51
viskores::rendering::AxisAnnotation3D::MoreOrLessTickAdjustment
int MoreOrLessTickAdjustment
Definition: AxisAnnotation3D.h:55
viskores::make_Vec
constexpr viskores::Vec< T, viskores::IdComponent(sizeof...(Ts)+1)> make_Vec(T value0, Ts &&... args)
Initializes and returns a Vec containing all the arguments.
Definition: Types.h:1262
viskores::Range
Represent a continuous scalar range of values.
Definition: Range.h:39
viskores::rendering::AxisAnnotation3D::SetRange
void SetRange(const viskores::Range &range)
Definition: AxisAnnotation3D.h:113
viskores::rendering::AxisAnnotation3D::Labels
std::vector< std::unique_ptr< TextAnnotationBillboard > > Labels
Definition: AxisAnnotation3D.h:54
viskores::rendering::Camera
Specifies the viewport for a rendering.
Definition: Camera.h:45
viskores::rendering::AxisAnnotation3D::SetColor
void SetColor(viskores::rendering::Color c)
Definition: AxisAnnotation3D.h:68
viskores::rendering::AxisAnnotation3D::SetRange
void SetRange(viskores::Float64 lower, viskores::Float64 upper)
Definition: AxisAnnotation3D.h:115
viskores::rendering::AxisAnnotation3D::SetMinorTickSize
void SetMinorTickSize(viskores::Float64 size, viskores::Float64 offset)
Definition: AxisAnnotation3D.h:85
Camera.h
AxisAnnotation.h
Color.h
viskores_rendering_export.h
viskores::rendering::WorldAnnotator
Definition: WorldAnnotator.h:35
viskores::Float64
double Float64
Base type to use for 64-bit floating-point numbers.
Definition: Types.h:169
viskores::Vec< viskores::Float32, 3 >
DataSet.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