Bridges-C++  3.1.1
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 
29  static constexpr double DEFAULT_THICKNESS() {
30  return 1.0;
31  }
32  static Color DEFAULT_COLOR() {
33  return Color("steelblue");
34  }; //SteelBlue
35 
36  private:
37 
38  Color color = DEFAULT_COLOR();
39  string label = "";
40  double thickness = DEFAULT_THICKNESS();
41 
42  public:
52  double th = DEFAULT_THICKNESS()):
53  color(col) {
54  setThickness(th);
55  }
56 
61  string getLabel() const {
62  return label;
63  }
64 
70  void setLabel(const string& lab) {
71  label = lab;
72  }
73 
81  void setThickness(const double& th) {
82  if (th < 1 || 10 < th)
83  throw "Invalid Thickness Value.. " + to_string(th) +
84  " Must be in the [1.0,10.0] range";
85  else
86  thickness = th;
87  }
92  double getThickness() const {
93  return thickness;
94  }
95 
101  void setColor(const Color& col) {
102  color = col;
103  }
108  void setColor(const string& col) {
109  color = Color(col);
110  }
111 
116  Color getColor() const {
117  return color;
118  }
119  }; //end of LinkVisualizer class
120  }
121 }//end of bridges namespace
122 #endif
This class represents Color, and supports rgba, hexadecimal and named color values.
Definition: Color.h:51
these methods convert byte arrays in to base64 codes and are used in BRIDGES to represent the color a...
Definition: alltypes.h:4