Graphic Calculator: FIDocalcus
Проект трёх первокурсников (по инженерному практикуму в первом семестре) по созданию графического калькулятора на FLTK C++
Loading...
Searching...
No Matches
Graph_lib::Closed_polyline Struct Reference

Закрытая последовательность линий More...

#include <Shapes.h>

Inheritance diagram for Graph_lib::Closed_polyline:
Collaboration diagram for Graph_lib::Closed_polyline:

Public Member Functions

void add (Point p)
 
Color color () const
 
void draw () const
 
void draw_lines () const override
 
Color fill_color () const
 
Line_style get_style () const
 
virtual void move (int dx, int dy)
 
size_t number_of_points () const
 
Point point (int i) const
 
void set_color (Color _color)
 
void set_fill_color (Color _color)
 
void set_style (Line_style sty)
 
 Shape ()=default
 
 Shape (const Shape &)=delete
 
 Shape (std::initializer_list< Point > _points)
 

Protected Member Functions

void set_point (int i, Point p)
 

Private Attributes

Color c {static_cast<Color>(fl_color())}
 
Color f_c {Color::invisible}
 
Line_style ls {0}
 
std::vector< Pointpoints
 

Detailed Description

Закрытая последовательность линий

Member Function Documentation

◆ add()

void Graph_lib::Open_polyline::add ( Point p)
inlineinherited
240{ Shape::add(p); }
void add(Point p)
Definition Shapes.h:176
Here is the call graph for this function:
Here is the caller graph for this function:

◆ color()

Color Graph_lib::Shape::color ( ) const
inlineinherited
191{ return c; }
Color c
Definition Shapes.h:213
Here is the caller graph for this function:

◆ draw()

void Graph_lib::Shape::draw ( ) const
inherited
10 {
11 Fl_Color prev_color = fl_color(); // не существует хорошего портативного
12 // способа получения текущего стиля
15 draw_lines();
16 fl_color(prev_color); // reset color (к предыдущему) and style (к дефолтному)
18}
Line_style ls
Definition Shapes.h:214
virtual void draw_lines() const
Definition Shapes.cpp:20
W & reference_to(void *ptr_wid)
Definition Widgets.h:16
unsigned int as_uint() const
Definition Shapes.h:57
pix_amount w() const
Definition Shapes.h:94
unsigned int style() const
Definition Shapes.h:96
Here is the call graph for this function:
Here is the caller graph for this function:

◆ draw_lines()

void Graph_lib::Closed_polyline::draw_lines ( ) const
overridevirtual

Reimplemented from Graph_lib::Shape.

53 {
55
56 if (color().visibility())
58 point(0).x, point(0).y);
59}
void draw_lines() const override
Definition Shapes.cpp:37
size_t number_of_points() const
Definition Shapes.h:203
Color color() const
Definition Shapes.h:191
Point point(int i) const
Definition Shapes.h:201
Here is the call graph for this function:

◆ fill_color()

Color Graph_lib::Shape::fill_color ( ) const
inlineinherited
199{ return f_c; }
Color f_c
Definition Shapes.h:215
Here is the caller graph for this function:

◆ get_style()

Line_style Graph_lib::Shape::get_style ( ) const
inlineinherited
195{ return ls; }

◆ move()

void Graph_lib::Shape::move ( int dx,
int dy )
virtualinherited

Reimplemented in Graph_lib::Image.

28 {
29 for (unsigned int i = 0; i < points.size(); ++i) {
30 points[i].x += dx;
31 points[i].y += dy;
32 }
33}
std::vector< Point > points
Definition Shapes.h:212
Here is the caller graph for this function:

◆ number_of_points()

size_t Graph_lib::Shape::number_of_points ( ) const
inlineinherited
203{ return points.size(); }
Here is the caller graph for this function:

◆ point()

Point Graph_lib::Shape::point ( int i) const
inlineinherited
201{ return points[i]; }
Here is the caller graph for this function:

◆ set_color()

void Graph_lib::Shape::set_color ( Color _color)
inlineinherited
189{ c = _color; }
Here is the caller graph for this function:

◆ set_fill_color()

void Graph_lib::Shape::set_fill_color ( Color _color)
inlineinherited
197{ f_c = _color; }

◆ set_point()

void Graph_lib::Shape::set_point ( int i,
Point p )
inlineprotectedinherited
178{ points[i] = p; }

◆ set_style()

void Graph_lib::Shape::set_style ( Line_style sty)
inlineinherited
193{ ls = sty; }

◆ Shape() [1/3]

Graph_lib::Shape::Shape ( )
inlinedefaultinherited

◆ Shape() [2/3]

Graph_lib::Shape::Shape ( const Shape & )
inlinedeleteinherited

◆ Shape() [3/3]

Graph_lib::Shape::Shape ( std::initializer_list< Point > _points)
inlineinherited
158 {
159 for (Point point : _points) add(point);
160 }
void add(Point p)
Definition Shapes.h:240

Member Data Documentation

◆ c

Color Graph_lib::Shape::c {static_cast<Color>(fl_color())}
privateinherited
213{static_cast<Color>(fl_color())};

◆ f_c

Color Graph_lib::Shape::f_c {Color::invisible}
privateinherited
@ invisible
Definition Shapes.h:41

◆ ls

Line_style Graph_lib::Shape::ls {0}
privateinherited
214{0};

◆ points

std::vector<Point> Graph_lib::Shape::points
privateinherited

The documentation for this struct was generated from the following files: