VTK-m  2.0
WorldAnnotator.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_WorldAnnotator_h
11 #define vtk_m_rendering_WorldAnnotator_h
12 
13 #include <vtkm/rendering/vtkm_rendering_export.h>
14 
15 #include <vtkm/Types.h>
16 #include <vtkm/rendering/Canvas.h>
17 #include <vtkm/rendering/Color.h>
19 
20 namespace vtkm
21 {
22 namespace rendering
23 {
24 
25 class Canvas;
26 
27 class VTKM_RENDERING_EXPORT WorldAnnotator
28 {
29 public:
31 
32  virtual ~WorldAnnotator();
33 
34  virtual void AddLine(const vtkm::Vec3f_64& point0,
35  const vtkm::Vec3f_64& point1,
36  vtkm::Float32 lineWidth,
37  const vtkm::rendering::Color& color,
38  bool inFront = false) const;
39 
40  VTKM_CONT
42  vtkm::Float64 y0,
43  vtkm::Float64 z0,
44  vtkm::Float64 x1,
45  vtkm::Float64 y1,
46  vtkm::Float64 z1,
47  vtkm::Float32 lineWidth,
48  const vtkm::rendering::Color& color,
49  bool inFront = false) const
50  {
51  this->AddLine(
52  vtkm::make_Vec(x0, y0, z0), vtkm::make_Vec(x1, y1, z1), lineWidth, color, inFront);
53  }
54 
55  VTKM_CONT
56  void BeginLineRenderingBatch() const;
57 
58  VTKM_CONT
59  void EndLineRenderingBatch() const;
60 
61  virtual void AddText(const vtkm::Vec3f_32& origin,
62  const vtkm::Vec3f_32& right,
63  const vtkm::Vec3f_32& up,
64  vtkm::Float32 scale,
65  const vtkm::Vec2f_32& anchor,
66  const vtkm::rendering::Color& color,
67  const std::string& text,
68  const vtkm::Float32 depth = 0.f) const;
69 
70  VTKM_CONT
71  void AddText(vtkm::Float32 originX,
72  vtkm::Float32 originY,
73  vtkm::Float32 originZ,
74  vtkm::Float32 rightX,
75  vtkm::Float32 rightY,
76  vtkm::Float32 rightZ,
77  vtkm::Float32 upX,
78  vtkm::Float32 upY,
79  vtkm::Float32 upZ,
80  vtkm::Float32 scale,
81  vtkm::Float32 anchorX,
82  vtkm::Float32 anchorY,
83  const vtkm::rendering::Color& color,
84  const std::string& text) const
85  {
86  this->AddText(vtkm::make_Vec(originX, originY, originZ),
87  vtkm::make_Vec(rightX, rightY, rightZ),
88  vtkm::make_Vec(upX, upY, upZ),
89  scale,
90  vtkm::make_Vec(anchorX, anchorY),
91  color,
92  text);
93  }
94 
95 private:
98 };
99 }
100 } //namespace vtkm::rendering
101 
102 #endif // vtk_m_rendering_WorldAnnotator_h
vtkm::rendering::WorldAnnotator::LineBatcher
vtkm::rendering::LineRendererBatcher LineBatcher
Definition: WorldAnnotator.h:97
vtkm::rendering::WorldAnnotator::AddText
VTKM_CONT void AddText(vtkm::Float32 originX, vtkm::Float32 originY, vtkm::Float32 originZ, vtkm::Float32 rightX, vtkm::Float32 rightY, vtkm::Float32 rightZ, vtkm::Float32 upX, vtkm::Float32 upY, vtkm::Float32 upZ, vtkm::Float32 scale, vtkm::Float32 anchorX, vtkm::Float32 anchorY, const vtkm::rendering::Color &color, const std::string &text) const
Definition: WorldAnnotator.h:71
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
Types.h
vtkm::rendering::WorldAnnotator::Canvas
const vtkm::rendering::Canvas * Canvas
Definition: WorldAnnotator.h:96
vtkm::rendering::LineRendererBatcher
Definition: LineRendererBatcher.h:26
vtkm::rendering::Canvas
Definition: Canvas.h:34
vtkm::rendering::WorldAnnotator::AddLine
VTKM_CONT void AddLine(vtkm::Float64 x0, vtkm::Float64 y0, vtkm::Float64 z0, vtkm::Float64 x1, vtkm::Float64 y1, vtkm::Float64 z1, vtkm::Float32 lineWidth, const vtkm::rendering::Color &color, bool inFront=false) const
Definition: WorldAnnotator.h:41
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
LineRendererBatcher.h
vtkm::make_Vec
constexpr VTKM_EXEC_CONT 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:1212
vtkm::rendering::WorldAnnotator
Definition: WorldAnnotator.h:27
vtkm::Vec< vtkm::Float64, 3 >
vtkm::Float32
float Float32
Definition: Types.h:154
vtkm::Float64
double Float64
Definition: Types.h:155
Color.h
Canvas.h