1 // Copyright (C) 2009-2012 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // Singleton : Var globales : Disposition sommets/aretes/faces d'un hexaedre
22 #ifndef _HEX_GLOBALE_H
23 #define _HEX_GLOBALE_H
25 #include "hexa_base.hxx"
27 /* -----------------------------------------------------
29 // ---- Numerotation des faces (%x)
31 6=bed +----bd-----+ bdf=7
35 4=bce +----bc-----+...|...bcf=5
39 2=ade...|...+----ad-|---+ adf=3 | y
43 0=ace +----ac-----+ acf=1 +-----> x
45 * ----------------------------------------------------- */
53 static Globale* getInstance ();
55 int CoordVertex (int edge, EnumCoord dim)
56 { return coord_vertex [edge] [dim] ; }
58 EnumHVertex EdgeVertex (int edge, EnumVertex sens)
59 { return edge_vertex [edge] [sens] ; }
61 EnumHEdge QuadEdge (int face, EnumQuad cote)
62 { return quad_edge [face] [cote] ; }
64 cpchar namofHexaEdge (int arete) { return h_edge_name [arete] ; }
65 cpchar namofHexaVertex (int sommet) { return h_vertex_name [sommet]; }
66 cpchar namofHexaQuad (int face) { return h_quad_name [face]; }
68 EnumHQuad getOpposedQuad (int face) { return h_opposed_quad [face]; }
70 void setArgs (int nbargs, cpchar tabargs[]);
71 int findArg (cpchar opt);
72 bool isinArgs (cpchar opt) { return findArg (opt) >= 0; }
73 cpchar getArg (int nro) { return nro>=nbr_args ? NULL : tab_args[nro]; }
76 Globale (); // Constructeur prive
78 void setCoordVertex (EnumHVertex node, int px, int py, int pz);
79 void setEdgeVertex (EnumHEdge edge, EnumHVertex amont, EnumHVertex aval);
80 void setQuadEdge (EnumHQuad face, EnumHEdge c1, EnumHEdge c2,
81 EnumHEdge c3, EnumHEdge c4);
82 void setOpposedVertex (EnumHVertex lun, EnumHVertex lautre);
83 void setOpposedQuad (EnumHQuad lun, EnumHQuad lautre);
91 int coord_vertex [HV_MAXI] [DIM3];
92 EnumHVertex edge_vertex [HE_MAXI] [V_TWO];
93 EnumHEdge quad_edge [HQ_MAXI] [QUAD4];
95 cpchar h_edge_name [HE_MAXI];
96 cpchar h_vertex_name [HV_MAXI];
97 cpchar h_quad_name [HQ_MAXI];
99 EnumHVertex h_opposed_vertex [HV_MAXI];
100 EnumHQuad h_opposed_quad [HQ_MAXI];
102 static Globale* unique_instance;
104 // ===================================================== setArgs
105 inline void Globale::setArgs (int nbargs, cpchar tabargs[])
110 // ===================================================== findArg
111 inline int Globale::findArg (cpchar option)
113 for (int nro=1 ; nro<nbr_args ; nro++)
114 if (Cestegal (option, tab_args[nro]))