Back to index

salome-med  6.5.0
MED_Wrapper.cxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 //  File   : MED_Wrapper.cxx
00024 //  Author : Alexey PETROV
00025 //  Module : MED
00026 //
00027 #include "MED_Wrapper.hxx"
00028 #include "MED_Utilities.hxx"
00029  
00030 #include <boost/version.hpp>
00031 
00032 #ifdef _DEBUG_
00033 static int MYDEBUG = 0;
00034 static int MYVALUEDEBUG = 0;
00035 #else
00036 // static int MYDEBUG = 0;
00037 // static int MYVALUEDEBUG = 0;
00038 #endif
00039 
00040 namespace MED
00041 {
00042   TLockProxy
00043   ::TLockProxy(TWrapper* theWrapper):
00044     myWrapper(theWrapper)
00045   {
00046 #if BOOST_VERSION >= 103500
00047     myWrapper->myMutex.lock();
00048 #else
00049     boost::detail::thread::lock_ops<TWrapper::TMutex>::lock(myWrapper->myMutex);
00050 #endif
00051     INITMSG(MYDEBUG,"TLockProxy() - this -"<<this<<"; myWrapper = "<<myWrapper<<std::endl);
00052   }
00053   
00054   TLockProxy
00055   ::~TLockProxy()
00056   {
00057     INITMSG(MYDEBUG,"~TLockProxy() - this -"<<this<<"; myWrapper = "<<myWrapper<<std::endl);
00058 #if BOOST_VERSION >= 103500
00059     myWrapper->myMutex.unlock();
00060 #else
00061     boost::detail::thread::lock_ops<TWrapper::TMutex>::unlock(myWrapper->myMutex);
00062 #endif
00063   }
00064   
00065   TWrapper*
00066   TLockProxy
00067   ::operator-> () const // never throws
00068   {
00069     return myWrapper;
00070   }
00071 
00072   //----------------------------------------------------------------------------
00073   TWrapper::~TWrapper()
00074   {
00075   }
00076 
00077   //----------------------------------------------------------------------------
00078   PMeshInfo
00079   TWrapper
00080   ::GetPMeshInfo(TInt theId,
00081                  TErr* theErr)
00082   {
00083     PMeshInfo anInfo = CrMeshInfo();
00084     GetMeshInfo(theId,*anInfo,theErr);
00085     return anInfo;
00086   }
00087 
00088 
00089   //----------------------------------------------------------------------------
00090   PFamilyInfo 
00091   TWrapper
00092   ::GetPFamilyInfo(const PMeshInfo& theMeshInfo, 
00093                    TInt theId,
00094                    TErr* theErr)
00095   {
00096     // must be reimplemented in connection with mesh type eSTRUCTURE
00097     //     if(theMeshInfo->GetType() != eNON_STRUCTURE)
00098     //       return PFamilyInfo();
00099     
00100     TInt aNbAttr = GetNbFamAttr(theId,*theMeshInfo);
00101     TInt aNbGroup = GetNbFamGroup(theId,*theMeshInfo);
00102     PFamilyInfo anInfo = CrFamilyInfo(theMeshInfo,aNbGroup,aNbAttr);
00103     GetFamilyInfo(theId,*anInfo,theErr);
00104 
00105 #ifdef _DEBUG_
00106     std::string aName = anInfo->GetName();
00107     INITMSG(MYDEBUG,"GetPFamilyInfo - aFamilyName = '"<<aName<<
00108             "'; andId = "<<anInfo->GetId()<<
00109             "; aNbAttr = "<<aNbAttr<<
00110             "; aNbGroup = "<<aNbGroup<<"\n");
00111     for(TInt iGroup = 0; iGroup < aNbGroup; iGroup++){
00112       aName = anInfo->GetGroupName(iGroup);
00113       INITMSG(MYDEBUG,"aGroupName = '"<<aName<<"'\n");
00114     }
00115 #endif
00116     
00117     return anInfo;
00118   }
00119 
00120 
00121   //----------------------------------------------------------------------------
00122   PNodeInfo
00123   TWrapper
00124   ::GetPNodeInfo(const PMeshInfo& theMeshInfo,
00125                  TErr* theErr)
00126   {
00127     TInt aNbElems = GetNbNodes(*theMeshInfo);
00128     if(aNbElems == 0){
00129       return PNodeInfo();
00130     }
00131 
00132     PNodeInfo anInfo = CrNodeInfo(theMeshInfo,aNbElems);
00133     GetNodeInfo(*anInfo,theErr);
00134 
00135 #ifdef _DEBUG_
00136     TInt aDim = theMeshInfo->myDim;
00137     TInt aNbElem = anInfo->GetNbElem();
00138     INITMSG(MYDEBUG,"GetPNodeInfo: ");
00139     {
00140       INITMSG(MYDEBUG,"aCoords: "<<aNbElem<<": ");
00141       TNodeCoord& aCoord = anInfo->myCoord;
00142       for(TInt iElem = 0; iElem < aNbElem; iElem++){
00143         for(TInt iDim = 0, anId = iElem*aDim; iDim < aDim; iDim++, anId++){
00144           ADDMSG(MYVALUEDEBUG,aCoord[anId]<<",");
00145         }
00146         ADDMSG(MYVALUEDEBUG," ");
00147       }
00148       ADDMSG(MYDEBUG, std::endl);
00149       
00150       BEGMSG(MYVALUEDEBUG, "GetFamNum: ");
00151       for(TInt iElem = 0; iElem < aNbElem; iElem++){
00152         ADDMSG(MYVALUEDEBUG,anInfo->GetFamNum(iElem)<<", ");
00153       }
00154       ADDMSG(MYVALUEDEBUG, std::endl);
00155       
00156       if(anInfo->IsElemNum()){
00157         BEGMSG(MYVALUEDEBUG,"GetElemNum: ");
00158         for(TInt iElem = 0; iElem < aNbElem; iElem++){
00159           ADDMSG(MYVALUEDEBUG,anInfo->GetElemNum(iElem)<<", ");
00160         }
00161         ADDMSG(MYVALUEDEBUG, std::endl);
00162       }
00163     }
00164     ADDMSG(MYDEBUG, std::endl);
00165 #endif
00166     
00167     return anInfo;
00168   }
00169 
00170   //----------------------------------------------------------------------------
00171   PPolygoneInfo
00172   TWrapper
00173   ::GetPPolygoneInfo(const PMeshInfo& theMeshInfo,
00174                      EEntiteMaillage theEntity, 
00175                      EGeometrieElement theGeom, 
00176                      EConnectivite theConnMode)
00177   {
00178     if(theMeshInfo->GetType() != eNON_STRUCTURE)
00179       return PPolygoneInfo();
00180 
00181     TInt aNbElem = GetNbPolygones(theMeshInfo,theEntity,theGeom,theConnMode);
00182     TInt aConnSize = GetPolygoneConnSize(theMeshInfo,theEntity,theGeom,theConnMode);
00183     PPolygoneInfo anInfo = CrPolygoneInfo(theMeshInfo,theEntity,theGeom,aNbElem,aConnSize,theConnMode);
00184     GetPolygoneInfo(anInfo);
00185 
00186 #ifdef _DEBUG_
00187     INITMSG(MYDEBUG,"GetPPolygoneInfo"<<
00188             " - theGeom = "<<theGeom<<
00189             "; aNbElem = "<<aNbElem<<": ");
00190     for(TInt iElem = 1; iElem < aNbElem; iElem++){
00191       TCConnSlice aConnSlice = anInfo->GetConnSlice(iElem);
00192       TInt aConnDim = aConnSlice.size();
00193       for(TInt iConn = 0; iConn < aConnDim; iConn++){
00194         ADDMSG(MYVALUEDEBUG,aConnSlice[iConn]<<",");
00195       }
00196       ADDMSG(MYDEBUG," ");
00197     }
00198     ADDMSG(MYDEBUG, std::endl);
00199 #endif
00200 
00201     return anInfo;
00202   }
00203   
00204   //----------------------------------------------------------------------------
00205   PPolyedreInfo
00206   TWrapper
00207   ::GetPPolyedreInfo(const PMeshInfo& theMeshInfo,
00208                      EEntiteMaillage theEntity, 
00209                      EGeometrieElement theGeom, 
00210                      EConnectivite theConnMode)
00211   {
00212     if(theMeshInfo->GetType() != eNON_STRUCTURE)
00213       return PPolyedreInfo();
00214     TInt aNbElem  = GetNbPolyedres(theMeshInfo,theEntity,theGeom,theConnMode);
00215     TInt aNbFaces, aConnSize;
00216     GetPolyedreConnSize(theMeshInfo,aNbFaces,aConnSize,theConnMode);
00217     PPolyedreInfo anInfo = CrPolyedreInfo(theMeshInfo,theEntity,theGeom,aNbElem,aNbFaces,aConnSize,theConnMode);
00218     GetPolyedreInfo(anInfo);
00219 
00220 #ifdef _DEBUG_
00221     INITMSG(MYDEBUG,"GetPPolyedreInfo"<<
00222             " - theGeom = "<<theGeom<<
00223             "; aNbElem = "<<aNbElem<<": ");
00224     for(TInt iElem = 0; iElem < aNbElem; iElem++){
00225       TCConnSliceArr aConnSliceArr = anInfo->GetConnSliceArr(iElem);
00226       TInt aNbFaces = aConnSliceArr.size();
00227       ADDMSG(MYDEBUG,"{");
00228       for(TInt iFace = 0; iFace < aNbFaces; iFace++){
00229         TCConnSlice aConnSlice = aConnSliceArr[iFace];
00230         TInt aNbConn = aConnSlice.size();
00231         ADDMSG(MYDEBUG,"[");
00232         for(TInt iConn = 0; iConn < aNbConn; iConn++){
00233           ADDMSG(MYVALUEDEBUG,aConnSlice[iConn]<<",");
00234         }
00235         ADDMSG(MYDEBUG,"] ");
00236       }
00237       ADDMSG(MYDEBUG,"} ");
00238     }
00239     ADDMSG(MYDEBUG, std::endl);
00240 #endif
00241 
00242     return anInfo;
00243   }
00244   
00245   //----------------------------------------------------------------------------
00246   PElemInfo 
00247   TWrapper
00248   ::GetPElemInfo(const PMeshInfo& theMeshInfo,
00249                  EEntiteMaillage theEntity, 
00250                  EGeometrieElement theGeom, 
00251                  EConnectivite theConnMode,
00252                  TErr* theErr)
00253   {
00254     EMaillage aType = theMeshInfo->GetType();
00255     if(aType == eNON_STRUCTURE){
00256       switch(theGeom){
00257       case ePOINT1:
00258         if(theEntity == eNOEUD)
00259           return GetPNodeInfo(theMeshInfo,theErr);
00260         return GetPCellInfo(theMeshInfo,theEntity,theGeom,theConnMode,theErr);
00261         break;
00262       case ePOLYGONE:
00263         return GetPPolygoneInfo(theMeshInfo,theEntity,theGeom,theConnMode);
00264         break;
00265       case ePOLYEDRE:
00266         return GetPPolyedreInfo(theMeshInfo,theEntity,theGeom,theConnMode);
00267         break;
00268       default:
00269         return GetPCellInfo(theMeshInfo,theEntity,theGeom,theConnMode,theErr);
00270       }
00271     } else {
00272       PGrilleInfo aGrille = GetPGrilleInfo(theMeshInfo);
00273 
00274       TInt nbElems;
00275       EBooleen theIsElemNum = eFAUX;
00276       // nodes
00277       switch(theGeom){
00278       case ePOINT1:
00279         nbElems = aGrille->GetNbNodes();
00280         theIsElemNum = eVRAI;
00281         break;
00282       case eSEG2:
00283       case eQUAD4:
00284       case eHEXA8:
00285         nbElems = aGrille->GetNbCells();
00286         break;
00287       default:
00288         nbElems = 0;
00289       }
00290       
00291       TIntVector aFamNum;
00292       TIntVector aElemNum;
00293       TStringVector aElemNames;
00294       
00295       PElemInfo aElemInfo;
00296 
00297       if(theGeom == ePOINT1){
00298         aElemInfo = CrElemInfo(theMeshInfo,
00299                                nbElems,
00300                                theIsElemNum);
00301         MED::TElemInfo &aTElemInfo = *aElemInfo;
00302 
00303         // must be reimplemente in connection with mesh type eSTRUCTURE
00304 //      GetNumeration(aTElemInfo,
00305 //                    nbElems,
00306 //                    theEntity,
00307 //                    theGeom,
00308 //                    theErr);
00309         
00310         GetFamilies(aTElemInfo,
00311                     nbElems,
00312                     theEntity,
00313                     theGeom,
00314                     theErr);
00315         
00316         // must be reimplemente in connection with mesh type eSTRUCTURE
00317 //      GetNames(aTElemInfo,
00318 //               nbElems,
00319 //               theEntity,
00320 //               theGeom,
00321 //               theErr);
00322       } else {
00323         aElemInfo = CrElemInfo(theMeshInfo,
00324                                nbElems,
00325                                aFamNum,
00326                                aElemNum,
00327                                aElemNames);
00328       }
00329       
00330       return aElemInfo;
00331     }
00332     return PElemInfo();
00333   }
00334 
00335 
00336   //----------------------------------------------------------------------------
00337   PCellInfo 
00338   TWrapper
00339   ::GetPCellInfo(const PMeshInfo& theMeshInfo,
00340                  EEntiteMaillage theEntity, 
00341                  EGeometrieElement theGeom, 
00342                  EConnectivite theConnMode,
00343                  TErr* theErr)
00344   {
00345     if(theMeshInfo->GetType() != eNON_STRUCTURE)
00346       return PCellInfo();
00347     TInt aNbElem = GetNbCells(theMeshInfo,theEntity,theGeom,theConnMode);
00348     PCellInfo anInfo = CrCellInfo(theMeshInfo,theEntity,theGeom,aNbElem,theConnMode);
00349     GetCellInfo(anInfo,theErr);
00350 
00351 #ifdef _DEBUG_
00352     TInt aConnDim = anInfo->GetConnDim();
00353     INITMSG(MYDEBUG,"GetPCellInfo - theEntity = "<<theEntity<<"; theGeom = "<<theGeom<<"; aConnDim: "<<aConnDim<<"\n");
00354     BEGMSG(MYDEBUG,"GetPCellInfo - aNbElem: "<<aNbElem<<": ");
00355     for(TInt iElem = 0; iElem < aNbElem; iElem++){
00356       TCConnSlice aConnSlice = anInfo->GetConnSlice(iElem);
00357       for(TInt iConn = 0; iConn < aConnDim; iConn++){
00358         ADDMSG(MYVALUEDEBUG,aConnSlice[iConn]<<",");
00359       }
00360       ADDMSG(MYVALUEDEBUG," ");
00361     }
00362     ADDMSG(MYDEBUG, std::endl);
00363 
00364     BEGMSG(MYVALUEDEBUG,"GetPCellInfo - GetFamNum: ");
00365     for(TInt iElem = 0; iElem < aNbElem; iElem++){
00366       ADDMSG(MYVALUEDEBUG,anInfo->GetFamNum(iElem)<<", ");
00367     }
00368     ADDMSG(MYVALUEDEBUG, std::endl);
00369 
00370     if(anInfo->IsElemNum()){
00371       BEGMSG(MYVALUEDEBUG,"GetPCellInfo - GetElemNum: ");
00372       for(TInt iElem = 0; iElem < aNbElem; iElem++){
00373         ADDMSG(MYVALUEDEBUG,anInfo->GetElemNum(iElem)<<", ");
00374       }
00375       ADDMSG(MYVALUEDEBUG, std::endl);
00376     }
00377     ADDMSG(MYDEBUG, std::endl);
00378 #endif
00379     
00380     return anInfo;
00381   }
00382 
00383 
00384   //----------------------------------------------------------------------------
00385   PFieldInfo
00386   TWrapper
00387   ::GetPFieldInfo(const PMeshInfo& theMeshInfo, 
00388                   TInt theId,
00389                   TErr* theErr)
00390   {
00391     TInt aNbComp = GetNbComp(theId);
00392     PFieldInfo anInfo = CrFieldInfo(theMeshInfo,aNbComp);
00393     GetFieldInfo(theId,*anInfo,theErr);
00394 
00395 #ifdef _DEBUG_
00396     INITMSG(MYDEBUG,
00397             "GetPFieldInfo "<<
00398             "- aName = '"<<anInfo->GetName()<<"'"<<
00399             "; aType = "<<anInfo->GetType()<<
00400             "; aNbComp = "<<aNbComp<<
00401             std::endl);
00402 #endif
00403     
00404     return anInfo;
00405   }
00406 
00407 
00408   //----------------------------------------------------------------------------
00409   PTimeStampInfo
00410   TWrapper
00411   ::GetPTimeStampInfo(const PFieldInfo& theFieldInfo,
00412                       EEntiteMaillage theEntity,
00413                       const TGeom2Size& theGeom2Size,
00414                       TInt theId,
00415                       TErr* theErr)
00416   {
00417     PTimeStampInfo anInfo = CrTimeStampInfo(theFieldInfo,theEntity,theGeom2Size);
00418     GetTimeStampInfo(theId,*anInfo,theErr);
00419 
00420 #ifdef _DEBUG_
00421     INITMSG(MYDEBUG,"GetPTimeStampInfo - anEntity = "<<anInfo->GetEntity()<<"\n");
00422     TGeom2NbGauss& aGeom2NbGauss = anInfo->myGeom2NbGauss;
00423     TGeom2NbGauss::const_iterator anIter = aGeom2NbGauss.begin();
00424     for(; anIter != aGeom2NbGauss.end(); anIter++){
00425       const EGeometrieElement& aGeom = anIter->first;
00426       INITMSG(MYDEBUG,"aGeom = "<<aGeom<<" - "<<aGeom2NbGauss[aGeom]<<";\n");
00427     }
00428 #endif
00429 
00430     return anInfo;
00431   }
00432 
00433 
00434   //----------------------------------------------------------------------------
00435   PProfileInfo
00436   TWrapper
00437   ::GetPProfileInfo(TInt theId,
00438                     EModeProfil theMode,
00439                     TErr* theErr)
00440   {
00441     TProfileInfo::TInfo aPreInfo = GetProfilePreInfo(theId);
00442     PProfileInfo anInfo = CrProfileInfo(aPreInfo,theMode);
00443     GetProfileInfo(theId,*anInfo,theErr);
00444 
00445     return anInfo;
00446   }
00447 
00448 
00449   //----------------------------------------------------------------------------
00450   PTimeStampValueBase
00451   TWrapper
00452   ::CrTimeStampValue(const PTimeStampInfo& theTimeStampInfo,
00453                      const TGeom2Profile& theGeom2Profile,
00454                      EModeSwitch theMode)
00455   {
00456     PFieldInfo aFieldInfo = theTimeStampInfo->GetFieldInfo();
00457     return CrTimeStampValue(theTimeStampInfo,
00458                             aFieldInfo->GetType(),
00459                             theGeom2Profile,
00460                             theMode);
00461   }
00462 
00463   //----------------------------------------------------------------------------
00464   PTimeStampValueBase
00465   TWrapper
00466   ::CrTimeStampValue(const PTimeStampInfo& theTimeStampInfo,
00467                      const PTimeStampValueBase& theInfo)
00468   {
00469     PFieldInfo aFieldInfo = theTimeStampInfo->GetFieldInfo();
00470     return CrTimeStampValue(theTimeStampInfo,
00471                             theInfo,
00472                             aFieldInfo->GetType());
00473   }
00474 
00475   //----------------------------------------------------------------------------
00476   template<class TimeStampValueType>
00477   void
00478   Print(SharedPtr<TimeStampValueType> theTimeStampValue)
00479   {
00480     INITMSG(MYDEBUG,"Print - TimeStampValue\n");
00481     typename TimeStampValueType::TTGeom2Value& aGeom2Value = theTimeStampValue->myGeom2Value;
00482     typename TimeStampValueType::TTGeom2Value::const_iterator anIter = aGeom2Value.begin();
00483     for(; anIter != aGeom2Value.end(); anIter++){
00484       const EGeometrieElement& aGeom = anIter->first;
00485       const typename TimeStampValueType::TTMeshValue& aMeshValue = anIter->second;
00486       TInt aNbElem = aMeshValue.myNbElem;
00487       TInt aNbGauss = aMeshValue.myNbGauss;
00488       TInt aNbComp = aMeshValue.myNbComp;
00489       INITMSG(MYDEBUG,"aGeom = "<<aGeom<<" - "<<aNbElem<<": ");
00490       for(TInt iElem = 0; iElem < aNbElem; iElem++){
00491         typename TimeStampValueType::TTMeshValue::TCValueSliceArr aValueSliceArr = aMeshValue.GetGaussValueSliceArr(iElem);
00492         ADDMSG(MYVALUEDEBUG,"{");
00493         for(TInt iGauss = 0; iGauss < aNbGauss; iGauss++){
00494           const typename TimeStampValueType::TTMeshValue::TCValueSlice& aValueSlice = aValueSliceArr[iGauss];
00495           for(TInt iComp = 0; iComp < aNbComp; iComp++){
00496             ADDMSG(MYVALUEDEBUG,aValueSlice[iComp]<<" ");
00497           }
00498           ADDMSG(MYVALUEDEBUG,"| ");
00499         }
00500         ADDMSG(MYVALUEDEBUG,"} ");
00501       }
00502       ADDMSG(MYDEBUG,"\n");
00503     }
00504   }
00505 
00506   //----------------------------------------------------------------------------
00507   PTimeStampValueBase 
00508   TWrapper
00509   ::GetPTimeStampValue(const PTimeStampInfo& theTimeStampInfo,
00510                        const TMKey2Profile& theMKey2Profile,
00511                        const TKey2Gauss& theKey2Gauss,
00512                        TErr* theErr)
00513   {
00514     PFieldInfo aFieldInfo = theTimeStampInfo->GetFieldInfo();
00515     PTimeStampValueBase anInfo = CrTimeStampValue(theTimeStampInfo,
00516                                                   aFieldInfo->GetType());
00517     GetTimeStampValue(anInfo, 
00518                       theMKey2Profile, 
00519                       theKey2Gauss,
00520                       theErr);
00521 #ifdef _DEBUG_
00522     if(aFieldInfo->GetType() == eFLOAT64)
00523       Print<TFloatTimeStampValue>(anInfo);
00524     else
00525       Print<TIntTimeStampValue>(anInfo);
00526 #endif
00527     return anInfo;
00528   }
00529 
00530   //----------------------------------------------------------------------------
00531   void 
00532   TWrapper
00533   ::GetTimeStampVal(const PTimeStampVal& theVal,
00534                     const TMKey2Profile& theMKey2Profile,
00535                     const TKey2Gauss& theKey2Gauss,
00536                     TErr* theErr)
00537   {
00538     PTimeStampInfo aTimeStampInfo = theVal->GetTimeStampInfo();
00539     PFieldInfo aFieldInfo = aTimeStampInfo->GetFieldInfo();
00540     if(aFieldInfo->GetType() == eFLOAT64)
00541       GetTimeStampValue(theVal,
00542                         theMKey2Profile,
00543                         theKey2Gauss,
00544                         theErr);
00545     else{
00546       PTimeStampValueBase aVal = CrTimeStampValue(aTimeStampInfo,
00547                                                   theVal,
00548                                                   eINT);
00549       GetTimeStampValue(aVal,
00550                         theMKey2Profile,
00551                         theKey2Gauss,
00552                         theErr);
00553       CopyTimeStampValueBase(aVal, theVal);
00554     }
00555   }
00556 
00557   //----------------------------------------------------------------------------
00558   void
00559   TWrapper
00560   ::SetTimeStamp(const PTimeStampVal& theVal,
00561                  TErr* theErr)
00562   {
00563     PTimeStampInfo aTimeStampInfo = theVal->GetTimeStampInfo();
00564     PFieldInfo aFieldInfo = aTimeStampInfo->GetFieldInfo();
00565     if(aFieldInfo->GetType() == eFLOAT64)
00566       SetTimeStampValue(theVal, theErr);
00567     else{
00568       PTimeStampValueBase aVal = CrTimeStampValue(aTimeStampInfo,
00569                                                   eINT,
00570                                                   theVal->GetGeom2Profile(),
00571                                                   theVal->GetModeSwitch());
00572       CopyTimeStampValueBase(theVal, aVal);
00573       SetTimeStampValue(aVal, theErr);
00574     }
00575   }
00576 
00577   //----------------------------------------------------------------------------
00578   PTimeStampVal
00579   TWrapper
00580   ::CrTimeStampVal(const PTimeStampInfo& theTimeStampInfo,
00581                    const TGeom2Profile& theGeom2Profile,
00582                    EModeSwitch theMode)
00583   {
00584     return CrTimeStampValue(theTimeStampInfo,
00585                             eFLOAT64,
00586                             theGeom2Profile,
00587                             theMode);
00588   }
00589 
00590   //----------------------------------------------------------------------------
00591   PTimeStampVal
00592   TWrapper
00593   ::CrTimeStampVal(const PTimeStampInfo& theTimeStampInfo,
00594                    const PTimeStampVal& theInfo)
00595   {
00596     return CrTimeStampValue(theTimeStampInfo,
00597                             theInfo,
00598                             eFLOAT64);
00599   }
00600 
00601   //----------------------------------------------------------------------------
00602   PTimeStampVal 
00603   TWrapper
00604   ::GetPTimeStampVal(const PTimeStampInfo& theTimeStampInfo,
00605                      const TMKey2Profile& theMKey2Profile,
00606                      const TKey2Gauss& theKey2Gauss,
00607                      TErr* theErr)
00608   {
00609     PTimeStampVal anInfo = CrTimeStampVal(theTimeStampInfo);
00610     GetTimeStampVal(anInfo, 
00611                     theMKey2Profile, 
00612                     theKey2Gauss,
00613                     theErr);
00614     return anInfo;
00615   }
00616 
00617   //----------------------------------------------------------------------------
00618   PGrilleInfo
00619   TWrapper
00620   ::GetPGrilleInfo(const PMeshInfo& theMeshInfo)
00621   {
00622     if(theMeshInfo->GetType() != eSTRUCTURE)
00623       return PGrilleInfo();
00624 
00625     EGrilleType type;
00626     GetGrilleType(*theMeshInfo,type);
00627     PGrilleInfo anInfo;
00628     if(type == eGRILLE_STANDARD){
00629       const TInt nnoeuds = GetNbNodes(*theMeshInfo);
00630       anInfo = CrGrilleInfo(theMeshInfo,type,nnoeuds);
00631     }
00632     else {
00633       TIntVector aVec;
00634       aVec.resize(theMeshInfo->GetDim());
00635       for(int aAxe=0;aAxe<theMeshInfo->GetDim();aAxe++){
00636         ETable aATable;
00637         switch(aAxe){
00638         case 0:
00639           aATable = eCOOR_IND1;
00640           break;
00641         case 1:
00642           aATable = eCOOR_IND2;
00643           break;
00644         case 2:
00645           aATable = eCOOR_IND3;
00646           break;
00647         }
00648         aVec[aAxe] = GetNbNodes(*theMeshInfo,aATable);
00649       }
00650       anInfo = CrGrilleInfo(theMeshInfo,type,aVec);
00651     }
00652 
00653     GetGrilleInfo(anInfo);
00654     anInfo->SetGrilleType(type);
00655 
00656 #ifdef _DEBUG_
00657     INITMSG(MYDEBUG,"GetPGrilleInfo: ");
00658     {
00659       TInt aNbElem = anInfo->GetNbNodes();
00660       BEGMSG(MYVALUEDEBUG,"GetFamNumNode: ");
00661       for(TInt iElem = 0; iElem < aNbElem; iElem++){
00662         ADDMSG(MYVALUEDEBUG,anInfo->GetFamNumNode(iElem)<<", ");
00663       }
00664       TInt aNbCells = anInfo->GetNbCells();
00665       BEGMSG(MYVALUEDEBUG,"GetFamNum: ");
00666       for(TInt iElem = 0; iElem < aNbCells; iElem++){
00667         ADDMSG(MYVALUEDEBUG,anInfo->GetFamNum(iElem)<<", ");
00668       }
00669       ADDMSG(MYVALUEDEBUG, std::endl);
00670       BEGMSG(MYVALUEDEBUG,"GetCoordName: ");
00671       for(TInt iElem = 0; iElem < theMeshInfo->GetDim(); iElem++){
00672         ADDMSG(MYVALUEDEBUG,anInfo->GetCoordName(iElem)<<", ");
00673       }
00674       ADDMSG(MYVALUEDEBUG, std::endl);
00675       BEGMSG(MYVALUEDEBUG,"GetCoordUnit: ");
00676       for(TInt iElem = 0; iElem < theMeshInfo->GetDim(); iElem++){
00677         ADDMSG(MYVALUEDEBUG,anInfo->GetCoordUnit(iElem)<<", ");
00678       }
00679       ADDMSG(MYVALUEDEBUG, std::endl);
00680       
00681     }
00682 #endif
00683     
00684     return anInfo;
00685   }
00686   
00687   //----------------------------------------------------------------------------
00688   PGrilleInfo
00689   TWrapper
00690   ::GetPGrilleInfo(const PMeshInfo& theMeshInfo,
00691                    const PGrilleInfo& theInfo)
00692   {
00693     PGrilleInfo anInfo = CrGrilleInfo(theMeshInfo,theInfo);
00694     return anInfo;
00695   }  
00696 }