@Surf_Rider
0 / 0 / 0
Регистрация: 15.05.2011
Сообщений: 22
|
28.08.2012, 12:04
[ТС]
|
|
ок, вот
C++ (Qt) | 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
| class Triangulation
{
public:
Triangulation(){;};
Triangulation( SList &listPoints ){ lp = listPoints; };
void triangulation(vector <Polygon_> &vn);
static bool isInTriangle(POINT &point, POINT &t1, POINT &t2, POINT &t3 );
void inputPoints();
void output();
double max(double &t1, double &t2);
double min(double &t1, double &t2);
double distPoints(POINT &t1, POINT &t2);
double squareTriang(POINT &p1, POINT &p2, POINT &p3);
bool inTriang(vector<Polygon_> &vn, POINT &p);
static double vp( POINT &a, POINT &b, POINT &c)
{ return (a.x*b.y - a.x*c.y - b.x*a.y + b.x*c.y + c.x*a.y - c.x*b.y ); }
static double scp( POINT &a, POINT &b, POINT &c )
{ return( (c.x - b.x)*(a.x - b.x) + (c.y - b.y)*(a.y - b.y) ); }
void appendtoTail(T &t){ lp.appendtoTail(t); }
void clear(){ lp.clear(); }
int size(){ return lp.size; }
private:
SList lp;
int direction;
void determineDirection();
}; |
|
0
|