-
Notifications
You must be signed in to change notification settings - Fork 1
/
pie.h
43 lines (33 loc) · 927 Bytes
/
pie.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/**
@file pie.h
Определяет сектор круга
*/
#ifndef PIE_H
#define PIE_H
#include "abstractshape.h"
namespace pashazz
{
class Pie : public AbstractShape
{
public:
Pie(Point2D centre, double radius, double start = 0, double span = M_PI/2)
:AbstractShape(centre), m_radius(radius), m_start(start), m_span(span) {}
~Pie();
void setStartAngle(double a) {m_start = a;}
double startAngle() const {return m_start;}
void setSpanAngle(double a) {m_span = a;}
double spanAngle() const {return m_span;}
void setRadius (double r) {m_radius = r;}
double radius() {return m_radius;}
bool isInside(const Point2D &point) const;
void paint(QPainter *p) const;
void move(const Point2D &delta)
{
setCentre(m_centre + delta);
}
private:
double m_radius, m_start, m_span;
static int radiansToDegrees16(double rad);
};
}
#endif // PIE_H