if (this->myCount++ == 0)
{
std::string dftFileName = MEDCoupling::MEDFileWritableStandAlone::GenerateUniqueDftFileNameInMem();
- memfile = MED_MEMFILE_INIT;
- memfile.app_image_ptr=0;
- memfile.app_image_size=0;
- myFid = MEDmemFileOpen(dftFileName.c_str(),&memfile,MED_FALSE,MED_ACC_CREAT);
+ med_access_mode modeTmp(MED_ACC_CREAT);
+ if(memfile.app_image_ptr)
+ modeTmp = med_access_mode(theMode);
+ myFid = MEDmemFileOpen(dftFileName.c_str(),&memfile,MED_FALSE,modeTmp);
}
if (theErr)
*theErr = TErr(myFid);
public:
TFileWrapper(const PFileInternal& theFile,
- EModeAcces theMode,
- TErr* theErr = NULL,
- TInt theMinor=-1):
+ EModeAcces theMode,
+ TErr* theErr = NULL,
+ TInt theMinor=-1):
myFile(theFile),
myMinor(theMinor)
{
//----------------------------------------------------------------------------
void
TWrapper
- ::GetMeshInfo(TInt theMeshId,
+ ::GetMeshInfo(TInt theMeshId,
MED::TMeshInfo& theInfo,
- TErr* theErr)
+ TErr* theErr)
{
TFileWrapper aFileWrapper(myFile, eLECTURE, theErr, myMinor);
void
TWrapper
::SetMeshInfo(const MED::TMeshInfo& theInfo,
- TErr* theErr)
+ TErr* theErr)
{
TErr aRet;
SetMeshInfo(theInfo, eLECTURE_ECRITURE, &aRet);
void
TWrapper
::SetMeshInfo(const MED::TMeshInfo& theInfo,
- EModeAcces theMode,
- TErr* theErr)
+ EModeAcces theMode,
+ TErr* theErr)
{
TFileWrapper aFileWrapper(myFile, theMode, theErr, myMinor);
//----------------------------------------------------------------------------
PMeshInfo
TWrapper
- ::CrMeshInfo(TInt theDim,
- TInt theSpaceDim,
+ ::CrMeshInfo(TInt theDim,
+ TInt theSpaceDim,
const std::string& theValue,
- EMaillage theType,
+ EMaillage theType,
const std::string& theDesc)
{
return PMeshInfo(new TTMeshInfo
//----------------------------------------------------------------------------
PMeshInfo
TWrapper
- ::GetPMeshInfo(TInt theId,
+ ::GetPMeshInfo(TInt theId,
TErr* theErr)
{
PMeshInfo anInfo = CrMeshInfo();
TInt
TWrapper
::GetNbFamilies(const MED::TMeshInfo& theInfo,
- TErr* theErr)
+ TErr* theErr)
{
TFileWrapper aFileWrapper(myFile, eLECTURE, theErr, myMinor);
//----------------------------------------------------------------------------
TInt
TWrapper
- ::GetNbFamAttr(TInt theFamId,
+ ::GetNbFamAttr(TInt theFamId,
const MED::TMeshInfo& theInfo,
- TErr* theErr)
+ TErr* theErr)
{
TFileWrapper aFileWrapper(myFile, eLECTURE, theErr, myMinor);
//----------------------------------------------------------------------------
TInt
TWrapper
- ::GetNbFamGroup(TInt theFamId,
+ ::GetNbFamGroup(TInt theFamId,
const MED::TMeshInfo& theInfo,
- TErr* theErr)
+ TErr* theErr)
{
TFileWrapper aFileWrapper(myFile, eLECTURE, theErr, myMinor);
//----------------------------------------------------------------------------
void
TWrapper
- ::GetFamilyInfo(TInt theFamId,
+ ::GetFamilyInfo(TInt theFamId,
MED::TFamilyInfo& theInfo,
- TErr* theErr)
+ TErr* theErr)
{
TFileWrapper aFileWrapper(myFile, eLECTURE, theErr, myMinor);
void
TWrapper
::SetFamilyInfo(const MED::TFamilyInfo& theInfo,
- TErr* theErr)
+ TErr* theErr)
{
TErr aRet;
SetFamilyInfo(theInfo, eLECTURE_ECRITURE, &aRet);
void
TWrapper
::SetFamilyInfo(const MED::TFamilyInfo& theInfo,
- EModeAcces theMode,
- TErr* theErr)
+ EModeAcces theMode,
+ TErr* theErr)
{
TFileWrapper aFileWrapper(myFile, theMode, theErr, myMinor);
//----------------------------------------------------------------------------
PFamilyInfo
TWrapper
- ::CrFamilyInfo(const PMeshInfo& theMeshInfo,
- TInt theNbGroup,
- TInt theNbAttr,
- TInt theId,
+ ::CrFamilyInfo(const PMeshInfo& theMeshInfo,
+ TInt theNbGroup,
+ TInt theNbAttr,
+ TInt theId,
const std::string& theValue)
{
return PFamilyInfo(new TTFamilyInfo
//----------------------------------------------------------------------------
PFamilyInfo
TWrapper
- ::CrFamilyInfo(const PMeshInfo& theMeshInfo,
- const std::string& theValue,
- TInt theId,
- const MED::TStringSet& theGroupNames,
+ ::CrFamilyInfo(const PMeshInfo& theMeshInfo,
+ const std::string& theValue,
+ TInt theId,
+ const MED::TStringSet& theGroupNames,
const MED::TStringVector& theAttrDescs,
- const MED::TIntVector& theAttrIds,
- const MED::TIntVector& theAttrVals)
+ const MED::TIntVector& theAttrIds,
+ const MED::TIntVector& theAttrVals)
{
return PFamilyInfo(new TTFamilyInfo
(theMeshInfo,
//----------------------------------------------------------------------------
PFamilyInfo
TWrapper
- ::CrFamilyInfo(const PMeshInfo& theMeshInfo,
+ ::CrFamilyInfo(const PMeshInfo& theMeshInfo,
const PFamilyInfo& theInfo)
{
return PFamilyInfo(new TTFamilyInfo
PFamilyInfo
TWrapper
::GetPFamilyInfo(const PMeshInfo& theMeshInfo,
- TInt theId,
- TErr* theErr)
+ TInt theId,
+ TErr* theErr)
{
// must be reimplemented in connection with mesh type eSTRUCTURE
// if (theMeshInfo->GetType() != eNON_STRUCTURE)
//----------------------------------------------------------------------------
void
TWrapper
- ::GetNames(TElemInfo& theInfo,
- TInt /*theNb*/,
- EEntiteMaillage theEntity,
+ ::GetNames(TElemInfo& theInfo,
+ TInt /*theNb*/,
+ EEntiteMaillage theEntity,
EGeometrieElement theGeom,
- TErr* theErr)
+ TErr* theErr)
{
TFileWrapper aFileWrapper(myFile, eLECTURE, theErr, myMinor);
//----------------------------------------------------------------------------
void
TWrapper
- ::SetNames(const TElemInfo& theInfo,
- EEntiteMaillage theEntity,
+ ::SetNames(const TElemInfo& theInfo,
+ EEntiteMaillage theEntity,
EGeometrieElement theGeom,
- TErr* theErr)
+ TErr* theErr)
{
SetNames(theInfo, eLECTURE_ECRITURE, theEntity, theGeom, theErr);
}
//----------------------------------------------------------------------------
void
TWrapper
- ::SetNames(const TElemInfo& theInfo,
- EModeAcces theMode,
- EEntiteMaillage theEntity,
+ ::SetNames(const TElemInfo& theInfo,
+ EModeAcces theMode,
+ EEntiteMaillage theEntity,
EGeometrieElement theGeom,
- TErr* theErr)
+ TErr* theErr)
{
TFileWrapper aFileWrapper(myFile, theMode, theErr, myMinor);
MED_NO_DT,
MED_NO_IT,
anEntity,
- aGeom,
+ aGeom,
(TInt)anInfo.myElemNames->size(),
&anElemNames);
if (theErr)
//----------------------------------------------------------------------------
void
TWrapper
- ::GetNumeration(TElemInfo& theInfo,
- TInt /*theNb*/,
- EEntiteMaillage theEntity,
+ ::GetNumeration(TElemInfo& theInfo,
+ TInt /*theNb*/,
+ EEntiteMaillage theEntity,
EGeometrieElement theGeom,
- TErr* theErr)
+ TErr* theErr)
{
TFileWrapper aFileWrapper(myFile, eLECTURE, theErr, myMinor);
//----------------------------------------------------------------------------
void
TWrapper
- ::SetNumeration(const TElemInfo& theInfo,
- EEntiteMaillage theEntity,
+ ::SetNumeration(const TElemInfo& theInfo,
+ EEntiteMaillage theEntity,
EGeometrieElement theGeom,
- TErr* theErr)
+ TErr* theErr)
{
SetNumeration(theInfo, eLECTURE_ECRITURE, theEntity, theGeom, theErr);
}
//----------------------------------------------------------------------------
void
TWrapper
- ::SetNumeration(const TElemInfo& theInfo,
- EModeAcces theMode,
- EEntiteMaillage theEntity,
+ ::SetNumeration(const TElemInfo& theInfo,
+ EModeAcces theMode,
+ EEntiteMaillage theEntity,
EGeometrieElement theGeom,
- TErr* theErr)
+ TErr* theErr)
{
TFileWrapper aFileWrapper(myFile, theMode, theErr, myMinor);
//----------------------------------------------------------------------------
void
TWrapper
- ::GetFamilies(TElemInfo& theInfo,
- TInt /*theNb*/,
- EEntiteMaillage theEntity,
+ ::GetFamilies(TElemInfo& theInfo,
+ TInt /*theNb*/,
+ EEntiteMaillage theEntity,
EGeometrieElement theGeom,
- TErr* theErr)
+ TErr* theErr)
{
TFileWrapper aFileWrapper(myFile, eLECTURE, theErr, myMinor);
//----------------------------------------------------------------------------
void
TWrapper
- ::SetFamilies(const TElemInfo& theInfo,
- EEntiteMaillage theEntity,
+ ::SetFamilies(const TElemInfo& theInfo,
+ EEntiteMaillage theEntity,
EGeometrieElement theGeom,
- TErr* theErr)
+ TErr* theErr)
{
SetFamilies(theInfo, eLECTURE_ECRITURE, theEntity, theGeom, theErr);
}
//----------------------------------------------------------------------------
void
TWrapper
- ::SetFamilies(const TElemInfo& theInfo,
- EModeAcces theMode,
- EEntiteMaillage theEntity,
+ ::SetFamilies(const TElemInfo& theInfo,
+ EModeAcces theMode,
+ EEntiteMaillage theEntity,
EGeometrieElement theGeom,
- TErr* theErr)
+ TErr* theErr)
{
TFileWrapper aFileWrapper(myFile, theMode, theErr, myMinor);
TInt
TWrapper
::GetNbNodes(const MED::TMeshInfo& theMeshInfo,
- TErr* theErr)
+ TErr* theErr)
{
return GetNbNodes(theMeshInfo, eCOOR, theErr);
}
//----------------------------------------------------------------------------
PCellInfo
TWrapper
- ::CrCellInfo(const PMeshInfo& theMeshInfo,
- EEntiteMaillage theEntity,
+ ::CrCellInfo(const PMeshInfo& theMeshInfo,
+ EEntiteMaillage theEntity,
EGeometrieElement theGeom,
- TInt theNbElem,
- EConnectivite theConnMode,
- EBooleen theIsElemNum,
- EBooleen theIsElemNames,
- EModeSwitch theMode)
+ TInt theNbElem,
+ EConnectivite theConnMode,
+ EBooleen theIsElemNum,
+ EBooleen theIsElemNames,
+ EModeSwitch theMode)
{
return PCellInfo(new TTCellInfo
(theMeshInfo,