Bridges-C++  3.4.5-dev1-6-g935685a
Bridges(C++ API)
LinkVisualizer.h
Go to the documentation of this file.
1 #ifndef LINK_VISUALIZER_H
2 #define LINK_VISUALIZER_H
3 
4 #include "Color.h" //string, using std
5 
6 namespace bridges {
7  namespace datastructure {
27  public:
28 
32  static constexpr double DEFAULT_THICKNESS() {
33  return 1.0;
34  }
38  static Color DEFAULT_COLOR() {
39  return Color("steelblue");
40  }; //SteelBlue
41 
42  private:
43 
44  Color color = DEFAULT_COLOR();
45  string label = "";
46  double thickness = DEFAULT_THICKNESS();
47 
48  public:
60  double th = DEFAULT_THICKNESS()):
61  color(col) {
62  setThickness(th);
63  }
64 
69  string getLabel() const {
70  return label;
71  }
72 
78  void setLabel(const string& lab) {
79  label = lab;
80  }
81 
89  void setThickness(const double& th) {
90  if (th < 0.0 || 10 < th)
91  throw "Invalid Thickness Value.. " + to_string(th) +
92  " Must be in the ]0.0,10.0] range";
93  else {
94  thickness = th;
95  }
96  }
101  double getThickness() const {
102  return thickness;
103  }
104 
110  void setColor(const Color& col) {
111  color = col;
112  }
117  void setColor(const string& col) {
118  color = Color(col);
119  }
120 
125  Color getColor() const {
126  return color;
127  }
128  }; //end of LinkVisualizer class
129  }
130 }//end of bridges namespace
131 #endif
This class represents Color, and supports rgba, hexadecimal and named color values.
Definition: Color.h:50
Support for drawing Bar charts.
Definition: alltypes.h:4