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