Salome HOME
Merge branch V7_3_1_BR
[modules/smesh.git] / src / MEDWrapper / Base / MED_Algorithm.hxx
1 // Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
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.
10 //
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.
15 //
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
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 #ifndef MED_Algorithm_HeaderFile
23 #define MED_Algorithm_HeaderFile
24
25 #include "MED_WrapperBase.hxx"
26 #include "MED_Structures.hxx"
27
28 #include <set>
29
30 namespace MED
31 {
32   //---------------------------------------------------------------
33   typedef std::map<EGeometrieElement,PElemInfo> TGeom2ElemInfo;
34   typedef std::map<EEntiteMaillage,TGeom2ElemInfo> TEntity2TGeom2ElemInfo;
35
36   //! Get set of TElemInfo by its geometrical type and corresponding MED ENTITY
37   MEDWRAPPER_EXPORT
38   TEntity2TGeom2ElemInfo
39   GetEntity2TGeom2ElemInfo(const PWrapper& theWrapper, 
40                            const PMeshInfo& theMeshInfo,
41                            const MED::TEntityInfo& theEntityInfo);
42
43
44   //---------------------------------------------------------------
45   typedef std::set<PFamilyInfo> TFamilyInfoSet;
46
47   //! Read set of MED FAMILIES for defined MED file
48   MEDWRAPPER_EXPORT
49   TFamilyInfoSet
50   GetFamilyInfoSet(const PWrapper& theWrapper, 
51                    const PMeshInfo& theMeshInfo);
52   
53
54   //---------------------------------------------------------------
55   typedef boost::tuple<PFamilyInfo,TInt> TFamilyTSize;
56
57   bool
58   operator<(const TFamilyTSize& theLeft, const TFamilyTSize& theRight);
59   typedef std::set<TFamilyTSize> TFamilyTSizeSet;
60
61
62   //---------------------------------------------------------------
63   typedef std::map<EEntiteMaillage,TFamilyTSizeSet> TEntity2FamilySet;
64   
65   //! Split set of MED FAMILIES by corresponding MED ENTITY
66   MEDWRAPPER_EXPORT
67   TEntity2FamilySet
68   GetEntity2FamilySet(const PWrapper& theWrapper, 
69                       const TEntity2TGeom2ElemInfo& theEntity2TGeom2ElemInfo,
70                       const TFamilyInfoSet& theFamilyInfoSet);
71   
72
73   //---------------------------------------------------------------
74   typedef std::map<std::string,TFamilyInfoSet> TGroupInfo;
75   
76   //! Split the input set of MED FAMILIES by corresponding MED GROUPS
77   MEDWRAPPER_EXPORT
78   TGroupInfo
79   GetGroupInfo(const TFamilyInfoSet& theFamilyInfoSet);
80   
81   
82   //---------------------------------------------------------------
83   typedef std::set<PTimeStampInfo> TTimeStampInfoSet;
84   typedef std::map<PFieldInfo,TTimeStampInfoSet> TFieldInfo2TimeStampInfoSet;
85
86   //! Read set of MED TIMESTAMPS groupped by corresponding MED FIELDS
87   MEDWRAPPER_EXPORT
88   TFieldInfo2TimeStampInfoSet
89   GetFieldInfo2TimeStampInfoSet(const PWrapper& theWrapper, 
90                                 const PMeshInfo& theMeshInfo,
91                                 const MED::TEntityInfo& theEntityInfo);
92   
93
94   //---------------------------------------------------------------
95   typedef std::map<EEntiteMaillage,TFieldInfo2TimeStampInfoSet> TEntite2TFieldInfo2TimeStampInfoSet;
96
97   //! Split the input set of MED TIMESTAMPS by corresponding MED FIELDS and MED ENTITIES
98   MEDWRAPPER_EXPORT
99   TEntite2TFieldInfo2TimeStampInfoSet
100   GetEntite2TFieldInfo2TimeStampInfoSet(const TFieldInfo2TimeStampInfoSet& theFieldInfo2TimeStampInfoSet);
101
102
103   //---------------------------------------------------------------
104   typedef std::map<TGaussInfo::TKey,PGaussInfo,TGaussInfo::TLess> TKey2Gauss;
105
106   //! Read set of MED GAUSS
107   MEDWRAPPER_EXPORT
108   TKey2Gauss
109   GetKey2Gauss(const PWrapper& theWrapper, 
110                TErr* theErr = NULL,
111                EModeSwitch theMode = eFULL_INTERLACE);
112
113
114   //---------------------------------------------------------------
115   //! Get MED PROFILE by its name
116   MEDWRAPPER_EXPORT
117   PProfileInfo
118   GetProfileInfo(const PWrapper& theWrapper, 
119                  const std::string& theProfileName,
120                  TErr* theErr = NULL,
121                  EModeProfil theMode = eCOMPACT);
122
123
124   //---------------------------------------------------------------
125   typedef std::map<TProfileInfo::TKey,PProfileInfo> TKey2Profile;
126   typedef boost::tuple<EModeProfil,TKey2Profile> TMKey2Profile;
127
128   //! Read set of MED PROFILES
129   MEDWRAPPER_EXPORT
130   TMKey2Profile
131   GetMKey2Profile(const PWrapper& theWrapper, 
132                   TErr* theErr = NULL,
133                   EModeProfil theMode = eCOMPACT);
134
135   //---------------------------------------------------------------
136   //! Get Entity for Grille by family id.
137   MEDWRAPPER_EXPORT
138   EEntiteMaillage
139   GetEntityByFamilyId(PGrilleInfo& theInfo,
140                       TInt theId);
141
142   typedef std::map<TInt,TInt> TFamilyID2NbCells;
143   
144   //! Get Number of cells for theId family, for Grille
145   MEDWRAPPER_EXPORT
146   TFamilyID2NbCells
147   GetFamilyID2NbCells(PGrilleInfo& theInfo);
148
149   //! Convert eNOEUD_ELEMENT to eMAILLE
150   MEDWRAPPER_EXPORT
151   EEntiteMaillage
152   ConvertEntity(const EEntiteMaillage& aEntity);
153
154 }
155
156 #endif