2 // class : Analyse des quadrangles avant construction
4 // Copyright (C) 2009-2014 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 "HexQuad.hxx"
26 // #include "HexEdge.hxx"
30 class HexaExport AnaQuads
33 AnaQuads (Quad* q1, Quad* q2, Quad* q3=NULL, Quad* q4=NULL, Quad* q5=NULL);
40 Quad* tab_quads [MaxQuads];
41 int inter_nbre [MaxQuads];
42 int inter_edge [MaxQuads][MaxQuads]; // L'arete commune des 2 quads
43 int inter_quad [MaxQuads][QUAD4]; // Le quad touchant la ieme arete
45 // ----------------------------------------------- Inlining
46 // ========================================================== Constructeur
47 inline AnaQuads::AnaQuads (Quad* q0, Quad* q1, Quad* q2, Quad* q3, Quad* q4)
53 for (int nquad=0 ; nquad < MaxQuads ; nquad++)
55 tab_quads [nquad] = NULL;
56 inter_nbre [nquad] = 0;
57 for (int nro=0 ; nro < QUAD4 ; nro++)
58 inter_quad [nquad][nro] = NOTHING;
59 for (int nro=0 ; nro < MaxQuads ; nro++)
60 inter_edge [nquad][nro] = NOTHING;
69 if (q4 != NULL) nbr_quads = 5;
70 else if (q3 != NULL) nbr_quads = 4;
71 else if (q2 != NULL) nbr_quads = 3;
74 for (int nquad1=0 ; nquad1 < nbr_quads ; nquad1++)
76 if (tab_quads[nquad1]==NULL || tab_quads[nquad1]->isDeleted())
81 for (int nquad2=0 ; nquad2 < nquad1 ; nquad2++)
83 if (tab_quads[nquad1]==tab_quads[nquad2])
89 int nedge1 = tab_quads[nquad1]->inter (tab_quads[nquad2], nedge2) ;
90 if (nedge1 != NOTHING)
92 inter_edge [nquad1] [nquad2] = nedge1;
93 inter_quad [nquad1] [nedge1] = nquad2;
95 inter_edge [nquad2] [nquad1] = nedge2;
96 inter_quad [nquad2] [nedge2] = nquad1;
98 inter_nbre [nquad1]++;
99 inter_nbre [nquad2]++;
105 // ============================================================== distance
106 inline double distance (Vertex* v1, Vertex* v2)
108 double vx = v1->getX () - v2->getX ();
109 double vy = v1->getY () - v2->getY ();
110 double vz = v1->getZ () - v2->getZ ();
111 double dist = sqrt (vx*vx + vy*vy + vz*vz);