Viskores  1.0
WorldAnnotator.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_WorldAnnotator_h
19 #define viskores_rendering_WorldAnnotator_h
20 
22 
23 #include <viskores/Types.h>
27 
28 namespace viskores
29 {
30 namespace rendering
31 {
32 
33 class Canvas;
34 
35 class VISKORES_RENDERING_EXPORT WorldAnnotator
36 {
37 public:
38  explicit WorldAnnotator(const viskores::rendering::Canvas* canvas);
39 
40  void AddLine(const viskores::Vec3f_64& point0,
41  const viskores::Vec3f_64& point1,
42  viskores::Float32 lineWidth,
43  const viskores::rendering::Color& color,
44  bool inFront = false) const;
45 
53  viskores::Float32 lineWidth,
54  const viskores::rendering::Color& color,
55  bool inFront = false) const
56  {
57  this->AddLine(
58  viskores::make_Vec(x0, y0, z0), viskores::make_Vec(x1, y1, z1), lineWidth, color, inFront);
59  }
60 
62  void BeginLineRenderingBatch() const;
63 
65  void EndLineRenderingBatch() const;
66 
67  void AddText(const viskores::Vec3f_32& origin,
68  const viskores::Vec3f_32& right,
69  const viskores::Vec3f_32& up,
70  viskores::Float32 scale,
71  const viskores::Vec2f_32& anchor,
72  const viskores::rendering::Color& color,
73  const std::string& text,
74  viskores::Float32 depth = 0.f) const;
75 
77  void AddText(viskores::Float32 originX,
78  viskores::Float32 originY,
79  viskores::Float32 originZ,
80  viskores::Float32 rightX,
81  viskores::Float32 rightY,
82  viskores::Float32 rightZ,
86  viskores::Float32 scale,
87  viskores::Float32 anchorX,
88  viskores::Float32 anchorY,
89  const viskores::rendering::Color& color,
90  const std::string& text) const
91  {
92  this->AddText(viskores::make_Vec(originX, originY, originZ),
93  viskores::make_Vec(rightX, rightY, rightZ),
94  viskores::make_Vec(upX, upY, upZ),
95  scale,
96  viskores::make_Vec(anchorX, anchorY),
97  color,
98  text);
99  }
100 
101 private:
104 };
105 }
106 } //namespace viskores::rendering
107 
108 #endif // viskores_rendering_WorldAnnotator_h
viskores::rendering::WorldAnnotator::Canvas
const viskores::rendering::Canvas * Canvas
Definition: WorldAnnotator.h:102
Types.h
viskores::rendering::WorldAnnotator::LineBatcher
viskores::rendering::LineRendererBatcher LineBatcher
Definition: WorldAnnotator.h:103
VISKORES_CONT
#define VISKORES_CONT
Definition: ExportMacros.h:65
viskores
Groups connected points that have the same field value.
Definition: Atomic.h:27
viskores::Float32
float Float32
Base type to use for 32-bit floating-point numbers.
Definition: Types.h:165
viskores::rendering::LineRendererBatcher
Definition: LineRendererBatcher.h:34
LineRendererBatcher.h
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::rendering::WorldAnnotator::AddLine
void AddLine(viskores::Float64 x0, viskores::Float64 y0, viskores::Float64 z0, viskores::Float64 x1, viskores::Float64 y1, viskores::Float64 z1, viskores::Float32 lineWidth, const viskores::rendering::Color &color, bool inFront=false) const
Definition: WorldAnnotator.h:47
Color.h
viskores_rendering_export.h
Canvas.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::Float64, 3 >
viskores::rendering::WorldAnnotator::AddText
void AddText(viskores::Float32 originX, viskores::Float32 originY, viskores::Float32 originZ, viskores::Float32 rightX, viskores::Float32 rightY, viskores::Float32 rightZ, viskores::Float32 upX, viskores::Float32 upY, viskores::Float32 upZ, viskores::Float32 scale, viskores::Float32 anchorX, viskores::Float32 anchorY, const viskores::rendering::Color &color, const std::string &text) const
Definition: WorldAnnotator.h:77
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