-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEllipse.h
More file actions
70 lines (53 loc) · 1.54 KB
/
Ellipse.h
File metadata and controls
70 lines (53 loc) · 1.54 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//
// Ellipse.hpp
//
// Created by Jean-Yves Hervé on 2023-09-14.
//
#ifndef ELLIPSE_H
#define ELLIPSE_H
#include "GraphicObject.h"
namespace earshooter
{
class Ellipse : public GraphicObject
{
friend bool initEllipseFunc();
friend void drawDisk();
friend void drawArc(float startFrac, float endFrac);
private:
float radiusX_, radiusY_;
float red_, green_, blue_;
static const int numCirclePts_;
static float** circlePts_;
protected:
void draw_() const;
void updateAbsoluteBox_() const;
public:
Ellipse(float centerX, float centerY, float angle, float radiusX, float radiusY,
float r, float g, float b);
Ellipse(const WorldPoint& pt, float angle, float radiusX, float radiusY,
float r, float g, float b);
Ellipse(float centerX, float centerY, float radius,
float r, float g, float b);
Ellipse(const WorldPoint& pt, float radius,
float r, float g, float b);
~Ellipse() = default;
//disabled constructors & operators
Ellipse() = delete;
Ellipse(const Ellipse& obj) = delete; // copy
Ellipse(Ellipse&& obj) = delete; // move
Ellipse& operator = (const Ellipse& obj) = delete; // copy operator
Ellipse& operator = (Ellipse&& obj) = delete; // move operator
inline float getRed() const {
return red_;
}
inline void setRed(float red) {
// check red in range
red_ = red;
}
bool isInside(const WorldPoint& pt) const;
};
bool initEllipseFunc();
void drawDisk();
void drawArc(float startFrac, float endFrac);
}
#endif // ELLIPSE_H