codac 2.0.0
Loading...
Searching...
No Matches
codac2_StyleProperties.h
Go to the documentation of this file.
1
9
10#pragma once
11
12#include <string>
13#include <set>
14#include "codac2_Color.h"
15
16namespace codac2
17{
18
26 {
27 Color stroke_color = Color::black();
28 Color fill_color = Color::none();
29 std::string line_style = "-";
30 double line_width = 0.;
31 std::string layer = "alpha";
32
39
48 StyleProperties(const Color& stroke_color, const std::string& param1 = "", const std::string& param2 = "", const std::string& param3 = "");
49
58 StyleProperties(std::initializer_list<Color> colors, const std::string& param1 = "", const std::string& param2 = "", const std::string& param3 = "");
59
65 void parse_parameter(const std::string& param);
66
71
76
81
85 static std::set<std::string> available_line_styles()
86 {
87 std::set<std::string> line_styles={"-", "--", "..", "-.", "-.."};
88 return line_styles;
89 };
90
91 };
92}
Color structure, in RGBA or HSVA format.
Definition codac2_Color.h:44
static Color none()
Empty color (transparent white)
Definition codac2_Color.h:155
static std::set< std::string > available_line_styles()
Set of available line styles.
Definition codac2_StyleProperties.h:85
static StyleProperties inside()
Predefined "inside" style, dark gray edge and green fill.
static StyleProperties outside()
Predefined "outside" style, dark gray edge and light blue fill.
StyleProperties(std::initializer_list< Color > colors, const std::string &param1="", const std::string &param2="", const std::string &param3="")
Constructor from a stroke and eventually a fill color, and two optional parameters.
StyleProperties()
Default constructor.
void parse_parameter(const std::string &param)
Parse a parameter and update the style properties accordingly.
StyleProperties(const Color &stroke_color, const std::string &param1="", const std::string &param2="", const std::string &param3="")
Constructor from a stroke color, and two optional parameters.
static StyleProperties boundary()
Predefined "boundary" style, dark gray edge and yellow fill.