2 // Class : Gestion des sommets
4 // Copyright (C) 2009-2013 CEA/DEN, EDF R&D
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
26 #include "HexEltBase.hxx"
30 class Vertex : public EltBase
33 double getX() { return v_x; }
34 double getY() { return v_y; }
35 double getZ() { return v_z; }
37 void setX (double v) { v_x = v ; }
38 void setY (double v) { v_y = v ; }
39 void setZ (double v) { v_z = v ; }
41 double getAssoX () { return is_associated ? gc_x : v_x ; }
42 double getAssoY () { return is_associated ? gc_y : v_y ; }
43 double getAssoZ () { return is_associated ? gc_z : v_z ; }
45 int setAssociation (NewShape* geom, int subid);
46 void clearAssociation ();
48 void setColor (double valeur) { v_scalar = valeur ; }
50 Vertex (Document* prev, double x, double y, double z);
54 double getCoord (int dir);
55 virtual int countVertex () { return 1; }
56 virtual Vertex* getVertex (int nro) { return this; }
59 int setAssociation (VertexShape* forme);
60 int setAssociation (double* point);
61 int setAssociation (double px, double py, double pz);
63 VertexShape* getAssoVertex () { return v_shape ;}
64 VertexShape* getAssociation () { return v_shape ;}
66 void getAssoCoord (double &x, double &y, double &z);
67 void getAssoCoord (double* point);
70 Vertex (Vertex* other);
72 virtual void dump () ;
73 virtual void saveXml (XmlWriter* xml);
75 void setScalar (double val) { setColor (val) ; }
76 double getScalar () { return v_scalar ; }
77 double* getPoint (double point[]);
79 void setCoord (double x, double y, double z);
80 void setCoord (double point[]) { setCoord (point[0], point[1], point[2]); }
82 bool isin (double xmin, double xmax, double ymin, double ymax,
83 double zmin, double zmax);
84 Edge* getParent (int nro);
85 void translate (Vector* vecteur, double fact=1.0);
86 void replace (Vertex* old);
88 Vertex* getClone () { return v_clone ; }
89 void duplicate (Document* doc);
91 static Vertex* createMiddle (Vertex* left, Vertex* right);
92 bool definedBy (double px, double py, double pz, double eps2=1e-4);
93 double dist2 (Vertex* other);
102 double gc_x, gc_y, gc_z;
103 VertexShape* v_shape;