2 // Singleton : Var globales : Disposition sommets/aretes/faces d'un hexaedre
4 // Copyright (C) 2009-2023 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 #ifndef _HEX_GLOBALE_H
24 #define _HEX_GLOBALE_H
26 #include "hexa_base.hxx"
27 #include "HexDumpStudy.hxx"
28 #include "HexWitness.hxx"
30 /* -----------------------------------------------------
32 // ---- Numerotation des faces (%x)
34 6=bed +----bd-----+ bdf=7
38 4=bce +----bc-----+...|...bcf=5
42 2=ade...|...+----ad-|---+ adf=3 | y
46 0=ace +----ac-----+ acf=1 +-----> x
48 * ----------------------------------------------------- */
53 class HexaExport Globale
56 static Globale* getInstance ();
58 int CoordVertex (int edge, EnumCoord dim)
59 { return coord_vertex [edge] [dim] ; }
61 EnumHVertex EdgeVertex (int edge, EnumVertex sens)
62 { return edge_vertex [edge] [sens] ; }
64 EnumHEdge QuadEdge (int face, EnumQuad cote)
65 { return quad_edge [face] [cote] ; }
67 cpchar namofHexaEdge (int arete) { return h_edge_name [arete] ; }
68 cpchar namofHexaVertex (int sommet) { return h_vertex_name [sommet]; }
69 cpchar namofHexaQuad (int face) { return h_quad_name [face]; }
71 EnumHQuad getOpposedQuad (int face) { return h_opposed_quad [face]; }
73 void setArgs (int nbargs, cpchar tabargs[]);
74 int findArg (cpchar opt);
75 bool isinArgs (cpchar opt) { return findArg (opt) >= 0; }
76 cpchar getArg (int nro) { return nro>=nbr_args ? NULL : tab_args[nro]; }
83 Globale (); // Constructeur prive
85 void setCoordVertex (EnumHVertex node, int px, int py, int pz);
86 void setEdgeVertex (EnumHEdge edge, EnumHVertex amont, EnumHVertex aval);
87 void setQuadEdge (EnumHQuad face, EnumHEdge c1, EnumHEdge c2,
88 EnumHEdge c3, EnumHEdge c4);
89 void setOpposedVertex (EnumHVertex lun, EnumHVertex lautre);
90 void setOpposedQuad (EnumHQuad lun, EnumHQuad lautre);
99 int coord_vertex [HV_MAXI] [DIM3];
100 EnumHVertex edge_vertex [HE_MAXI] [V_TWO];
101 EnumHEdge quad_edge [HQ_MAXI] [QUAD4];
103 cpchar h_edge_name [HE_MAXI];
104 cpchar h_vertex_name [HV_MAXI];
105 cpchar h_quad_name [HQ_MAXI];
107 EnumHVertex h_opposed_vertex [HV_MAXI];
108 EnumHQuad h_opposed_quad [HQ_MAXI];
110 static Globale* unique_instance;
112 // ===================================================== setArgs
113 inline void Globale::setArgs (int nbargs, cpchar tabargs[])
118 // ===================================================== findArg
119 inline int Globale::findArg (cpchar option)
121 for (int nro=1 ; nro<nbr_args ; nro++)
122 if (Cestegal (option, tab_args[nro]))