2 // class : Les hexaedres
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
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 "Hex_defines.hxx"
46 #include "HexEltBase.hxx"
48 #include "HexQuad.hxx"
49 #include "HexEdge.hxx"
50 #include "HexVertex.hxx"
54 class HEXABLOCKENGINE_EXPORT Hexa : public EltBase
57 virtual Quad* getQuad (int nro);
58 virtual Edge* getEdge (int nro);
59 virtual Vertex* getVertex (int nro);
61 void setColor (double valeur);
63 Hexa (Quad* qa, Quad* qb, Quad* qc, Quad* qd, Quad* qe, Quad* qf);
68 Hexa (Vertex* v1, Vertex* v2, Vertex* v3, Vertex* v4,
69 Vertex* v5, Vertex* v6, Vertex* v7, Vertex* v8);
71 virtual int countQuad () { return HQ_MAXI; }
72 virtual int countEdge () { return HE_MAXI; }
73 virtual int countVertex () { return HV_MAXI; }
76 Quad* Inter (Hexa* other);
77 bool definedBy (Vertex* v1, Vertex* v2);
78 bool definedBy (Quad* va, Quad* v2);
80 virtual void dumpPlus ();
81 virtual void dumpFull ();
84 int countNodes (); // Compte et numerote les noeuds
85 void printNodes (pfile vtk, int& count); // Impression format vtk
86 void colorNodes (pfile vtk); // Impression scalaires vtk
87 void moveNodes (Matrix* matrice); // transfo controlee ds un ensemble
88 void transform (Matrix* matrice); // transfo indivituelle
89 void printHexa (pfile vtk); // Impression de la cellule
90 void printHexaVtk (pfile vtk); // Impression de la cellule
91 virtual void majReferences(); // M.A.J relation "utilise par"
94 void propager (Propagation* prop, int nro);
95 void setScalar (double valeur) { setColor (valeur) ; }
97 virtual void saveXml (XmlWriter* xml);
99 Elements* disconnectQuad (Quad* face);
100 Elements* disconnectEdge (Edge* arete);
101 Elements* disconnectVertex (Vertex* noeud);
103 int disconnectQuad (Quad* face, Elements* dest);
104 int disconnectEdge (Edge* arete, Elements* dest);
105 int disconnectVertex (Vertex* noeud, Elements* dest);
107 int getBase (Vertex* orig, Edge* normale);
109 void replaceQuad (Quad* old, Quad* nouveau);
110 void replaceEdge (Edge* old, Edge* nouveau);
111 void replaceVertex (Vertex* old, Vertex* nouveau);
112 void removeConnected ();
113 void markElements (int marque);
114 double* getCenter (double centre[]);
116 virtual void duplicate ();
117 Hexa* getClone () { return h_clone ; }
118 Quad* getOpposedQuad (Quad* face);
119 // Vertex* getOpposedVertex (Quad* face, Vertex* vertex);
120 Edge* getPerpendicularEdge (Quad* face, Vertex* vertex);
121 // Edge* getParallelEdge (Quad* face, Edge* edge);
122 Quad* findQuad (Edge* e1, Edge* e2);
123 Edge* findEdge (Vertex* v1, Vertex* v2);
125 int findQuad (Quad* element);
126 int findEdge (Edge* element);
127 int findVertex (Vertex* element);
132 void OrdonnerAretes (); // obsolete ?
133 void OrdonnerSommets (); // obsolete ?
135 void controlerFaces (); // Controle primaire des donnees utilisateur
136 void controlerSommets (); // Idem;
138 void verifierSommets (); // Controle de coherence des quads
139 void verifierAretes (); // Idem
141 void controlerArete (int arete, int face1, int face2);
142 void controlerSommet (int node, int arete1, int arete2, int arete3);
144 int findOpposedQuad (Quad* face, Edge* arete);
147 Quad* h_quad [HQ_MAXI];
148 Edge* h_edge [HE_MAXI];
149 Vertex* h_vertex [HV_MAXI];