17const double pi{std::acos(-1.0)};
46 :
c{Fl_Color(_c)},
v{static_cast<unsigned char>(_v)} {}
51 :
c{Fl_Color()},
v{static_cast<unsigned char>(_v)} {}
57 inline unsigned int as_uint()
const {
return c; }
88 :
s{_points},
width{_width} {}
96 inline unsigned int style()
const {
return s; }
134 inline Font(
unsigned int _f) :
f{_f} {}
158 inline Shape(std::initializer_list<Point> _points) {
187 virtual void move(
int dx,
int dy);
252 using Open_polyline::Open_polyline;
268 inline Lines(std::initializer_list<Point> _points) :
Shape{_points} {
269 if (_points.size() % 2)
270 throw std::invalid_argument(
"odd number of points for Lines");
314 Font fnt{
static_cast<unsigned int>(fl_font())};
315 unsigned int fnt_sz{(14 < fl_size()) ?
static_cast<unsigned int>(fl_size())
328 std::initializer_list<Point> _points)
370 inline void draw(
int x,
int y,
int,
int,
int,
int)
override {
404 void move(
int dx,
int dy)
override;
unsigned int pix_amount
Definition Point.h:3
Bad_image(int h, int w)
Definition Shapes.h:366
void draw(int x, int y, int, int, int, int) override
Definition Shapes.h:370
unsigned int as_uint() const
Definition Shapes.h:138
Font_type
Definition Shapes.h:113
@ times_bold_italic
Definition Shapes.h:125
@ zapf_dingbats
Definition Shapes.h:129
@ times_italic
Definition Shapes.h:124
@ courier_bold_italic
Definition Shapes.h:121
@ courier_italic
Definition Shapes.h:120
@ times
Definition Shapes.h:122
@ screen
Definition Shapes.h:127
@ helvetica_italic
Definition Shapes.h:116
@ helvetica
Definition Shapes.h:114
@ helvetica_bold
Definition Shapes.h:115
@ symbol
Definition Shapes.h:126
@ courier_bold
Definition Shapes.h:119
@ times_bold
Definition Shapes.h:123
@ courier
Definition Shapes.h:118
@ screen_bold
Definition Shapes.h:128
@ helvetica_bold_italic
Definition Shapes.h:117
Font(unsigned int _f)
Definition Shapes.h:134
Font(Font_type _f)
Definition Shapes.h:132
unsigned int f
Definition Shapes.h:145
void set_mask(Point _loc, pix_amount _width, pix_amount _height)
Definition Shapes.h:397
Text text
Definition Shapes.h:415
~Image()
Definition Shapes.h:391
pix_amount width
Definition Shapes.h:411
Image(Point _loc, const std::string &s, Suffix::Encoding e=Suffix::none)
Definition Shapes.cpp:140
void move(int dx, int dy) override
Definition Shapes.cpp:177
pix_amount height
Definition Shapes.h:411
Fl_Image * img_ptr
Definition Shapes.h:414
void draw_lines() const override
Definition Shapes.cpp:168
pix_amount cy
Definition Shapes.h:413
pix_amount cx
Definition Shapes.h:412
Простая линяя, сост. из двух точек
Definition Shapes.h:223
Line(Point point_1, Point point_2)
Definition Shapes.h:225
Независимые линии
Definition Shapes.h:264
Lines(std::initializer_list< Point > _points)
Definition Shapes.h:268
void add(Point point_1, Point point_2)
Definition Shapes.h:277
void draw_lines() const override
Definition Shapes.cpp:63
Mark(Point _loc, char c)
Definition Shapes.h:361
void draw_lines() const override
Definition Shapes.cpp:93
Marked_polyline(const std::string &_mark, std::initializer_list< Point > _points)
Definition Shapes.h:327
Marked_polyline(std::initializer_list< Point > _points)
Definition Shapes.h:331
Marked_polyline(const std::string &_mark)
Definition Shapes.h:325
std::string mark
Definition Shapes.h:343
Marks(const std::string &m)
Definition Shapes.h:352
Открытая последовательность линий
Definition Shapes.h:234
void draw_lines() const override
Definition Shapes.cpp:37
void add(Point p)
Definition Shapes.h:240
Абстрактная фигура
Definition Shapes.h:154
Line_style ls
Definition Shapes.h:214
size_t number_of_points() const
Definition Shapes.h:203
Color color() const
Definition Shapes.h:191
void set_point(int i, Point p)
Definition Shapes.h:178
void draw() const
Definition Shapes.cpp:10
Shape(std::initializer_list< Point > _points)
Definition Shapes.h:158
Shape & operator=(const Shape &)=delete
Line_style get_style() const
Definition Shapes.h:195
void set_color(Color _color)
Definition Shapes.h:189
virtual void move(int dx, int dy)
Definition Shapes.cpp:28
void add(Point p)
Definition Shapes.h:176
Color c
Definition Shapes.h:213
Shape(const Shape &)=delete
Color f_c
Definition Shapes.h:215
void set_fill_color(Color _color)
Definition Shapes.h:197
std::vector< Point > points
Definition Shapes.h:212
void set_style(Line_style sty)
Definition Shapes.h:193
virtual ~Shape()=0
Definition Shapes.cpp:35
virtual void draw_lines() const
Definition Shapes.cpp:20
Point point(int i) const
Definition Shapes.h:201
Color fill_color() const
Definition Shapes.h:199
unsigned int font_size() const
Definition Shapes.h:306
void draw_lines() const override
Definition Shapes.cpp:71
Text(Point _loc, const std::string &s)
Definition Shapes.h:290
void set_label(const std::string &s)
Definition Shapes.h:296
Font font() const
Definition Shapes.h:302
unsigned int fnt_sz
Definition Shapes.h:315
std::string lab
Definition Shapes.h:313
void set_font_size(unsigned int s)
Definition Shapes.h:304
Font fnt
Definition Shapes.h:314
std::string label() const
Definition Shapes.h:298
void set_font(Font f)
Definition Shapes.h:300
const double pi
Definition Shapes.h:17
Suffix::Encoding get_encoding(const std::string &s)
Definition Shapes.cpp:117
Закрытая последовательность линий
Definition Shapes.h:250
void draw_lines() const override
Definition Shapes.cpp:53
Цвет, с учетом прозрачности
Definition Shapes.h:23
unsigned int as_uint() const
Definition Shapes.h:57
Color_type
Definition Shapes.h:24
@ magenta
Definition Shapes.h:31
@ dark_cyan
Definition Shapes.h:38
@ dark_magenta
Definition Shapes.h:37
@ dark_blue
Definition Shapes.h:36
@ dark_red
Definition Shapes.h:33
@ white
Definition Shapes.h:29
@ black
Definition Shapes.h:30
@ dark_green
Definition Shapes.h:34
@ yellow
Definition Shapes.h:28
@ cyan
Definition Shapes.h:32
@ green
Definition Shapes.h:27
@ blue
Definition Shapes.h:26
@ dark_yellow
Definition Shapes.h:35
@ red
Definition Shapes.h:25
Color(Transparency _v)
Definition Shapes.h:50
Color(Color_type _c)
Definition Shapes.h:43
unsigned char v
Definition Shapes.h:69
Fl_Color c
Definition Shapes.h:68
Transparency
Definition Shapes.h:41
@ invisible
Definition Shapes.h:41
@ visible
Definition Shapes.h:41
Color(unsigned int _c)
Definition Shapes.h:48
void set_visibility(Transparency _v)
Definition Shapes.h:61
Color(Color_type _c, Transparency _v)
Definition Shapes.h:45
char visibility() const
Definition Shapes.h:59
Line_style(unsigned int _s)
Definition Shapes.h:90
pix_amount w() const
Definition Shapes.h:94
Line_style(Line_style_type _points, pix_amount _width)
Definition Shapes.h:87
pix_amount width
Definition Shapes.h:104
unsigned int style() const
Definition Shapes.h:96
Line_style_type
Definition Shapes.h:77
@ dashdotdot
Definition Shapes.h:82
@ dash
Definition Shapes.h:79
@ dot
Definition Shapes.h:80
@ solid
Definition Shapes.h:78
@ dashdot
Definition Shapes.h:81
Line_style(Line_style_type _s)
Definition Shapes.h:85
unsigned int s
Definition Shapes.h:103
pix_amount y
Definition Point.h:30
pix_amount x
Definition Point.h:30
Encoding
Definition Shapes.h:380
@ png
Definition Shapes.h:380
@ none
Definition Shapes.h:380
@ bmp
Definition Shapes.h:380
@ gif
Definition Shapes.h:380
@ jpg
Definition Shapes.h:380