Bridges-C++  3.4.2
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  }
100  double getThickness() const {
101  return thickness;
102  }
103 
109  void setColor(const Color& col) {
110  color = col;
111  }
116  void setColor(const string& col) {
117  color = Color(col);
118  }
119 
124  Color getColor() const {
125  return color;
126  }
127  }; //end of LinkVisualizer class
128  }
129 }//end of bridges namespace
130 #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