Viskores  1.0
ColorLegendAnnotation.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_ColorLegendAnnotation_h
19 #define viskores_rendering_ColorLegendAnnotation_h
20 
22 
28 
29 namespace viskores
30 {
31 namespace rendering
32 {
33 
34 class VISKORES_RENDERING_EXPORT ColorLegendAnnotation
35 {
36 private:
39  std::vector<std::string> Labels;
40  std::vector<std::unique_ptr<TextAnnotationScreen>> Annot;
41  std::vector<viskores::rendering::Color> ColorSwatchList;
42 
43 public:
46  ColorLegendAnnotation& operator=(const ColorLegendAnnotation&) = delete;
47 
48  void Clear();
49  void AddItem(const std::string& label, viskores::rendering::Color color);
50 
51  void SetLabelColor(viskores::rendering::Color c) { this->LabelColor = c; }
52 
54  {
55  this->FontScale = s;
56  for (auto& annot : this->Annot)
57  annot->SetScale(s);
58  }
59 
60  void Render(const viskores::rendering::Camera&,
61  const viskores::rendering::WorldAnnotator& annotator,
63 };
64 }
65 } //namespace viskores::rendering
66 
67 #endif // viskores_rendering_ColorLegendAnnotation_h
viskores::rendering::ColorLegendAnnotation::SetLabelFontScale
void SetLabelFontScale(viskores::Float32 s)
Definition: ColorLegendAnnotation.h:53
viskores::rendering::ColorLegendAnnotation::FontScale
viskores::Float32 FontScale
Definition: ColorLegendAnnotation.h:37
viskores::rendering::ColorLegendAnnotation
Definition: ColorLegendAnnotation.h:34
viskores::rendering::ColorLegendAnnotation::Labels
std::vector< std::string > Labels
Definition: ColorLegendAnnotation.h:39
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
WorldAnnotator.h
viskores::rendering::ColorLegendAnnotation::ColorSwatchList
std::vector< viskores::rendering::Color > ColorSwatchList
Definition: ColorLegendAnnotation.h:41
TextAnnotationScreen.h
viskores::rendering::ColorLegendAnnotation::LabelColor
viskores::rendering::Color LabelColor
Definition: ColorLegendAnnotation.h:38
viskores::rendering::ColorLegendAnnotation::SetLabelColor
void SetLabelColor(viskores::rendering::Color c)
Definition: ColorLegendAnnotation.h:51
viskores::rendering::Camera
Specifies the viewport for a rendering.
Definition: Camera.h:45
Camera.h
Color.h
viskores_rendering_export.h
Canvas.h
viskores::rendering::ColorLegendAnnotation::Annot
std::vector< std::unique_ptr< TextAnnotationScreen > > Annot
Definition: ColorLegendAnnotation.h:40
viskores::rendering::WorldAnnotator
Definition: WorldAnnotator.h:35
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