mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-26 17:30:35 +05:00
choice of MED format, minor version, for backward compatibility
This commit is contained in:
parent
9d73526fbc
commit
51760fb76f
@ -238,11 +238,28 @@ module SMESH
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Enumeration for ExportToMED*()
|
* Enumeration for ExportToMED*()
|
||||||
|
* MED_V2_1 and MED_V2_2 are here for compatibility and mean respectively obsolete and MED_LATEST.
|
||||||
|
* MED_MINOR_0 to MED_MINOR_9 are use to specify the minor version used by MEDfichier
|
||||||
|
* to write MED files (major version cannot be changed).
|
||||||
|
* This allows backward compatibility from a newer version of SALOME to an older one:
|
||||||
|
* for instance, a MESH produced in SALOME 8.4 (med 3.3) can be written in med 3.2 format
|
||||||
|
* to be read in SALOME 8.3.
|
||||||
*/
|
*/
|
||||||
enum MED_VERSION
|
enum MED_VERSION
|
||||||
{
|
{
|
||||||
MED_V2_1,
|
MED_V2_1,
|
||||||
MED_V2_2
|
MED_V2_2,
|
||||||
|
MED_LATEST,
|
||||||
|
MED_MINOR_0,
|
||||||
|
MED_MINOR_1,
|
||||||
|
MED_MINOR_2,
|
||||||
|
MED_MINOR_3,
|
||||||
|
MED_MINOR_4,
|
||||||
|
MED_MINOR_5,
|
||||||
|
MED_MINOR_6,
|
||||||
|
MED_MINOR_7,
|
||||||
|
MED_MINOR_8,
|
||||||
|
MED_MINOR_9
|
||||||
};
|
};
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -686,8 +703,8 @@ module SMESH
|
|||||||
raises (SALOME::SALOME_Exception);
|
raises (SALOME::SALOME_Exception);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Export Mesh to MED_V2_1 MED format
|
* Export Mesh to MED_LATEST MED format
|
||||||
* Works, just the same as ExportToMEDX with MED_VERSION parameter equal to MED_V2_1
|
* Works, just the same as ExportToMEDX with MED_VERSION parameter equal to MED_LATEST
|
||||||
* and overwrite parameter equal to true
|
* and overwrite parameter equal to true
|
||||||
* The method is kept in order to support old functionality
|
* The method is kept in order to support old functionality
|
||||||
*/
|
*/
|
||||||
|
@ -70,6 +70,7 @@ void DriverMED_W_SMESHDS_Mesh::SetFile(const std::string& theFileName,
|
|||||||
{
|
{
|
||||||
Driver_SMESHDS_Mesh::SetFile(theFileName);
|
Driver_SMESHDS_Mesh::SetFile(theFileName);
|
||||||
myMedVersion = theId;
|
myMedVersion = theId;
|
||||||
|
//MESSAGE("myMedVersion:"<<myMedVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DriverMED_W_SMESHDS_Mesh::SetFile(const std::string& theFileName)
|
void DriverMED_W_SMESHDS_Mesh::SetFile(const std::string& theFileName)
|
||||||
@ -77,19 +78,39 @@ void DriverMED_W_SMESHDS_Mesh::SetFile(const std::string& theFileName)
|
|||||||
Driver_SMESHDS_Mesh::SetFile(theFileName);
|
Driver_SMESHDS_Mesh::SetFile(theFileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* MED version is either the latest available, or with an inferior minor,
|
||||||
|
* to ensure backward compatibility on writing med files.
|
||||||
|
*/
|
||||||
string DriverMED_W_SMESHDS_Mesh::GetVersionString(const MED::EVersion theVersion, int theNbDigits)
|
string DriverMED_W_SMESHDS_Mesh::GetVersionString(const MED::EVersion theVersion, int theNbDigits)
|
||||||
{
|
{
|
||||||
TInt majeur, mineur, release;
|
TInt majeur, mineur, release;
|
||||||
majeur = mineur = release = 0;
|
majeur = mineur = release = 0;
|
||||||
// if ( theVersion == eV2_1 )
|
|
||||||
// MED::GetVersionRelease<eV2_1>(majeur, mineur, release);
|
|
||||||
// else
|
|
||||||
MED::GetVersionRelease<eV2_2>(majeur, mineur, release);
|
MED::GetVersionRelease<eV2_2>(majeur, mineur, release);
|
||||||
|
TInt imposedMineur = mineur;
|
||||||
|
switch( theVersion ) {
|
||||||
|
case MED::eV2_1 :
|
||||||
|
case MED::eV2_2 :
|
||||||
|
case MED::eLATEST : break;
|
||||||
|
case MED::eMINOR_0 : imposedMineur = 0; break;
|
||||||
|
case MED::eMINOR_1 : imposedMineur = 1; break;
|
||||||
|
case MED::eMINOR_2 : imposedMineur = 2; break;
|
||||||
|
case MED::eMINOR_3 : imposedMineur = 3; break;
|
||||||
|
case MED::eMINOR_4 : imposedMineur = 4; break;
|
||||||
|
case MED::eMINOR_5 : imposedMineur = 5; break;
|
||||||
|
case MED::eMINOR_6 : imposedMineur = 6; break;
|
||||||
|
case MED::eMINOR_7 : imposedMineur = 7; break;
|
||||||
|
case MED::eMINOR_8 : imposedMineur = 8; break;
|
||||||
|
case MED::eMINOR_9 : imposedMineur = 9; break;
|
||||||
|
case MED::eVUnknown : imposedMineur = mineur; break;
|
||||||
|
}
|
||||||
|
if (imposedMineur > mineur)
|
||||||
|
imposedMineur = mineur;
|
||||||
ostringstream name;
|
ostringstream name;
|
||||||
if ( theNbDigits > 0 )
|
if ( theNbDigits > 0 )
|
||||||
name << majeur;
|
name << majeur;
|
||||||
if ( theNbDigits > 1 )
|
if ( theNbDigits > 1 )
|
||||||
name << "." << mineur;
|
name << "." << imposedMineur;
|
||||||
if ( theNbDigits > 2 )
|
if ( theNbDigits > 2 )
|
||||||
name << "." << release;
|
name << "." << release;
|
||||||
return name.str();
|
return name.str();
|
||||||
@ -456,7 +477,7 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//MESSAGE("myMedVersion:"<<myMedVersion);
|
||||||
MED::PWrapper myMed = CrWrapper(myFile,myMedVersion);
|
MED::PWrapper myMed = CrWrapper(myFile,myMedVersion);
|
||||||
PMeshInfo aMeshInfo = myMed->CrMeshInfo(aMeshDimension,aSpaceDimension,aMeshName);
|
PMeshInfo aMeshInfo = myMed->CrMeshInfo(aMeshDimension,aSpaceDimension,aMeshName);
|
||||||
//MESSAGE("Add - aMeshName : "<<aMeshName<<"; "<<aMeshInfo->GetName());
|
//MESSAGE("Add - aMeshName : "<<aMeshName<<"; "<<aMeshInfo->GetName());
|
||||||
|
@ -44,8 +44,10 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace MED{
|
namespace MED{
|
||||||
|
// enum EVersion sould be synchronized with enum MED_VERSION in SMESH_Mesh.idl (.hh)
|
||||||
enum EVersion {eVUnknown = -1, eV2_1, eV2_2};
|
// i.e. same positive values!
|
||||||
|
enum EVersion {eVUnknown = -1, eV2_1, eV2_2, eLATEST,
|
||||||
|
eMINOR_0, eMINOR_1, eMINOR_2, eMINOR_3, eMINOR_4, eMINOR_5, eMINOR_6, eMINOR_7, eMINOR_8, eMINOR_9};
|
||||||
|
|
||||||
typedef enum {eFAUX, eVRAI} EBooleen ;
|
typedef enum {eFAUX, eVRAI} EBooleen ;
|
||||||
typedef double TFloat;
|
typedef double TFloat;
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
#include "MED_Factory.hxx"
|
#include "MED_Factory.hxx"
|
||||||
#include "MED_Utilities.hxx"
|
#include "MED_Utilities.hxx"
|
||||||
#include "MED_V2_2_Wrapper.hxx"
|
#include "MED_V2_2_Wrapper.hxx"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
@ -90,6 +89,7 @@ namespace MED
|
|||||||
if(aMajor == 2 && aMinor == 1)
|
if(aMajor == 2 && aMinor == 1)
|
||||||
aVersion = eV2_1;
|
aVersion = eV2_1;
|
||||||
else
|
else
|
||||||
|
// TODO: check major is not superior to library and switch on minor
|
||||||
aVersion = eV2_2;
|
aVersion = eV2_2;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -124,20 +124,19 @@ namespace MED
|
|||||||
}
|
}
|
||||||
|
|
||||||
PWrapper CrWrapper(const std::string& theFileName,
|
PWrapper CrWrapper(const std::string& theFileName,
|
||||||
bool theDoPreCheckInSeparateProcess)
|
bool theDoPreCheckInSeparateProcess,
|
||||||
|
int theMinor)
|
||||||
{
|
{
|
||||||
PWrapper aWrapper;
|
PWrapper aWrapper;
|
||||||
|
if (theMinor <0)
|
||||||
|
theMinor = MED_MINOR_NUM;
|
||||||
EVersion aVersion = GetVersionId(theFileName,theDoPreCheckInSeparateProcess);
|
EVersion aVersion = GetVersionId(theFileName,theDoPreCheckInSeparateProcess);
|
||||||
switch(aVersion){
|
switch(aVersion){
|
||||||
case eV2_2:
|
|
||||||
aWrapper.reset(new MED::V2_2::TVWrapper(theFileName));
|
|
||||||
break;
|
|
||||||
case eV2_1:
|
case eV2_1:
|
||||||
EXCEPTION(std::runtime_error,"Cannot open file '"<<theFileName<<"'. Med version 2.1 is not supported any more.");
|
EXCEPTION(std::runtime_error,"Cannot open file '"<<theFileName<<"'. Med version 2.1 is not supported any more.");
|
||||||
//aWrapper.reset(new MED::V2_1::TVWrapper(theFileName));
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
EXCEPTION(std::runtime_error,"MED::CrWrapper - theFileName = '"<<theFileName<<"'");
|
aWrapper.reset(new MED::V2_2::TVWrapper(theFileName, theMinor));
|
||||||
}
|
}
|
||||||
return aWrapper;
|
return aWrapper;
|
||||||
}
|
}
|
||||||
@ -145,22 +144,29 @@ namespace MED
|
|||||||
PWrapper CrWrapper(const std::string& theFileName, EVersion theId)
|
PWrapper CrWrapper(const std::string& theFileName, EVersion theId)
|
||||||
{
|
{
|
||||||
EVersion aVersion = GetVersionId(theFileName);
|
EVersion aVersion = GetVersionId(theFileName);
|
||||||
|
if (aVersion == eVUnknown) // no existing file
|
||||||
|
aVersion = theId;
|
||||||
|
|
||||||
if(aVersion != theId)
|
if(aVersion != theId)
|
||||||
remove(theFileName.c_str());
|
//remove(theFileName.c_str());
|
||||||
|
EXCEPTION(std::runtime_error,"Cannot open file for writing '"<<theFileName<<"'. existing file with another Med version.");
|
||||||
|
|
||||||
|
aVersion = theId;
|
||||||
|
int theMinor = -1; // not supported
|
||||||
|
switch (aVersion)
|
||||||
|
{
|
||||||
|
case eV2_1: break; // not supported
|
||||||
|
case eVUnknown:
|
||||||
|
case eV2_2:
|
||||||
|
case eLATEST: theMinor = MED_MINOR_NUM; break;
|
||||||
|
default: theMinor = aVersion - eMINOR_0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (theMinor < 0)
|
||||||
|
EXCEPTION(std::runtime_error,"Cannot open file '"<<theFileName<<"'. Med version 2.1 is not supported any more.");
|
||||||
|
|
||||||
PWrapper aWrapper;
|
PWrapper aWrapper;
|
||||||
switch(theId){
|
aWrapper.reset(new MED::V2_2::TVWrapper(theFileName, theMinor));
|
||||||
case eV2_2:
|
|
||||||
aWrapper.reset(new MED::V2_2::TVWrapper(theFileName));
|
|
||||||
break;
|
|
||||||
case eV2_1:
|
|
||||||
EXCEPTION(std::runtime_error,"Cannot open file '"<<theFileName<<"'. Med version 2.1 is not supported any more.");
|
|
||||||
//aWrapper.reset(new MED::V2_1::TVWrapper(theFileName));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
aWrapper.reset(new MED::V2_2::TVWrapper(theFileName));
|
|
||||||
}
|
|
||||||
return aWrapper;
|
return aWrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,7 +39,8 @@ namespace MED
|
|||||||
MEDWRAPPER_FACTORY_EXPORT
|
MEDWRAPPER_FACTORY_EXPORT
|
||||||
PWrapper
|
PWrapper
|
||||||
CrWrapper(const std::string& theFileName,
|
CrWrapper(const std::string& theFileName,
|
||||||
bool theDoPreCheckInSeparateProcess = false);
|
bool theDoPreCheckInSeparateProcess = false,
|
||||||
|
int theMinor=-1);
|
||||||
|
|
||||||
MEDWRAPPER_FACTORY_EXPORT
|
MEDWRAPPER_FACTORY_EXPORT
|
||||||
PWrapper
|
PWrapper
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
|
|
||||||
#include <med.h>
|
#include <med.h>
|
||||||
#include <med_err.h>
|
#include <med_err.h>
|
||||||
|
#include <med_proto.h>
|
||||||
|
|
||||||
#ifdef _DEBUG_
|
#ifdef _DEBUG_
|
||||||
static int MYDEBUG = 0;
|
static int MYDEBUG = 0;
|
||||||
@ -99,11 +100,14 @@ namespace MED
|
|||||||
TFile(const TFile&);
|
TFile(const TFile&);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TFile(const std::string& theFileName):
|
TFile(const std::string& theFileName, TInt theMinor=-1):
|
||||||
myCount(0),
|
myCount(0),
|
||||||
myFid(0),
|
myFid(0),
|
||||||
myFileName(theFileName)
|
myFileName(theFileName),
|
||||||
{}
|
myMinor(theMinor)
|
||||||
|
{
|
||||||
|
if ((myMinor < 0) || (myMinor > MED_MINOR_NUM)) myMinor = MED_MINOR_NUM;
|
||||||
|
}
|
||||||
|
|
||||||
~TFile()
|
~TFile()
|
||||||
{
|
{
|
||||||
@ -115,12 +119,12 @@ namespace MED
|
|||||||
{
|
{
|
||||||
if(myCount++ == 0){
|
if(myCount++ == 0){
|
||||||
const char* aFileName = myFileName.c_str();
|
const char* aFileName = myFileName.c_str();
|
||||||
myFid = MEDfileOpen(aFileName,med_access_mode(theMode));
|
myFid = MEDfileVersionOpen(aFileName,med_access_mode(theMode), MED_MAJOR_NUM, myMinor, MED_RELEASE_NUM);
|
||||||
}
|
}
|
||||||
if(theErr)
|
if(theErr)
|
||||||
*theErr = TErr(myFid);
|
*theErr = TErr(myFid);
|
||||||
else if(myFid < 0)
|
else if(myFid < 0)
|
||||||
EXCEPTION(std::runtime_error,"TFile - MEDfileOpen('"<<myFileName<<"',"<<theMode<<")");
|
EXCEPTION(std::runtime_error,"TFile - MEDfileVersionOpen('"<<myFileName<<"',"<<theMode<<"',"<< MED_MAJOR_NUM<<"',"<< myMinor<<"',"<< MED_RELEASE_NUM<<")");
|
||||||
}
|
}
|
||||||
|
|
||||||
const TIdt& Id() const
|
const TIdt& Id() const
|
||||||
@ -140,6 +144,7 @@ namespace MED
|
|||||||
TInt myCount;
|
TInt myCount;
|
||||||
TIdt myFid;
|
TIdt myFid;
|
||||||
std::string myFileName;
|
std::string myFileName;
|
||||||
|
TInt myMinor;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -147,11 +152,14 @@ namespace MED
|
|||||||
class TFileWrapper
|
class TFileWrapper
|
||||||
{
|
{
|
||||||
PFile myFile;
|
PFile myFile;
|
||||||
|
TInt myMinor;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TFileWrapper(const PFile& theFile, EModeAcces theMode, TErr* theErr = NULL):
|
TFileWrapper(const PFile& theFile, EModeAcces theMode, TErr* theErr = NULL, TInt theMinor=-1):
|
||||||
myFile(theFile)
|
myFile(theFile),
|
||||||
|
myMinor(theMinor)
|
||||||
{
|
{
|
||||||
|
if (myMinor < 0) myMinor = MED_MINOR_NUM;
|
||||||
myFile->Open(theMode,theErr);
|
myFile->Open(theMode,theErr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -163,15 +171,12 @@ namespace MED
|
|||||||
|
|
||||||
|
|
||||||
//---------------------------------------------------------------
|
//---------------------------------------------------------------
|
||||||
TVWrapper::TVWrapper(const std::string& theFileName):
|
TVWrapper::TVWrapper(const std::string& theFileName, TInt theMinor):
|
||||||
myFile(new TFile(theFileName))
|
myMinor(theMinor),
|
||||||
|
myFile(new TFile(theFileName, theMinor))
|
||||||
{
|
{
|
||||||
TErr aRet;
|
TErr aRet;
|
||||||
myFile->Open( eLECTURE_ECRITURE, &aRet );
|
myFile->Open( eLECTURE_ECRITURE, &aRet );
|
||||||
// if(aRet < 0)
|
|
||||||
// myFile->Close();
|
|
||||||
// myFile->Open( eLECTURE_AJOUT, &aRet );
|
|
||||||
// }
|
|
||||||
if(aRet < 0) {
|
if(aRet < 0) {
|
||||||
myFile->Close();
|
myFile->Close();
|
||||||
myFile->Open( eLECTURE, &aRet );
|
myFile->Open( eLECTURE, &aRet );
|
||||||
@ -188,7 +193,7 @@ namespace MED
|
|||||||
TVWrapper
|
TVWrapper
|
||||||
::GetNbMeshes(TErr* theErr)
|
::GetNbMeshes(TErr* theErr)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
|
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
|
||||||
|
|
||||||
if(theErr && *theErr < 0)
|
if(theErr && *theErr < 0)
|
||||||
return -1;
|
return -1;
|
||||||
@ -204,7 +209,7 @@ namespace MED
|
|||||||
MED::TMeshInfo& theInfo,
|
MED::TMeshInfo& theInfo,
|
||||||
TErr* theErr)
|
TErr* theErr)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
|
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
|
||||||
|
|
||||||
if(theErr && *theErr < 0)
|
if(theErr && *theErr < 0)
|
||||||
return;
|
return;
|
||||||
@ -247,7 +252,7 @@ namespace MED
|
|||||||
EModeAcces theMode,
|
EModeAcces theMode,
|
||||||
TErr* theErr)
|
TErr* theErr)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,theMode,theErr);
|
TFileWrapper aFileWrapper(myFile,theMode,theErr, myMinor);
|
||||||
|
|
||||||
if(theErr && *theErr < 0)
|
if(theErr && *theErr < 0)
|
||||||
return;
|
return;
|
||||||
@ -316,7 +321,7 @@ namespace MED
|
|||||||
::GetNbFamilies(const MED::TMeshInfo& theInfo,
|
::GetNbFamilies(const MED::TMeshInfo& theInfo,
|
||||||
TErr* theErr)
|
TErr* theErr)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
|
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
|
||||||
|
|
||||||
if(theErr && *theErr < 0)
|
if(theErr && *theErr < 0)
|
||||||
return -1;
|
return -1;
|
||||||
@ -334,7 +339,7 @@ namespace MED
|
|||||||
const MED::TMeshInfo& theInfo,
|
const MED::TMeshInfo& theInfo,
|
||||||
TErr* theErr)
|
TErr* theErr)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
|
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
|
||||||
|
|
||||||
if(theErr && *theErr < 0)
|
if(theErr && *theErr < 0)
|
||||||
return -1;
|
return -1;
|
||||||
@ -354,7 +359,7 @@ namespace MED
|
|||||||
const MED::TMeshInfo& theInfo,
|
const MED::TMeshInfo& theInfo,
|
||||||
TErr* theErr)
|
TErr* theErr)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
|
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
|
||||||
|
|
||||||
if(theErr && *theErr < 0)
|
if(theErr && *theErr < 0)
|
||||||
return -1;
|
return -1;
|
||||||
@ -374,7 +379,7 @@ namespace MED
|
|||||||
MED::TFamilyInfo& theInfo,
|
MED::TFamilyInfo& theInfo,
|
||||||
TErr* theErr)
|
TErr* theErr)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
|
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
|
||||||
|
|
||||||
if(theErr && *theErr < 0)
|
if(theErr && *theErr < 0)
|
||||||
return;
|
return;
|
||||||
@ -417,7 +422,7 @@ namespace MED
|
|||||||
EModeAcces theMode,
|
EModeAcces theMode,
|
||||||
TErr* theErr)
|
TErr* theErr)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,theMode,theErr);
|
TFileWrapper aFileWrapper(myFile,theMode,theErr, myMinor);
|
||||||
|
|
||||||
if(theErr && *theErr < 0)
|
if(theErr && *theErr < 0)
|
||||||
return;
|
return;
|
||||||
@ -476,7 +481,7 @@ namespace MED
|
|||||||
EGeometrieElement theGeom,
|
EGeometrieElement theGeom,
|
||||||
TErr* theErr)
|
TErr* theErr)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
|
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
|
||||||
|
|
||||||
if(theErr && *theErr < 0)
|
if(theErr && *theErr < 0)
|
||||||
return;
|
return;
|
||||||
@ -514,7 +519,7 @@ namespace MED
|
|||||||
EGeometrieElement theGeom,
|
EGeometrieElement theGeom,
|
||||||
TErr* theErr)
|
TErr* theErr)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
|
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
|
||||||
|
|
||||||
if(theErr && *theErr < 0)
|
if(theErr && *theErr < 0)
|
||||||
return;
|
return;
|
||||||
@ -552,7 +557,7 @@ namespace MED
|
|||||||
EGeometrieElement theGeom,
|
EGeometrieElement theGeom,
|
||||||
TErr* theErr)
|
TErr* theErr)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
|
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
|
||||||
|
|
||||||
if(theErr && *theErr < 0)
|
if(theErr && *theErr < 0)
|
||||||
return;
|
return;
|
||||||
@ -613,7 +618,7 @@ namespace MED
|
|||||||
EGeometrieElement theGeom,
|
EGeometrieElement theGeom,
|
||||||
TErr* theErr)
|
TErr* theErr)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,theMode,theErr);
|
TFileWrapper aFileWrapper(myFile,theMode,theErr, myMinor);
|
||||||
|
|
||||||
if(theErr && *theErr < 0)
|
if(theErr && *theErr < 0)
|
||||||
return;
|
return;
|
||||||
@ -669,7 +674,7 @@ namespace MED
|
|||||||
EGeometrieElement theGeom,
|
EGeometrieElement theGeom,
|
||||||
TErr* theErr)
|
TErr* theErr)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,theMode,theErr);
|
TFileWrapper aFileWrapper(myFile,theMode,theErr, myMinor);
|
||||||
|
|
||||||
if(theErr && *theErr < 0)
|
if(theErr && *theErr < 0)
|
||||||
return;
|
return;
|
||||||
@ -723,7 +728,7 @@ namespace MED
|
|||||||
EGeometrieElement theGeom,
|
EGeometrieElement theGeom,
|
||||||
TErr* theErr)
|
TErr* theErr)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,theMode,theErr);
|
TFileWrapper aFileWrapper(myFile,theMode,theErr, myMinor);
|
||||||
|
|
||||||
if(theErr && *theErr < 0)
|
if(theErr && *theErr < 0)
|
||||||
return;
|
return;
|
||||||
@ -761,7 +766,7 @@ namespace MED
|
|||||||
ETable theTable,
|
ETable theTable,
|
||||||
TErr* theErr)
|
TErr* theErr)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
|
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
|
||||||
|
|
||||||
if(theErr && *theErr < 0)
|
if(theErr && *theErr < 0)
|
||||||
return -1;
|
return -1;
|
||||||
@ -790,7 +795,7 @@ namespace MED
|
|||||||
::GetNodeInfo(MED::TNodeInfo& theInfo,
|
::GetNodeInfo(MED::TNodeInfo& theInfo,
|
||||||
TErr* theErr)
|
TErr* theErr)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
|
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
|
||||||
|
|
||||||
if(theErr && *theErr < 0)
|
if(theErr && *theErr < 0)
|
||||||
return;
|
return;
|
||||||
@ -867,7 +872,7 @@ namespace MED
|
|||||||
EModeAcces theMode,
|
EModeAcces theMode,
|
||||||
TErr* theErr)
|
TErr* theErr)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,theMode,theErr);
|
TFileWrapper aFileWrapper(myFile,theMode,theErr, myMinor);
|
||||||
|
|
||||||
if(theErr && *theErr < 0)
|
if(theErr && *theErr < 0)
|
||||||
return;
|
return;
|
||||||
@ -953,7 +958,7 @@ namespace MED
|
|||||||
::GetPolygoneInfo(MED::TPolygoneInfo& theInfo,
|
::GetPolygoneInfo(MED::TPolygoneInfo& theInfo,
|
||||||
TErr* theErr)
|
TErr* theErr)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
|
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
|
||||||
|
|
||||||
if(theErr && *theErr < 0)
|
if(theErr && *theErr < 0)
|
||||||
return;
|
return;
|
||||||
@ -1012,7 +1017,7 @@ namespace MED
|
|||||||
EModeAcces theMode,
|
EModeAcces theMode,
|
||||||
TErr* theErr)
|
TErr* theErr)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,theMode,theErr);
|
TFileWrapper aFileWrapper(myFile,theMode,theErr, myMinor);
|
||||||
|
|
||||||
if(theErr && *theErr < 0)
|
if(theErr && *theErr < 0)
|
||||||
return;
|
return;
|
||||||
@ -1071,7 +1076,7 @@ namespace MED
|
|||||||
EConnectivite theConnMode,
|
EConnectivite theConnMode,
|
||||||
TErr* theErr)
|
TErr* theErr)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
|
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
|
||||||
|
|
||||||
if(theErr && *theErr < 0)
|
if(theErr && *theErr < 0)
|
||||||
return 0;
|
return 0;
|
||||||
@ -1105,7 +1110,7 @@ namespace MED
|
|||||||
::GetPolyedreInfo(TPolyedreInfo& theInfo,
|
::GetPolyedreInfo(TPolyedreInfo& theInfo,
|
||||||
TErr* theErr)
|
TErr* theErr)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
|
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
|
||||||
|
|
||||||
if(theErr && *theErr < 0)
|
if(theErr && *theErr < 0)
|
||||||
return;
|
return;
|
||||||
@ -1168,7 +1173,7 @@ namespace MED
|
|||||||
EModeAcces theMode,
|
EModeAcces theMode,
|
||||||
TErr* theErr)
|
TErr* theErr)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,theMode,theErr);
|
TFileWrapper aFileWrapper(myFile,theMode,theErr, myMinor);
|
||||||
|
|
||||||
if(theErr && *theErr < 0)
|
if(theErr && *theErr < 0)
|
||||||
return;
|
return;
|
||||||
@ -1272,7 +1277,7 @@ namespace MED
|
|||||||
EConnectivite theConnMode,
|
EConnectivite theConnMode,
|
||||||
TErr* theErr)
|
TErr* theErr)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
|
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
|
||||||
|
|
||||||
if(theErr && *theErr < 0)
|
if(theErr && *theErr < 0)
|
||||||
EXCEPTION(std::runtime_error,"GetPolyedreConnSize - (...)");
|
EXCEPTION(std::runtime_error,"GetPolyedreConnSize - (...)");
|
||||||
@ -1321,7 +1326,7 @@ namespace MED
|
|||||||
{
|
{
|
||||||
TEntityInfo anInfo;
|
TEntityInfo anInfo;
|
||||||
|
|
||||||
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
|
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
|
||||||
|
|
||||||
if(theErr && *theErr < 0)
|
if(theErr && *theErr < 0)
|
||||||
return anInfo;
|
return anInfo;
|
||||||
@ -1431,7 +1436,7 @@ namespace MED
|
|||||||
EConnectivite theConnMode,
|
EConnectivite theConnMode,
|
||||||
TErr* theErr)
|
TErr* theErr)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
|
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
|
||||||
|
|
||||||
if(theErr && *theErr < 0)
|
if(theErr && *theErr < 0)
|
||||||
return -1;
|
return -1;
|
||||||
@ -1478,7 +1483,7 @@ namespace MED
|
|||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void TVWrapper::GetCellInfo(MED::TCellInfo& theInfo, TErr* theErr)
|
void TVWrapper::GetCellInfo(MED::TCellInfo& theInfo, TErr* theErr)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
|
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
|
||||||
|
|
||||||
if(theErr && *theErr < 0)
|
if(theErr && *theErr < 0)
|
||||||
return;
|
return;
|
||||||
@ -1537,7 +1542,7 @@ namespace MED
|
|||||||
EModeAcces theMode,
|
EModeAcces theMode,
|
||||||
TErr* theErr)
|
TErr* theErr)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,theMode,theErr);
|
TFileWrapper aFileWrapper(myFile,theMode,theErr, myMinor);
|
||||||
|
|
||||||
if(theErr && *theErr < 0)
|
if(theErr && *theErr < 0)
|
||||||
return;
|
return;
|
||||||
@ -1618,7 +1623,8 @@ namespace MED
|
|||||||
//! Read geom type of MED_BALL structural element
|
//! Read geom type of MED_BALL structural element
|
||||||
EGeometrieElement TVWrapper::GetBallGeom(const TMeshInfo& theMeshInfo)
|
EGeometrieElement TVWrapper::GetBallGeom(const TMeshInfo& theMeshInfo)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,eLECTURE);
|
TErr anError;
|
||||||
|
TFileWrapper aFileWrapper(myFile, eLECTURE, &anError, myMinor);
|
||||||
|
|
||||||
// read med_geometry_type of "MED_BALL" element
|
// read med_geometry_type of "MED_BALL" element
|
||||||
char geotypename[ MED_NAME_SIZE + 1] = MED_BALL_NAME;
|
char geotypename[ MED_NAME_SIZE + 1] = MED_BALL_NAME;
|
||||||
@ -1629,7 +1635,8 @@ namespace MED
|
|||||||
//! Read number of balls in the Mesh
|
//! Read number of balls in the Mesh
|
||||||
TInt TVWrapper::GetNbBalls(const TMeshInfo& theMeshInfo)
|
TInt TVWrapper::GetNbBalls(const TMeshInfo& theMeshInfo)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,eLECTURE);
|
TErr anError;
|
||||||
|
TFileWrapper aFileWrapper(myFile, eLECTURE, &anError, myMinor);
|
||||||
|
|
||||||
EGeometrieElement ballType = GetBallGeom( theMeshInfo );
|
EGeometrieElement ballType = GetBallGeom( theMeshInfo );
|
||||||
if ( ballType < 0 )
|
if ( ballType < 0 )
|
||||||
@ -1642,7 +1649,7 @@ namespace MED
|
|||||||
//! Read a MEDWrapped representation of MED_BALL from the MED file
|
//! Read a MEDWrapped representation of MED_BALL from the MED file
|
||||||
void TVWrapper::GetBallInfo(TBallInfo& theInfo, TErr* theErr)
|
void TVWrapper::GetBallInfo(TBallInfo& theInfo, TErr* theErr)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
|
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
|
||||||
|
|
||||||
// check geometry of MED_BALL
|
// check geometry of MED_BALL
|
||||||
if ( theInfo.myGeom == eBALL )
|
if ( theInfo.myGeom == eBALL )
|
||||||
@ -1681,7 +1688,7 @@ namespace MED
|
|||||||
//! Write a MEDWrapped representation of MED_BALL to the MED file
|
//! Write a MEDWrapped representation of MED_BALL to the MED file
|
||||||
void TVWrapper::SetBallInfo(const TBallInfo& theInfo, EModeAcces theMode, TErr* theErr)
|
void TVWrapper::SetBallInfo(const TBallInfo& theInfo, EModeAcces theMode, TErr* theErr)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,theMode,theErr);
|
TFileWrapper aFileWrapper(myFile,theMode,theErr, myMinor);
|
||||||
|
|
||||||
TErr ret;
|
TErr ret;
|
||||||
char ballsupportname[MED_NAME_SIZE+1]="BALL_SUPPORT_MESH";
|
char ballsupportname[MED_NAME_SIZE+1]="BALL_SUPPORT_MESH";
|
||||||
@ -1769,7 +1776,7 @@ namespace MED
|
|||||||
TVWrapper
|
TVWrapper
|
||||||
::GetNbFields(TErr* theErr)
|
::GetNbFields(TErr* theErr)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
|
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
|
||||||
|
|
||||||
if(theErr && *theErr < 0)
|
if(theErr && *theErr < 0)
|
||||||
return -1;
|
return -1;
|
||||||
@ -1784,7 +1791,7 @@ namespace MED
|
|||||||
::GetNbComp(TInt theFieldId,
|
::GetNbComp(TInt theFieldId,
|
||||||
TErr* theErr)
|
TErr* theErr)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
|
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
|
||||||
|
|
||||||
if(theErr && *theErr < 0)
|
if(theErr && *theErr < 0)
|
||||||
return -1;
|
return -1;
|
||||||
@ -1800,7 +1807,7 @@ namespace MED
|
|||||||
MED::TFieldInfo& theInfo,
|
MED::TFieldInfo& theInfo,
|
||||||
TErr* theErr)
|
TErr* theErr)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
|
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
|
||||||
|
|
||||||
if(theErr && *theErr < 0)
|
if(theErr && *theErr < 0)
|
||||||
return;
|
return;
|
||||||
@ -1850,7 +1857,7 @@ namespace MED
|
|||||||
EModeAcces theMode,
|
EModeAcces theMode,
|
||||||
TErr* theErr)
|
TErr* theErr)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,theMode,theErr);
|
TFileWrapper aFileWrapper(myFile,theMode,theErr, myMinor);
|
||||||
|
|
||||||
if(theErr && *theErr < 0)
|
if(theErr && *theErr < 0)
|
||||||
return;
|
return;
|
||||||
@ -1902,7 +1909,7 @@ namespace MED
|
|||||||
TVWrapper
|
TVWrapper
|
||||||
::GetNbGauss(TErr* theErr)
|
::GetNbGauss(TErr* theErr)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
|
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
|
||||||
|
|
||||||
if(theErr && *theErr < 0)
|
if(theErr && *theErr < 0)
|
||||||
return -1;
|
return -1;
|
||||||
@ -1917,7 +1924,7 @@ namespace MED
|
|||||||
::GetGaussPreInfo(TInt theId,
|
::GetGaussPreInfo(TInt theId,
|
||||||
TErr* theErr)
|
TErr* theErr)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
|
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
|
||||||
|
|
||||||
if(theErr && *theErr < 0)
|
if(theErr && *theErr < 0)
|
||||||
return TGaussInfo::TInfo( TGaussInfo::TKey(ePOINT1,""),0 );
|
return TGaussInfo::TInfo( TGaussInfo::TKey(ePOINT1,""),0 );
|
||||||
@ -1958,7 +1965,7 @@ namespace MED
|
|||||||
TGaussInfo& theInfo,
|
TGaussInfo& theInfo,
|
||||||
TErr* theErr)
|
TErr* theErr)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
|
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
|
||||||
|
|
||||||
if(theErr && *theErr < 0)
|
if(theErr && *theErr < 0)
|
||||||
return;
|
return;
|
||||||
@ -1989,7 +1996,7 @@ namespace MED
|
|||||||
TVWrapper
|
TVWrapper
|
||||||
::GetNbProfiles(TErr* theErr)
|
::GetNbProfiles(TErr* theErr)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
|
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
|
||||||
|
|
||||||
if(theErr && *theErr < 0)
|
if(theErr && *theErr < 0)
|
||||||
return -1;
|
return -1;
|
||||||
@ -2002,7 +2009,7 @@ namespace MED
|
|||||||
::GetProfilePreInfo(TInt theId,
|
::GetProfilePreInfo(TInt theId,
|
||||||
TErr* theErr)
|
TErr* theErr)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
|
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
|
||||||
|
|
||||||
if(theErr && *theErr < 0)
|
if(theErr && *theErr < 0)
|
||||||
return TProfileInfo::TInfo();
|
return TProfileInfo::TInfo();
|
||||||
@ -2029,7 +2036,7 @@ namespace MED
|
|||||||
TProfileInfo& theInfo,
|
TProfileInfo& theInfo,
|
||||||
TErr* theErr)
|
TErr* theErr)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
|
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
|
||||||
|
|
||||||
if(theErr && *theErr < 0)
|
if(theErr && *theErr < 0)
|
||||||
return;
|
return;
|
||||||
@ -2054,7 +2061,7 @@ namespace MED
|
|||||||
EModeAcces theMode,
|
EModeAcces theMode,
|
||||||
TErr* theErr)
|
TErr* theErr)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,theMode,theErr);
|
TFileWrapper aFileWrapper(myFile,theMode,theErr, myMinor);
|
||||||
|
|
||||||
if(theErr && *theErr < 0)
|
if(theErr && *theErr < 0)
|
||||||
return;
|
return;
|
||||||
@ -2102,7 +2109,7 @@ namespace MED
|
|||||||
TErr* theErr)
|
TErr* theErr)
|
||||||
{
|
{
|
||||||
theEntity = EEntiteMaillage(-1);
|
theEntity = EEntiteMaillage(-1);
|
||||||
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
|
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
|
||||||
|
|
||||||
if(theErr){
|
if(theErr){
|
||||||
if(theEntityInfo.empty())
|
if(theEntityInfo.empty())
|
||||||
@ -2225,7 +2232,7 @@ namespace MED
|
|||||||
MED::TTimeStampInfo& theInfo,
|
MED::TTimeStampInfo& theInfo,
|
||||||
TErr* theErr)
|
TErr* theErr)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
|
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
|
||||||
|
|
||||||
const TGeom2Size& aGeom2Size = theInfo.myGeom2Size;
|
const TGeom2Size& aGeom2Size = theInfo.myGeom2Size;
|
||||||
|
|
||||||
@ -2320,7 +2327,7 @@ namespace MED
|
|||||||
const TKey2Gauss& theKey2Gauss,
|
const TKey2Gauss& theKey2Gauss,
|
||||||
TErr* theErr)
|
TErr* theErr)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
|
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
|
||||||
|
|
||||||
if(theErr && *theErr < 0)
|
if(theErr && *theErr < 0)
|
||||||
return;
|
return;
|
||||||
@ -2488,7 +2495,7 @@ namespace MED
|
|||||||
EModeAcces theMode,
|
EModeAcces theMode,
|
||||||
TErr* theErr)
|
TErr* theErr)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,theMode,theErr);
|
TFileWrapper aFileWrapper(myFile,theMode,theErr, myMinor);
|
||||||
|
|
||||||
if(theErr && *theErr < 0)
|
if(theErr && *theErr < 0)
|
||||||
return;
|
return;
|
||||||
@ -2598,7 +2605,7 @@ namespace MED
|
|||||||
{
|
{
|
||||||
if(theInfo.myMeshInfo->myType != eSTRUCTURE)
|
if(theInfo.myMeshInfo->myType != eSTRUCTURE)
|
||||||
return;
|
return;
|
||||||
TFileWrapper aFileWrapper(myFile,theMode,theErr);
|
TFileWrapper aFileWrapper(myFile,theMode,theErr, myMinor);
|
||||||
|
|
||||||
if(theErr && *theErr < 0)
|
if(theErr && *theErr < 0)
|
||||||
return;
|
return;
|
||||||
@ -2675,7 +2682,7 @@ namespace MED
|
|||||||
::GetGrilleInfo(TGrilleInfo& theInfo,
|
::GetGrilleInfo(TGrilleInfo& theInfo,
|
||||||
TErr* theErr)
|
TErr* theErr)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
|
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
|
||||||
|
|
||||||
if(theErr && *theErr < 0)
|
if(theErr && *theErr < 0)
|
||||||
return;
|
return;
|
||||||
@ -2831,7 +2838,7 @@ namespace MED
|
|||||||
EGrilleType& theGridType,
|
EGrilleType& theGridType,
|
||||||
TErr* theErr)
|
TErr* theErr)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
|
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
|
||||||
|
|
||||||
if(theErr && *theErr < 0)
|
if(theErr && *theErr < 0)
|
||||||
EXCEPTION(std::runtime_error," GetGrilleType - aFileWrapper (...)");
|
EXCEPTION(std::runtime_error," GetGrilleType - aFileWrapper (...)");
|
||||||
@ -2856,7 +2863,7 @@ namespace MED
|
|||||||
TIntVector& theStruct,
|
TIntVector& theStruct,
|
||||||
TErr* theErr)
|
TErr* theErr)
|
||||||
{
|
{
|
||||||
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
|
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
|
||||||
|
|
||||||
if(theErr && *theErr < 0)
|
if(theErr && *theErr < 0)
|
||||||
return;
|
return;
|
||||||
|
@ -91,7 +91,7 @@ namespace MED
|
|||||||
TVWrapper& operator=(const TVWrapper&);
|
TVWrapper& operator=(const TVWrapper&);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TVWrapper(const std::string& theFileName);
|
TVWrapper(const std::string& theFileName, TInt theMinor=-1);
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
virtual
|
virtual
|
||||||
@ -482,6 +482,7 @@ namespace MED
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
PFile myFile;
|
PFile myFile;
|
||||||
|
TInt myMinor;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1402,6 +1402,7 @@ void SMESH_Mesh::ExportMED(const char * file,
|
|||||||
bool theAllElemsToGroup)
|
bool theAllElemsToGroup)
|
||||||
throw(SALOME_Exception)
|
throw(SALOME_Exception)
|
||||||
{
|
{
|
||||||
|
//MESSAGE("MED_VERSION:"<< theVersion);
|
||||||
SMESH_TRY;
|
SMESH_TRY;
|
||||||
|
|
||||||
DriverMED_W_SMESHDS_Mesh myWriter;
|
DriverMED_W_SMESHDS_Mesh myWriter;
|
||||||
|
@ -143,6 +143,7 @@
|
|||||||
#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
|
#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
|
||||||
#include CORBA_CLIENT_HEADER(SMESH_MeshEditor)
|
#include CORBA_CLIENT_HEADER(SMESH_MeshEditor)
|
||||||
#include CORBA_CLIENT_HEADER(SMESH_Measurements)
|
#include CORBA_CLIENT_HEADER(SMESH_Measurements)
|
||||||
|
#include CORBA_CLIENT_HEADER(SMESH_Mesh)
|
||||||
|
|
||||||
// Qt includes
|
// Qt includes
|
||||||
// #define INCLUDE_MENUITEM_DEF // VSR commented ????????
|
// #define INCLUDE_MENUITEM_DEF // VSR commented ????????
|
||||||
@ -653,7 +654,7 @@ namespace
|
|||||||
// Get parameters of export operation
|
// Get parameters of export operation
|
||||||
|
|
||||||
QString aFilename;
|
QString aFilename;
|
||||||
SMESH::MED_VERSION aFormat = SMESH::MED_V2_2;
|
SMESH::MED_VERSION aFormat = SMESH::MED_LATEST;
|
||||||
// Init the parameters with the default values
|
// Init the parameters with the default values
|
||||||
bool aIsASCII_STL = true;
|
bool aIsASCII_STL = true;
|
||||||
bool toCreateGroups = false;
|
bool toCreateGroups = false;
|
||||||
@ -741,11 +742,17 @@ namespace
|
|||||||
else if ( isMED || isSAUV ) // Export to MED or SAUV
|
else if ( isMED || isSAUV ) // Export to MED or SAUV
|
||||||
{
|
{
|
||||||
QMap<QString, SMESH::MED_VERSION> aFilterMap;
|
QMap<QString, SMESH::MED_VERSION> aFilterMap;
|
||||||
//QString v21 (aMesh->GetVersionString(SMESH::MED_V2_1, 2));
|
|
||||||
if ( isMED ) {
|
if ( isMED ) {
|
||||||
QString v22 (aMesh->GetVersionString(SMESH::MED_V2_2, 2));
|
QString v22 (aMesh->GetVersionString(SMESH::MED_V2_2, 2));
|
||||||
//aFilterMap.insert( QObject::tr( "MED_VX_FILES_FILTER" ).arg( v21 ) + " (*.med)", SMESH::MED_V2_1 );
|
|
||||||
aFilterMap.insert( QObject::tr( "MED_VX_FILES_FILTER" ).arg( v22 ) + " (*.med)", SMESH::MED_V2_2 );
|
aFilterMap.insert( QObject::tr( "MED_VX_FILES_FILTER" ).arg( v22 ) + " (*.med)", SMESH::MED_V2_2 );
|
||||||
|
int minor = v22.split(".").last().toInt();
|
||||||
|
int vv= int(SMESH::MED_MINOR_0); // add all minor from 0 to current
|
||||||
|
for (int ii=0; ii<minor; ii++)
|
||||||
|
{
|
||||||
|
QString vs = aMesh->GetVersionString(SMESH::MED_VERSION(vv), 2);
|
||||||
|
aFilterMap.insert( QObject::tr( "MED_VX_FILES_FILTER" ).arg( vs ) + " (*.med)", SMESH::MED_VERSION(vv));
|
||||||
|
vv = vv +1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else { // isSAUV
|
else { // isSAUV
|
||||||
aFilterMap.insert("All files (*)", SMESH::MED_V2_1 );
|
aFilterMap.insert("All files (*)", SMESH::MED_V2_1 );
|
||||||
@ -826,7 +833,7 @@ namespace
|
|||||||
}
|
}
|
||||||
if( !toOverwrite ) {
|
if( !toOverwrite ) {
|
||||||
// can't append to an existing using other format
|
// can't append to an existing using other format
|
||||||
SMESH::MED_VERSION aVersion = SMESH::MED_V2_1;
|
SMESH::MED_VERSION aVersion = aFormat; //SMESH::MED_V2_1;
|
||||||
bool isVersionOk = SMESHGUI::GetSMESHGen()->GetMEDVersion( aFilename.toUtf8().constData(), aVersion );
|
bool isVersionOk = SMESHGUI::GetSMESHGen()->GetMEDVersion( aFilename.toUtf8().constData(), aVersion );
|
||||||
if( !isVersionOk || aVersion != aFormat ) {
|
if( !isVersionOk || aVersion != aFormat ) {
|
||||||
int aRet = SUIT_MessageBox::warning(SMESHGUI::desktop(),
|
int aRet = SUIT_MessageBox::warning(SMESHGUI::desktop(),
|
||||||
|
@ -495,6 +495,17 @@ namespace SMESH
|
|||||||
switch (theVersion) {
|
switch (theVersion) {
|
||||||
case SMESH::MED_V2_1: myStream << "SMESH.MED_V2_1"; break;
|
case SMESH::MED_V2_1: myStream << "SMESH.MED_V2_1"; break;
|
||||||
case SMESH::MED_V2_2: myStream << "SMESH.MED_V2_2"; break;
|
case SMESH::MED_V2_2: myStream << "SMESH.MED_V2_2"; break;
|
||||||
|
case SMESH::MED_LATEST: myStream << "SMESH.MED_LATEST"; break;
|
||||||
|
case SMESH::MED_MINOR_0: myStream << "SMESH.MED_MINOR_0"; break;
|
||||||
|
case SMESH::MED_MINOR_1: myStream << "SMESH.MED_MINOR_1"; break;
|
||||||
|
case SMESH::MED_MINOR_2: myStream << "SMESH.MED_MINOR_2"; break;
|
||||||
|
case SMESH::MED_MINOR_3: myStream << "SMESH.MED_MINOR_3"; break;
|
||||||
|
case SMESH::MED_MINOR_4: myStream << "SMESH.MED_MINOR_4"; break;
|
||||||
|
case SMESH::MED_MINOR_5: myStream << "SMESH.MED_MINOR_5"; break;
|
||||||
|
case SMESH::MED_MINOR_6: myStream << "SMESH.MED_MINOR_6"; break;
|
||||||
|
case SMESH::MED_MINOR_7: myStream << "SMESH.MED_MINOR_7"; break;
|
||||||
|
case SMESH::MED_MINOR_8: myStream << "SMESH.MED_MINOR_8"; break;
|
||||||
|
case SMESH::MED_MINOR_9: myStream << "SMESH.MED_MINOR_9"; break;
|
||||||
default: myStream << theVersion;
|
default: myStream << theVersion;
|
||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -2970,6 +2970,17 @@ CORBA::Boolean SMESH_Gen_i::GetMEDVersion(const char* theFileName,
|
|||||||
switch( aVersion ) {
|
switch( aVersion ) {
|
||||||
case MED::eV2_1 : theVersion = SMESH::MED_V2_1; return true;
|
case MED::eV2_1 : theVersion = SMESH::MED_V2_1; return true;
|
||||||
case MED::eV2_2 : theVersion = SMESH::MED_V2_2; return true;
|
case MED::eV2_2 : theVersion = SMESH::MED_V2_2; return true;
|
||||||
|
case MED::eLATEST : theVersion = SMESH::MED_LATEST; return true;
|
||||||
|
case MED::eMINOR_0 : theVersion = SMESH::MED_MINOR_0; return true;
|
||||||
|
case MED::eMINOR_1 : theVersion = SMESH::MED_MINOR_1; return true;
|
||||||
|
case MED::eMINOR_2 : theVersion = SMESH::MED_MINOR_2; return true;
|
||||||
|
case MED::eMINOR_3 : theVersion = SMESH::MED_MINOR_3; return true;
|
||||||
|
case MED::eMINOR_4 : theVersion = SMESH::MED_MINOR_4; return true;
|
||||||
|
case MED::eMINOR_5 : theVersion = SMESH::MED_MINOR_5; return true;
|
||||||
|
case MED::eMINOR_6 : theVersion = SMESH::MED_MINOR_6; return true;
|
||||||
|
case MED::eMINOR_7 : theVersion = SMESH::MED_MINOR_7; return true;
|
||||||
|
case MED::eMINOR_8 : theVersion = SMESH::MED_MINOR_8; return true;
|
||||||
|
case MED::eMINOR_9 : theVersion = SMESH::MED_MINOR_9; return true;
|
||||||
case MED::eVUnknown : return false;
|
case MED::eVUnknown : return false;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -3022,6 +3022,7 @@ void SMESH_Mesh_i::ExportToMEDX (const char* file,
|
|||||||
CORBA::Boolean autoDimension)
|
CORBA::Boolean autoDimension)
|
||||||
throw(SALOME::SALOME_Exception)
|
throw(SALOME::SALOME_Exception)
|
||||||
{
|
{
|
||||||
|
//MESSAGE("SMESH::MED_VERSION:"<< theVersion);
|
||||||
SMESH_TRY;
|
SMESH_TRY;
|
||||||
if ( _preMeshInfo )
|
if ( _preMeshInfo )
|
||||||
_preMeshInfo->FullLoadFromFile();
|
_preMeshInfo->FullLoadFromFile();
|
||||||
@ -3048,6 +3049,7 @@ void SMESH_Mesh_i::ExportToMED (const char* file,
|
|||||||
SMESH::MED_VERSION theVersion)
|
SMESH::MED_VERSION theVersion)
|
||||||
throw(SALOME::SALOME_Exception)
|
throw(SALOME::SALOME_Exception)
|
||||||
{
|
{
|
||||||
|
//MESSAGE("SMESH::MED_VERSION:"<< theVersion);
|
||||||
ExportToMEDX(file,auto_groups,theVersion,true);
|
ExportToMEDX(file,auto_groups,theVersion,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3061,7 +3063,8 @@ void SMESH_Mesh_i::ExportMED (const char* file,
|
|||||||
CORBA::Boolean auto_groups)
|
CORBA::Boolean auto_groups)
|
||||||
throw(SALOME::SALOME_Exception)
|
throw(SALOME::SALOME_Exception)
|
||||||
{
|
{
|
||||||
ExportToMEDX(file,auto_groups,SMESH::MED_V2_2,true);
|
//MESSAGE("SMESH::MED_VERSION:"<< SMESH::MED_LATEST);
|
||||||
|
ExportToMEDX(file,auto_groups,SMESH::MED_LATEST,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
//================================================================================
|
//================================================================================
|
||||||
|
@ -1793,9 +1793,14 @@ class Mesh:
|
|||||||
# @param auto_groups boolean parameter for creating/not creating
|
# @param auto_groups boolean parameter for creating/not creating
|
||||||
# the groups Group_On_All_Nodes, Group_On_All_Faces, ... ;
|
# the groups Group_On_All_Nodes, Group_On_All_Faces, ... ;
|
||||||
# the typical use is auto_groups=False.
|
# the typical use is auto_groups=False.
|
||||||
# @param version MED format version (MED_V2_1 or MED_V2_2,
|
# @param version MED format version
|
||||||
# the latter meaning any current version). The parameter is
|
# - MED_V2_1 is obsolete.
|
||||||
# obsolete since MED_V2_1 is no longer supported.
|
# - MED_V2_2 means current version (kept for compatibility reasons)
|
||||||
|
# - MED_LATEST means current version.
|
||||||
|
# - MED_MINOR_x where x from 0 to 9 indicates the minor version of MED
|
||||||
|
# to use for writing MED files, for backward compatibility :
|
||||||
|
# for instance, with SALOME 8.4 use MED 3.2 (minor=2) instead of 3.3,
|
||||||
|
# to allow the file to be read with SALOME 8.3.
|
||||||
# @param overwrite boolean parameter for overwriting/not overwriting the file
|
# @param overwrite boolean parameter for overwriting/not overwriting the file
|
||||||
# @param meshPart a part of mesh (group, sub-mesh) to export instead of the mesh
|
# @param meshPart a part of mesh (group, sub-mesh) to export instead of the mesh
|
||||||
# @param autoDimension if @c True (default), a space dimension of a MED mesh can be either
|
# @param autoDimension if @c True (default), a space dimension of a MED mesh can be either
|
||||||
@ -1811,7 +1816,7 @@ class Mesh:
|
|||||||
# - 'f' stands for "_faces _" field;
|
# - 'f' stands for "_faces _" field;
|
||||||
# - 's' stands for "_solids _" field.
|
# - 's' stands for "_solids _" field.
|
||||||
# @ingroup l2_impexp
|
# @ingroup l2_impexp
|
||||||
def ExportMED(self, f, auto_groups=0, version=MED_V2_2,
|
def ExportMED(self, f, auto_groups=0, version=MED_LATEST,
|
||||||
overwrite=1, meshPart=None, autoDimension=True, fields=[], geomAssocFields=''):
|
overwrite=1, meshPart=None, autoDimension=True, fields=[], geomAssocFields=''):
|
||||||
if meshPart or fields or geomAssocFields:
|
if meshPart or fields or geomAssocFields:
|
||||||
unRegister = genObjUnRegister()
|
unRegister = genObjUnRegister()
|
||||||
@ -1915,9 +1920,14 @@ class Mesh:
|
|||||||
# Export the mesh in a file in MED format
|
# Export the mesh in a file in MED format
|
||||||
# allowing to overwrite the file if it exists or add the exported data to its contents
|
# allowing to overwrite the file if it exists or add the exported data to its contents
|
||||||
# @param f the file name
|
# @param f the file name
|
||||||
# @param version MED format version (MED_V2_1 or MED_V2_2,
|
# @param version MED format version:
|
||||||
# the latter meaning any current version). The parameter is
|
# - MED_V2_1 is obsolete.
|
||||||
# obsolete since MED_V2_1 is no longer supported.
|
# - MED_V2_2 means current version (kept for compatibility reasons)
|
||||||
|
# - MED_LATEST means current version.
|
||||||
|
# - MED_MINOR_x where x from 0 to 9 indicates the minor version of MED
|
||||||
|
# to use for writing MED files, for backward compatibility :
|
||||||
|
# for instance, with SALOME 8.4 use MED 3.2 (minor=2) instead of 3.3,
|
||||||
|
# to allow the file to be read with SALOME 8.3.
|
||||||
# @param opt boolean parameter for creating/not creating
|
# @param opt boolean parameter for creating/not creating
|
||||||
# the groups Group_On_All_Nodes, Group_On_All_Faces, ...
|
# the groups Group_On_All_Nodes, Group_On_All_Faces, ...
|
||||||
# @param overwrite boolean parameter for overwriting/not overwriting the file
|
# @param overwrite boolean parameter for overwriting/not overwriting the file
|
||||||
@ -1927,7 +1937,7 @@ class Mesh:
|
|||||||
# - 3D in the rest cases.<br>
|
# - 3D in the rest cases.<br>
|
||||||
# If @a autoDimension is @c False, the space dimension is always 3.
|
# If @a autoDimension is @c False, the space dimension is always 3.
|
||||||
# @ingroup l2_impexp
|
# @ingroup l2_impexp
|
||||||
def ExportToMED(self, f, version=MED_V2_2, opt=0, overwrite=1, autoDimension=True):
|
def ExportToMED(self, f, version=MED_LATEST, opt=0, overwrite=1, autoDimension=True):
|
||||||
self.mesh.ExportToMEDX(f, opt, version, overwrite, autoDimension)
|
self.mesh.ExportToMEDX(f, opt, version, overwrite, autoDimension)
|
||||||
|
|
||||||
# Operations with groups:
|
# Operations with groups:
|
||||||
|
Loading…
Reference in New Issue
Block a user