Locus No Pilotus
Project of four first grade MIPT DAFE/RSE students (for engineering practical work in the second semester) in Qt C++
Loading...
Searching...
No Matches
gui::TrappyCircle Class Reference

Фигура опасной зоны More...

#include <trappy_circle.h>

Inheritance diagram for gui::TrappyCircle:
Collaboration diagram for gui::TrappyCircle:

Public Member Functions

 TrappyCircle ()=default
 
 TrappyCircle (const lib::TrappyCircle &data, QColor color=QColor(200, 50, 50, 255))
 
 TrappyCircle (const TrappyCircle &)=default
 
 TrappyCircle (double x, double y, double radius, QColor color=QColor(200, 50, 50, 255))
 
 TrappyCircle (lib::Point center, double radius, QColor color=QColor(200, 50, 50, 255))
 
 TrappyCircle (TrappyCircle &&)=default
 
void Draw (QCustomPlot *plot) override
 Отрисовывает фигуру на полотне
 
lib::Point GetCenter () const
 
QColor GetColor () const
 
lib::TrappyCircleGetData ()
 
const lib::TrappyCircleGetData () const
 
QCPItemEllipse * GetItemEllipsePtr () const
 Возвращает значение указателя на полотне
 
double GetRadius () const
 
TrappyCircleoperator= (const TrappyCircle &)=default
 
TrappyCircleoperator= (TrappyCircle &&)=default
 
bool operator== (const gui::TrappyCircle &tr_circle) const
 
void SetCenter (const lib::Point &center)
 
void SetRadius (double radius)
 

Private Attributes

QColor color_
 
lib::TrappyCircle data_
 
QCPItemEllipse * ellipse_ {nullptr}
 

Detailed Description

Фигура опасной зоны

Фигура представляет собой красный круг с полупрозрачной заливкой (красный по умолчанию, однако цвет задаётся в аргументах конструктора)

Constructor & Destructor Documentation

◆ TrappyCircle() [1/6]

gui::TrappyCircle::TrappyCircle ( )
default

◆ TrappyCircle() [2/6]

gui::TrappyCircle::TrappyCircle ( double x,
double y,
double radius,
QColor color = QColor(200, 50, 50, 255) )
inline
20 : data_(lib::Point{x, y}, radius), color_{color} {}
QColor color_
Definition trappy_circle.h:65
lib::TrappyCircle data_
Definition trappy_circle.h:64
Математическая точка
Definition point.h:16

◆ TrappyCircle() [3/6]

gui::TrappyCircle::TrappyCircle ( lib::Point center,
double radius,
QColor color = QColor(200, 50, 50, 255) )
inline
24 : data_(center, radius), color_{color} {}

◆ TrappyCircle() [4/6]

gui::TrappyCircle::TrappyCircle ( const lib::TrappyCircle & data,
QColor color = QColor(200, 50, 50, 255) )
inline
28 : data_(data), color_{color} {}

◆ TrappyCircle() [5/6]

gui::TrappyCircle::TrappyCircle ( const TrappyCircle & )
default

◆ TrappyCircle() [6/6]

gui::TrappyCircle::TrappyCircle ( TrappyCircle && )
default

Member Function Documentation

◆ Draw()

void gui::TrappyCircle::Draw ( QCustomPlot * plot)
overridevirtual

Отрисовывает фигуру на полотне

Фигура представляет собой красный круг с полупрозрачной заливкой (красный по умолчанию, однако цвет задаётся в аргументах конструктора)

Parameters
plotуказатель на полотно

Implements gui::Drawable.

10 {
11 ellipse_ = new QCPItemEllipse(plot);
12
13 QColor fill_color = QColor(color_.red(), color_.green(), color_.blue(), 100);
14
15 ellipse_->setPen(QColor(color_));
16 ellipse_->setBrush(fill_color);
18}
double GetRadius() const
Definition trappy_circle.h:37
lib::Point GetCenter() const
Definition trappy_circle.h:36
QCPItemEllipse * ellipse_
Definition trappy_circle.h:66
static void SetCenterAndRadiusCoords(QCPItemEllipse *&ellipse, lib::Point center, double rad)
Definition trappy_circle.cpp:4
Here is the call graph for this function:

◆ GetCenter()

lib::Point gui::TrappyCircle::GetCenter ( ) const
inline
36{ return data_.GetCenter(); }
Point GetCenter() const
Definition trappy_circle.h:24
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetColor()

QColor gui::TrappyCircle::GetColor ( ) const
inline
38{ return color_; }

◆ GetData() [1/2]

lib::TrappyCircle & gui::TrappyCircle::GetData ( )
inline
40{ return data_; }

◆ GetData() [2/2]

const lib::TrappyCircle & gui::TrappyCircle::GetData ( ) const
inline
39{ return data_; }
Here is the caller graph for this function:

◆ GetItemEllipsePtr()

QCPItemEllipse * gui::TrappyCircle::GetItemEllipsePtr ( ) const
inline

Возвращает значение указателя на полотне

Returns
QCPItemEllipse*: указатель
57{ return ellipse_; }

◆ GetRadius()

double gui::TrappyCircle::GetRadius ( ) const
inline
37{ return data_.GetRadius(); }
double GetRadius() const
Definition trappy_circle.h:25
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=() [1/2]

TrappyCircle & gui::TrappyCircle::operator= ( const TrappyCircle & )
default

◆ operator=() [2/2]

TrappyCircle & gui::TrappyCircle::operator= ( TrappyCircle && )
default

◆ operator==()

bool gui::TrappyCircle::operator== ( const gui::TrappyCircle & tr_circle) const
inline
59 {
60 return data_ == tr_circle.GetData();
61 }
const lib::TrappyCircle & GetData() const
Definition trappy_circle.h:39
Here is the call graph for this function:

◆ SetCenter()

void gui::TrappyCircle::SetCenter ( const lib::Point & center)
inline
42{ data_.SetCenter(center); }
void SetCenter(const Point &center)
Definition trappy_circle.h:27
Here is the call graph for this function:

◆ SetRadius()

void gui::TrappyCircle::SetRadius ( double radius)
inline
43{ data_.SetRadius(radius); }
void SetRadius(double r)
Definition trappy_circle.h:32
Here is the call graph for this function:

Member Data Documentation

◆ color_

QColor gui::TrappyCircle::color_
private

◆ data_

lib::TrappyCircle gui::TrappyCircle::data_
private

◆ ellipse_

QCPItemEllipse* gui::TrappyCircle::ellipse_ {nullptr}
private
66{nullptr};

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