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 "Hex_defines.hxx"
27 #include "HexEltBase.hxx"
31 class HEXABLOCKENGINE_EXPORT Vertex : public EltBase
34 double getX() { return v_x; }
35 double getY() { return v_y; }
36 double getZ() { return v_z; }
38 void setX (double v) { v_x = v ; }
39 void setY (double v) { v_y = v ; }
40 void setZ (double v) { v_z = v ; }
42 double getAssoX () { return is_associated ? gc_x : v_x ; }
43 double getAssoY () { return is_associated ? gc_y : v_y ; }
44 double getAssoZ () { return is_associated ? gc_z : v_z ; }
46 int setAssociation (NewShape* geom, int subid);
47 void clearAssociation ();
49 void setColor (double valeur) { v_scalar = valeur ; }
51 Vertex (Document* prev, double x, double y, double z);
55 double getCoord (int dir);
56 virtual int countVertex () { return 1; }
57 virtual Vertex* getVertex (int nro) { return this; }
60 int setAssociation (VertexShape* forme);
61 int setAssociation (double* point);
62 int setAssociation (double px, double py, double pz);
64 VertexShape* getAssoVertex () { return v_shape ;}
65 VertexShape* getAssociation () { return v_shape ;}
67 void getAssoCoord (double &x, double &y, double &z);
68 void getAssoCoord (double* point);
71 Vertex (Vertex* other);
73 virtual void dump () ;
74 virtual void saveXml (XmlWriter* xml);
76 void setScalar (double val) { setColor (val) ; }
77 double getScalar () { return v_scalar ; }
78 double* getPoint (double point[]);
80 void setCoord (double x, double y, double z);
81 void setCoord (double point[]) { setCoord (point[0], point[1], point[2]); }
83 bool isin (double xmin, double xmax, double ymin, double ymax,
84 double zmin, double zmax);
85 Edge* getParent (int nro);
86 void translate (Vector* vecteur, double fact=1.0);
87 void replace (Vertex* old);
89 Vertex* getClone () { return v_clone ; }
90 void duplicate (Document* doc);
92 static Vertex* createMiddle (Vertex* left, Vertex* right);
93 bool definedBy (double px, double py, double pz, double eps2=1e-4);
94 double dist2 (Vertex* other);
103 double gc_x, gc_y, gc_z;
104 VertexShape* v_shape;