/* * Label.hh * * Created on: 25 nov. 2013 * Author: CS */ #ifndef LABEL_HH_ #define LABEL_HH_ #include "Font.hh" #include "Color.hh" #include #include namespace plot { typedef boost::shared_ptr> LabelRowInfo; class Label { public: static const std::string DELIMITER; enum Style { BOLD, ITALIC, NORMAL }; Label() : _font(Font("", 0)), _color(0, 0, 0) { } Label(Font font) : _font(font), _color(0, 0, 0) { } Label(Font font, Color color) : _font(font), _color(color) { } Label(const Label& label) : _font(label._font), _style(label._style), _text( label._text), _color(label._color) { } virtual ~Label() { } static Style getStyle(std::string style) { if (style == "italic") { return Style::ITALIC; } else if (style == "bold") { return Style::BOLD; } return Style::NORMAL; } /** * @brief Determine number of line that compose label. */ static LabelRowInfo getRowNumber(Label const& pLegend); /** * Label font name and size. */ Font _font; /** * Label style. */ std::vector