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
|
class Point
{
public:
Point() : x1(0),x2(0),onGamma(false) {};
Point(const Point &P) : x1(P.x1),x2(P.x2),onGamma(P.onGamma) {};
Point(double x1,double x2, bool Gamma=false) : x1(x1),x2(x2),onGamma(Gamma) {};
private:
double x1,x2;
bool onGamma;
};
class Points
{
public:
Points() : nb_pts(0) {};
Points(Point P) : nb_pts(1) { vect_pts.push_back(P); };
Points(Points& P) { nb_pts = P.nb_points(); for(int i=0; i<P.nb_points(); ++i) vect_pts.push_back(P[i]); };
~Points() { nb_pts = 0; vect_pts.clear(); };
private:
int nb_pts;
vector<Point> vect_pts;
};
class Triangle
{
public:
Triangle(Point P, Point Q, Point R) : P1(P),P2(Q),P3(R) {};
private:
Point P1,P2,P3;
};
class Triangles
{
public:
Triangles() : nb_tri(0) {};
Triangles(Triangle T) : nb_tri(1) { vect_triangles.push_back(T); };
~Triangles() { nb_tri = 0; vect_triangles.clear(); };
private:
int nb_tri;
vector<Triangle> vect_triangles;
}; |
Partager