2 // Class : Gestion des sommets
7 #include "HexEltBase.hxx"
11 class Vertex : public EltBase
14 double getX() { return v_x; }
15 double getY() { return v_y; }
16 double getZ() { return v_z; }
18 void setX (double v) { v_x = v ; }
19 void setY (double v) { v_y = v ; }
20 void setZ (double v) { v_z = v ; }
23 Vertex (Document* prev, double x=0.0, double y=0.0, double z=0.0);
24 Vertex (Vertex* other);
26 virtual void dump () ;
27 virtual void saveXml (XmlWriter& xml);
29 void setScalar (double val) { v_scalar = val ; }
30 double getScalar () { return v_scalar ; }
32 void setCoord (double x, double y, double z);
33 bool isin (double xmin, double xmax, double ymin, double ymax,
34 double zmin, double zmax);
35 Edge* getParent (int nro);
36 Vertex* makeSymetric (Vertex* other);
37 void translate (Vector* vecteur, double fact=1.0);
39 static Vertex* createMiddle (Vertex* left, Vertex* right);
48 // ========================================================= Constructeur bis
49 inline Vertex::Vertex (Vertex* other)
50 : EltBase (other->dad(), EL_VERTEX)
57 // ========================================================= dump
58 inline void Vertex::dump ()
63 printf ("(*** deleted ***)\n");
67 printf ("(%g, %g, %g)", v_x,v_y,v_z);
70 // ========================================================= setCoord
71 inline void Vertex::setCoord (double x, double y, double z)
77 // ========================================================= isin
78 inline bool Vertex::isin (double xmin, double xmax, double ymin, double ymax,
79 double zmin, double zmax)
81 bool rep = v_x >= xmin && v_x <= xmax
82 && v_y >= ymin && v_y <= ymax
83 && v_z >= zmin && v_z <= zmax;