-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpolygon.h
More file actions
48 lines (33 loc) · 1.36 KB
/
polygon.h
File metadata and controls
48 lines (33 loc) · 1.36 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
#ifndef CPolygon_H
#define CPolygon_H
#include <QtOpenGL>
#include <utility>
#include <vector>
#include <list>
//#include <tuple>
#include "lowlevelgeometry.h"
using namespace std;
class CPolygon
{
private:
vector<Point> vertexes_;
array<double, 4> color_;
public:
CPolygon(array<double, 4> color = {{0.20f, 0.20f, 1.00f, 0.5f}});
CPolygon(vector<Point> vertexes, array<double, 4> color = {{0.20f, 0.20f, 1.00f, 0.5f}});
CPolygon(list<Point> vertexes, array<double, 4> color = {{0.20f, 0.20f, 1.00f, 0.5f}});
CPolygon& operator = (CPolygon const & CPolygon);
void clear();
inline void addVertex(const Point &vertex); // Добавляем вершину (в конец, а последовательность важна)
void addVertexesList(const list<Point> &vertexes);
void draw(); // Рисуем полигон
bool empty();
// Принимаем плоскость и две ссылки на указатели
// Если функция создаёт полигоны, то первый обязательно НАД секущей плоскостью (>0)
bool polygonSection(Plane plane,
CPolygon* CPolygonPointer1,
CPolygon* CPolygonPointer2,
list<Point>* sectionStraightLine);
//void drawCPolygon();
};
#endif // CPolygon_H