2 // class : Les Quadrangles
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
25 #include "Hex_defines.hxx"
26 #include "HexEdge.hxx"
31 struct HEXABLOCKENGINE_EXPORT StrOrient
33 Vertex* v11; // 1er sommet 1er quad
35 Vertex* v21; // 1er sommet 2eme quad
37 int dir; // direction element suivant
39 StrOrient ( Vertex* n11, Vertex* n12, Vertex* n21, Vertex* n22, int d=0)
40 : v11 (n11), v12 (n12), v21 (n21), v22 (n22), dir (d) {}
42 StrOrient ( StrOrient* s)
43 : v11 (s->v11), v12(s->v12), v21(s->v21), v22(s->v22), dir(s->dir){}
48 class HEXABLOCKENGINE_EXPORT Quad : public EltBase
51 virtual Edge* getEdge (int nro);
52 virtual Vertex* getVertex (int nro);
54 int addAssociation (NewShape* forme, int subid);
55 virtual void clearAssociation ();
57 void setColor (double valeur);
58 Vertex* nearestVertex (Vertex* other);
59 double* getCenter (double* center);
61 Quad (Vertex* va, Vertex* vb, Vertex* vc, Vertex* vd);
65 Quad (Edge* ea, Edge* eb, Edge* ec, Edge* ed);
68 virtual int countEdge () { return QUAD4; }
69 virtual int countVertex () { return QUAD4; }
71 Hexa* getParent (int nro);
73 Edge* findEdge (Vertex* v1, Vertex*v2);
74 Edge* commonEdge (Quad* other);
75 int anaMerge (Vertex* v1, Vertex* v2, Vertex* tv[], Edge* te[]);
77 int ordoVertex (Vertex* v1, Vertex* v2, Vertex* tv[]);
78 int ordonner (Vertex* v1, Vertex* v2, Vertex* tv[], Edge* ted[]);
80 int inter (Quad* other, int& nro);
81 Edge* inter (Quad* other);
82 bool definedBy (Vertex* v1, Vertex* v2);
83 bool definedBy (Edge* e1, Edge* e2);
85 int indexVertex (Vertex* elt);
86 int indexEdge (Edge* elt);
88 //int accoupler (Quad* other, StrOrient* orient);
89 int coupler (Quad* other, StrOrient* orient, Elements* table);
91 Edge* getOpposEdge (Edge* arete, int &sens);
92 Vertex* getOpposVertex (Vertex* sommet);
94 virtual void majReferences(); // M.A.J relation "utilise par"
96 virtual void dumpPlus ();
97 virtual void saveXml (XmlWriter* xml);
98 void setScalar (double valeur) { setColor (valeur); }
100 void replace (Quad* old);
101 virtual void replaceEdge (Edge* old, Edge* nouveau);
102 virtual void replaceVertex (Vertex* old, Vertex* nouveau);
104 virtual void setAssociation (Shape* forme) {} // PERIME
105 virtual int addAssociation (Shape* forme) {return HOK ; } // PERIME
108 // const Shapes& getAssociations () { return tab_shapes ; }
111 virtual void duplicate ();
112 Quad* getClone () { return q_clone ; }
114 Edge* getOpposEdge (Edge* arete); // Version simplifiee
115 Edge* getPerpendicular (Edge* arete, Vertex* node);
116 int getOrientation () { return q_orientation; }
117 int setOrientation ();
118 void setOrientation (int ori);
121 int addAssociation (FaceShape* forme);
122 int countAssociation () { return tab_assoc.size () ; }
123 FaceShape* getAssociation (int nro);
125 double dist2 (double* point);
129 Quad* getBrother (StrOrient* orient);
132 Edge* q_edge [QUAD4];
133 Vertex* q_vertex [QUAD4];
137 FaceShapes tab_assoc;