2 // class : Analyse des quadrangles avant construction
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 "HexQuad.hxx"
27 // #include "HexEdge.hxx"
31 class HEXABLOCKENGINE_EXPORT AnaQuads
34 AnaQuads (Quad* q1, Quad* q2, Quad* q3=NULL, Quad* q4=NULL, Quad* q5=NULL);
41 Quad* tab_quads [MaxQuads];
42 int inter_nbre [MaxQuads];
43 int inter_edge [MaxQuads][MaxQuads]; // L'arete commune des 2 quads
44 int inter_quad [MaxQuads][QUAD4]; // Le quad touchant la ieme arete
46 // ----------------------------------------------- Inlining
47 // ========================================================== Constructeur
48 inline AnaQuads::AnaQuads (Quad* q0, Quad* q1, Quad* q2, Quad* q3, Quad* q4)
54 for (int nquad=0 ; nquad < MaxQuads ; nquad++)
56 tab_quads [nquad] = NULL;
57 inter_nbre [nquad] = 0;
58 for (int nro=0 ; nro < QUAD4 ; nro++)
59 inter_quad [nquad][nro] = NOTHING;
60 for (int nro=0 ; nro < MaxQuads ; nro++)
61 inter_edge [nquad][nro] = NOTHING;
70 if (q4 != NULL) nbr_quads = 5;
71 else if (q3 != NULL) nbr_quads = 4;
72 else if (q2 != NULL) nbr_quads = 3;
75 for (int nquad1=0 ; nquad1 < nbr_quads ; nquad1++)
77 if (tab_quads[nquad1]==NULL || tab_quads[nquad1]->isDeleted())
82 for (int nquad2=0 ; nquad2 < nquad1 ; nquad2++)
84 if (tab_quads[nquad1]==tab_quads[nquad2])
90 int nedge1 = tab_quads[nquad1]->inter (tab_quads[nquad2], nedge2) ;
91 if (nedge1 != NOTHING)
93 inter_edge [nquad1] [nquad2] = nedge1;
94 inter_quad [nquad1] [nedge1] = nquad2;
96 inter_edge [nquad2] [nquad1] = nedge2;
97 inter_quad [nquad2] [nedge2] = nquad1;
99 inter_nbre [nquad1]++;
100 inter_nbre [nquad2]++;
106 // ============================================================== distance
107 inline double distance (Vertex* v1, Vertex* v2)
109 double vx = v1->getX () - v2->getX ();
110 double vy = v1->getY () - v2->getY ();
111 double vz = v1->getZ () - v2->getZ ();
112 double dist = sqrt (vx*vx + vy*vy + vz*vz);