2 // class : Les Quadrangles
4 // Copyright (C) 2009-2019 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, or (at your option) any later version.
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 "HexEdge.hxx"
32 Vertex* v11; // 1er sommet 1er quad
34 Vertex* v21; // 1er sommet 2eme quad
36 int dir; // direction element suivant
38 StrOrient ( Vertex* n11, Vertex* n12, Vertex* n21, Vertex* n22, int d=0)
39 : v11 (n11), v12 (n12), v21 (n21), v22 (n22), dir (d) {}
41 StrOrient ( StrOrient* s)
42 : v11 (s->v11), v12(s->v12), v21(s->v21), v22(s->v22), dir(s->dir){}
47 class HexaExport Quad : public EltBase
50 virtual Edge* getEdge (int nro);
51 virtual Vertex* getVertex (int nro);
53 int addAssociation (NewShape* forme, int subid);
54 virtual void clearAssociation ();
56 void setColor (double valeur);
57 Vertex* nearestVertex (Vertex* other);
58 double* getCenter (double* center);
60 Quad (Vertex* va, Vertex* vb, Vertex* vc, Vertex* vd);
64 Quad (Edge* ea, Edge* eb, Edge* ec, Edge* ed);
67 virtual int countEdge () { return QUAD4; }
68 virtual int countVertex () { return QUAD4; }
70 Hexa* getParent (int nro);
72 Edge* findEdge (Vertex* v1, Vertex*v2);
73 Edge* commonEdge (Quad* other);
74 int anaMerge (Vertex* v1, Vertex* v2, Vertex* tv[], Edge* te[]);
76 int ordoVertex (Vertex* v1, Vertex* v2, Vertex* tv[]);
77 int ordonner (Vertex* v1, Vertex* v2, Vertex* tv[], Edge* ted[]);
79 int inter (Quad* other, int& nro);
80 Edge* inter (Quad* other);
81 bool definedBy (Vertex* v1, Vertex* v2);
82 bool definedBy (Edge* e1, Edge* e2);
84 int indexVertex (Vertex* elt);
85 int indexEdge (Edge* elt);
87 //int accoupler (Quad* other, StrOrient* orient);
88 int coupler (Quad* other, StrOrient* orient, Elements* table);
90 Edge* getOpposEdge (Edge* arete, int &sens);
91 Vertex* getOpposVertex (Vertex* sommet);
92 Hexa* opposedHexa (Hexa* hexa);
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;