-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpolyangle.h
41 lines (35 loc) · 1.08 KB
/
polyangle.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
#ifndef POLYANGLE_H
#define POLYANGLE_H
#include <QVector>
#include "vector2d.h"
#include "mathutils.h"
#include "droite.h"
class Polyangle
{
protected:
QVector<Vector2D> lesPoints;
public:
Polyangle();
Polyangle(const Polyangle& poly);
Polyangle(QVector<Vector2D> points);
double area() const;
double perimetre() const ;
Polyangle shrink(const double l) const;
void uncross();
bool split(Polyangle& p1, Polyangle& p2, Polyangle& route, const Droite& d, const double largeurDemiRoute) const;
bool split(Polyangle& p1, Polyangle& p2, const Droite& d) const;
void checkSens();
std::pair<int, int> getHighestPair() const;
float plusPetitCote() const;
Vector2D getCentre() const;
Polyangle getIncircle(int definition) const;
QVector<Vector2D> getLesPoints() const;
void setLesPoints(const QVector<Vector2D> &value);
};
inline std::ostream& operator<<(std::ostream& out, const Polyangle& p){
for (int i=0 ;i<p.getLesPoints().size();++i){
out<<p.getLesPoints().at(i)<<" / ";
}
return out;
}
#endif // POLYANGLE_H