OverlayPlot.h
1 //##################################################################################################
2 //
3 // Ceetron Desktop Components
4 // Component: Plot2d
5 //
6 // --------------------------------------------------------------------------------------------
7 // Copyright (C) 2016, Ceetron AS
8 // This is UNPUBLISHED PROPRIETARY SOURCE CODE of Ceetron AS. The contents of this file may
9 // not be disclosed to third parties, copied or duplicated in any form, in whole or in part,
10 // without the prior written permission of Ceetron AS.
11 //##################################################################################################
12 
13 #pragma once
14 
15 #include "CeePlot2d/Base.h"
16 
17 #include "CeeVisualization/OverlayItem.h"
18 
19 #include "CeeCore/Str.h"
20 
21 namespace cee {
22 class Color3f;
23 
24 namespace vis {
25 class Font;
26 }
27 
28 namespace plt {
29 class AxisSettings;
30 class MarkerLine;
31 class Curve;
32 
33 //==================================================================================================
34 //
35 // A plot that can be used as an overlay item in a view
36 //
37 //==================================================================================================
38 class CEE_PLT_EXPORT OverlayPlot : public vis::OverlayItem
39 {
40 public:
43  {
45  BELOW
46  };
47 
48 public:
49  OverlayPlot(vis::Font* font);
50  virtual ~OverlayPlot();
51 
52  virtual unsigned int width() const;
53  virtual unsigned int height() const;
54  void setSize(unsigned int width, unsigned int height);
55 
56  virtual int priority() const;
57  virtual void setPriority(int priority);
58 
59  Str title() const;
60  void setTitle(const Str& title);
61 
62  bool drawBackground() const;
63  void setDrawBackground(bool drawBackground);
64 
65  Color3f backgroundColor() const;
66  void setBackgroundColor(const Color3f& color);
67 
68  float backgroundOpacity() const;
69  void setBackgroundOpacity(float opacity);
70 
71  Color3f borderColor() const;
72  void setBorderColor(const Color3f& color);
73 
74  float borderWidth() const;
75  void setBorderWidth(float width);
76 
77  bool drawBorder() const;
78  void setDrawBorder(bool drawBorder);
79 
80  const AxisSettings& axisSettings() const;
81  AxisSettings& axisSettings();
82 
83  const MarkerLine& markerLine() const;
84  MarkerLine& markerLine();
85 
86  bool drawCurveLegend() const;
87  void setDrawCurveLegend(bool drawCurveLegend);
88  LegendPosition curveLegendPosition() const;
89  void setCurveLegendPosition(LegendPosition position);
90 
91  Color3f textColor() const;
92  void setTextColor(const Color3f& color);
93 
94  void setFont(vis::Font* font);
95 
96  size_t curveCount() const;
97  const Curve* curve(size_t curveIndex) const;
98  Curve* curve(size_t curveIndex);
99  Curve* addCurve(const Str& curveName, const std::vector<double>& xValues, const std::vector<double>& yValues);
100  void removeAllCurves();
101  void removeCurve(size_t curveIndex);
102 
103  double xValuesMinimum() const;
104  double xValuesMaximum() const;
105  double yValuesMinimum() const;
106  double yValuesMaximum() const;
107 
108 private:
109  virtual cvf::OverlayItem* internal_cvfOverlayItem();
110 
111 private:
112  CEE_PRIVATE_IMPL(OverlayPlot);
113  CEE_DISALLOW_COPY_AND_ASSIGN(OverlayPlot);
114 };
115 
116 } // namespace plt
117 } // namespace cee
Namespace cee contains all functionality and structures under the Core component. ...
Definition: AppComponent.cpp:26
A general unicode based string class.
Definition: Str.h:28
Abstract interface for overlay items.
Definition: OverlayItem.h:31
Show the legend to the right of the plot.
Definition: OverlayPlot.h:44
Class for storing an RGB color triplet.
Definition: Color3f.h:25
Settings for a marker line in an OverlayPlot object.
Definition: MarkerLine.h:30
Overlay item with basic 2D plotting.
Definition: OverlayPlot.h:38
Axis settings for an OverlayPlot object.
Definition: AxisSettings.h:30
A 2D data series for use in an OverlayPlot.
Definition: Curve.h:32
A font used for text drawing.
Definition: Font.h:30
LegendPosition
Position of the plot legend.
Definition: OverlayPlot.h:42