2 // class : Les hexaedres
4 // Copyright (C) 2009-2016 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
23 /* -----------------------------------------------------
25 // ---- Numerotation des faces (%x)
27 6=bed +----bd-----+ bdf=7
31 4=bce +----bc-----+...|...bcf=5
35 2=ade...|...+----ad-|---+ adf=3 | y
39 0=ace +----ac-----+ acf=1 +-----> x
41 * ----------------------------------------------------- */
45 #include "HexEltBase.hxx"
47 #include "HexQuad.hxx"
48 #include "HexEdge.hxx"
49 #include "HexVertex.hxx"
53 class HexaExport Hexa : public EltBase
56 virtual Quad* getQuad (int nro);
57 virtual Edge* getEdge (int nro);
58 virtual Vertex* getVertex (int nro);
60 void setColor (double valeur);
62 Hexa (Quad* qa, Quad* qb, Quad* qc, Quad* qd, Quad* qe, Quad* qf);
67 Hexa (Vertex* v1, Vertex* v2, Vertex* v3, Vertex* v4,
68 Vertex* v5, Vertex* v6, Vertex* v7, Vertex* v8);
70 virtual int countQuad () { return HQ_MAXI; }
71 virtual int countEdge () { return HE_MAXI; }
72 virtual int countVertex () { return HV_MAXI; }
75 Quad* Inter (Hexa* other);
76 bool definedBy (Vertex* v1, Vertex* v2);
77 bool definedBy (Quad* va, Quad* v2);
79 virtual void dumpPlus ();
80 virtual void dumpFull ();
83 int countNodes (); // Compte et numerote les noeuds
84 void printNodes (pfile vtk, int& count); // Impression format vtk
85 void colorNodes (pfile vtk); // Impression scalaires vtk
86 void moveNodes (Matrix* matrice); // transfo controlee ds un ensemble
87 void transform (Matrix* matrice); // transfo indivituelle
88 void printHexa (pfile vtk); // Impression de la cellule
89 void printHexaVtk (pfile vtk); // Impression de la cellule
90 virtual void majReferences(); // M.A.J relation "utilise par"
93 void propager (Propagation* prop, int nro);
94 void setScalar (double valeur) { setColor (valeur) ; }
96 virtual void saveXml (XmlWriter* xml);
98 Elements* disconnectQuad (Quad* face);
99 Elements* disconnectEdge (Edge* arete);
100 Elements* disconnectVertex (Vertex* noeud);
102 int disconnectQuad (Quad* face, Elements* dest);
103 int disconnectEdge (Edge* arete, Elements* dest);
104 int disconnectVertex (Vertex* noeud, Elements* dest);
106 int getBase (Vertex* orig, Edge* normale);
108 void replaceQuad (Quad* old, Quad* nouveau);
109 void replaceEdge (Edge* old, Edge* nouveau);
110 void replaceVertex (Vertex* old, Vertex* nouveau);
111 void removeConnected ();
112 void markElements (int marque);
113 double* getCenter (double centre[]);
115 virtual void duplicate ();
116 Hexa* getClone () { return h_clone ; }
117 Quad* getOpposedQuad (Quad* face);
118 Vertex* opposedVertex (Quad* face, Vertex* vertex);
119 Edge* perpendicularEdge (Quad* face, Vertex* vertex);
120 Quad* perpendicularQuad (Quad* face, Edge* edge);
121 Edge* getPerpendicularEdge (Quad* face, Vertex* vertex)
122 { return perpendicularEdge (face, vertex); }
123 // Edge* getParallelEdge (Quad* face, Edge* edge);
124 Quad* findQuad (Edge* e1, Edge* e2);
125 Edge* findEdge (Vertex* v1, Vertex* v2);
127 int findQuad (Quad* element);
128 int findEdge (Edge* element);
129 int findVertex (Vertex* element);
134 void OrdonnerAretes (); // obsolete ?
135 void OrdonnerSommets (); // obsolete ?
137 void controlerFaces (); // Controle primaire des donnees utilisateur
138 void controlerSommets (); // Idem;
140 void verifierSommets (); // Controle de coherence des quads
141 void verifierAretes (); // Idem
143 void controlerArete (int arete, int face1, int face2);
144 void controlerSommet (int node, int arete1, int arete2, int arete3);
146 int findOpposedQuad (Quad* face, Edge* arete);
149 Quad* h_quad [HQ_MAXI];
150 Edge* h_edge [HE_MAXI];
151 Vertex* h_vertex [HV_MAXI];