-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapidrawer.h
38 lines (33 loc) · 1.65 KB
/
apidrawer.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
#ifndef APIDRAWER_H
#define APIDRAWER_H
#include <QPoint>
#include <QSize>
#include <vector>
#include <algorithm>
#include <cmath>
const float CAVALIER = 0.70710678118654752440084436210485f;
const float CABINET = 0.35355339059327376220042218105242f;
namespace Drawer{
using std::vector;
using VPoints = vector<QPoint>;
int sqr(int num);
int dist(const QPoint &p1, const QPoint &p2);
QPoint cabinet(int x, int y, int z);
QPoint cavalier(int x, int y, int z);
VPoints drawLine(int x1, int y1, int x2, int y2);
VPoints drawLine(const QPoint &from, const QPoint &to);
VPoints drawDashedLine(const QPoint &from, const QPoint &to, int dash, int dot);
VPoints drawRect(const QPoint &topLelf, const QSize &size);
VPoints drawRect(const QPoint &topLeft, const QPoint &topRight,const QPoint &bottomLeft, const QPoint &bottomRight);
VPoints drawCircle(const QPoint ¢er, int radius);
VPoints drawHalfTopEllipse(const QPoint ¢er, int xRadius, int yRadius);
VPoints drawHalfBotEllipse(const QPoint ¢er, int xRadius, int yRadius);
VPoints drawEllipse(const QPoint ¢er, int xRadius, int yRadius);
VPoints drawCube(int x, int y, int z, int width, int height, int length, QPoint (*method)(int, int, int) = cavalier);
VPoints drawSphere(int x, int y, int z, int r, QPoint (*method)(int, int, int) = cavalier);
VPoints drawCylinder(int cx, int cy, int cz, int r, int h, QPoint (*method)(int, int, int) = cavalier);
VPoints floodFill(const VPoints &border, const QPoint &point);
VPoints toDashDot(const VPoints &points, int dash, int dot);
VPoints drawEllipseUtil(const QPoint ¢er, int xRadius, int yRadius, void (*addPoint)(VPoints&, int, int, int, int)) ;
};
#endif // APIDRAWER_H