mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-11-11 16:19:16 +05:00
bos #26432 [CEA 26431] import/export SAUV removal
This commit is contained in:
parent
890187d6e1
commit
063116fae2
@ -23,7 +23,7 @@ Mesh module provides several ways to create the mesh:
|
||||
|
||||
* Bottom-up way, using :ref:`mesh modification <modifying_meshes_page>` operations, especially :ref:`extrusion <extrusion_page>` and :ref:`revolution <revolution_page>`. To create an empty mesh not based on geometry, use the same dialog as to :ref:`construct the mesh on geometry <constructing_meshes_page>` but specify neither the geometry nor meshing algorithms.
|
||||
|
||||
* The mesh can be :ref:`imported <importing_exporting_meshes_page>` from (and exported to) the file in MED, UNV, STL, CGNS, DAT, GMF and SAUVE formats.
|
||||
* The mesh can be :ref:`imported <importing_exporting_meshes_page>` from (and exported to) the file in MED, UNV, STL, CGNS, DAT and GMF formats.
|
||||
|
||||
* The 3D mesh can be generated from the 2D mesh not based on geometry, which was either :ref:`imported <importing_exporting_meshes_page>` or created in other way. To setup the meshing parameters of a mesh not based on geometry, just invoke :ref:`Edit mesh / sub-mesh <editing_meshes_page>` command on your 2D mesh.
|
||||
|
||||
|
@ -8,7 +8,6 @@ Importing and exporting meshes
|
||||
In MESH there is a functionality allowing import/export of meshes in the following formats:
|
||||
|
||||
* **MED**,
|
||||
* **SAUV** (format of the CASTEM code),
|
||||
* **UNV** (I-DEAS 10),
|
||||
* **STL**,
|
||||
* **CGNS**,
|
||||
@ -45,7 +44,7 @@ If you try to export a group, the warning will be shown:
|
||||
|
||||
Only MED format supports all types of elements that can be created in the module. If you export a mesh or group that includes elements of types that are not supported by chosen format, you will be warned about that.
|
||||
|
||||
There are additional parameters available at export to MED and SAUV format files.
|
||||
There are additional parameters available at export to MED format files.
|
||||
|
||||
.. _export_auto_groups:
|
||||
|
||||
|
@ -25,13 +25,11 @@ Importing and exporting meshes
|
||||
smeshBuilder.CreateMeshesFromSTL
|
||||
smeshBuilder.CreateMeshesFromCGNS
|
||||
smeshBuilder.CreateMeshesFromGMF
|
||||
smeshBuilder.CreateMeshesFromSAUV
|
||||
Mesh.ExportMED
|
||||
Mesh.ExportUNV
|
||||
Mesh.ExportSTL
|
||||
Mesh.ExportCGNS
|
||||
Mesh.ExportDAT
|
||||
Mesh.ExportSAUV
|
||||
Mesh.ExportGMF
|
||||
|
||||
|
||||
|
@ -253,16 +253,9 @@ module SMESH
|
||||
/*!
|
||||
* Create Mesh object(s) importing data from given MED file
|
||||
*/
|
||||
mesh_array CreateMeshesFromMED( in string theFileName,
|
||||
out SMESH::DriverMED_ReadStatus theStatus )
|
||||
raises ( SALOME::SALOME_Exception );
|
||||
|
||||
/*!
|
||||
* Create Mesh object(s) importing data from given MED file
|
||||
*/
|
||||
mesh_array CreateMeshesFromSAUV( in string theFileName,
|
||||
out SMESH::DriverMED_ReadStatus theStatus )
|
||||
raises ( SALOME::SALOME_Exception );
|
||||
mesh_array CreateMeshesFromMED( in string theFileName,
|
||||
out SMESH::DriverMED_ReadStatus theStatus )
|
||||
raises ( SALOME::SALOME_Exception );
|
||||
|
||||
/*!
|
||||
* Create Mesh object importing data from given STL file
|
||||
|
@ -714,18 +714,11 @@ module SMESH
|
||||
in double ZTolerance,
|
||||
in boolean saveNumbers) raises (SALOME::SALOME_Exception);
|
||||
|
||||
/*!
|
||||
* Export Mesh to SAUV formatted file
|
||||
* Write a temporary med file and use med2sauv
|
||||
*/
|
||||
void ExportSAUV( in string file, in boolean auto_groups )
|
||||
raises (SALOME::SALOME_Exception);
|
||||
|
||||
/*!
|
||||
* Return string representation of a MED file version comprising nbDigits
|
||||
*/
|
||||
string GetVersionString(in long minor, in short nbDigits);
|
||||
|
||||
|
||||
/*!
|
||||
* Return the list of med versions compatibles for write/append,
|
||||
* encoded in 10*major+minor (for instance, code for med 3.2.1 is 32)
|
||||
|
@ -166,21 +166,6 @@ void DriverMED_W_SMESHDS_Mesh::AddGroupOfBalls()
|
||||
myDoGroupOfBalls = true;
|
||||
}
|
||||
|
||||
//================================================================================
|
||||
/*!
|
||||
* \brief Set up a flag to add all elements not belonging to any group to
|
||||
* some auxiliary group. This is needed for SMESH -> SAUVE -> SMESH conversion,
|
||||
* which since PAL0023285 reads only SAUVE elements belonging to any group,
|
||||
* and hence can lose some elements. That auxiliary group is ignored while
|
||||
* reading a MED file.
|
||||
*/
|
||||
//================================================================================
|
||||
|
||||
void DriverMED_W_SMESHDS_Mesh::AddAllToGroup()
|
||||
{
|
||||
myDoAllInGroups = true;
|
||||
}
|
||||
|
||||
|
||||
namespace
|
||||
{
|
||||
|
@ -64,7 +64,6 @@ class MESHDRIVERMED_EXPORT DriverMED_W_SMESHDS_Mesh: public Driver_SMESHDS_Mesh
|
||||
void AddGroupOfVolumes();
|
||||
void AddGroupOf0DElems();
|
||||
void AddGroupOfBalls();
|
||||
void AddAllToGroup();
|
||||
|
||||
/*! functions to prepare adding one mesh
|
||||
*/
|
||||
|
@ -1416,8 +1416,7 @@ void SMESH_Mesh::exportMEDCommmon(DriverMED_W_SMESHDS_Mesh& theWriter,
|
||||
bool theAutoDimension,
|
||||
bool theAddODOnVertices,
|
||||
double theZTolerance,
|
||||
bool theSaveNumbers,
|
||||
bool theAllElemsToGroup)
|
||||
bool theSaveNumbers)
|
||||
{
|
||||
Driver_Mesh::Status status = Driver_Mesh::DRS_OK;
|
||||
|
||||
@ -1443,8 +1442,6 @@ void SMESH_Mesh::exportMEDCommmon(DriverMED_W_SMESHDS_Mesh& theWriter,
|
||||
theWriter.AddGroupOf0DElems();
|
||||
theWriter.AddGroupOfBalls();
|
||||
}
|
||||
if ( theAllElemsToGroup )
|
||||
theWriter.AddAllToGroup();
|
||||
|
||||
// Pass groups to writer. Provide unique group names.
|
||||
//set<string> aGroupNames; // Corrected for Mantis issue 0020028
|
||||
@ -1499,8 +1496,7 @@ SMESH_Mesh::ExportMEDCoupling(const char* theMeshName,
|
||||
{
|
||||
DriverMED_W_SMESHDS_Mesh_Mem writer;
|
||||
this->exportMEDCommmon( writer, theMeshName, theAutoGroups, theMeshPart, theAutoDimension,
|
||||
theAddODOnVertices, theZTolerance, theSaveNumbers,
|
||||
/*AllElemsToGroup(for ExportSAUV())=*/false);
|
||||
theAddODOnVertices, theZTolerance, theSaveNumbers);
|
||||
return writer.getData();
|
||||
}
|
||||
|
||||
@ -1525,8 +1521,6 @@ SMESH_Mesh::ExportMEDCoupling(const char* theMeshName,
|
||||
* within a given tolerance, the coordinate is set to zero.
|
||||
* If \a ZTolerance is negative, the node coordinates are kept as is.
|
||||
* \param [in] theSaveNumbers : enable saving numbers of nodes and cells.
|
||||
* \param [in] theAllElemsToGroup - to make every element to belong to any group (PAL23413).
|
||||
* It is used by ExportSAUV() only
|
||||
* \return int - mesh index in the file
|
||||
*/
|
||||
//================================================================================
|
||||
@ -1539,65 +1533,12 @@ void SMESH_Mesh::ExportMED(const char * theFile,
|
||||
bool theAutoDimension,
|
||||
bool theAddODOnVertices,
|
||||
double theZTolerance,
|
||||
bool theSaveNumbers,
|
||||
bool theAllElemsToGroup)
|
||||
bool theSaveNumbers)
|
||||
{
|
||||
MESSAGE("MED_VERSION:"<< theVersion);
|
||||
DriverMED_W_SMESHDS_Mesh writer;
|
||||
writer.SetFile( theFile, theVersion );
|
||||
this->exportMEDCommmon( writer, theMeshName, theAutoGroups, theMeshPart, theAutoDimension, theAddODOnVertices, theZTolerance, theSaveNumbers, theAllElemsToGroup );
|
||||
}
|
||||
|
||||
//================================================================================
|
||||
/*!
|
||||
* \brief Export the mesh to a SAUV file
|
||||
*/
|
||||
//================================================================================
|
||||
|
||||
void SMESH_Mesh::ExportSAUV(const char *theFile,
|
||||
const char* theMeshName,
|
||||
bool theAutoGroups)
|
||||
{
|
||||
std::string medfilename( theFile );
|
||||
medfilename += ".med";
|
||||
std::string cmd;
|
||||
#ifdef WIN32
|
||||
cmd = "%PYTHONBIN% ";
|
||||
#else
|
||||
cmd = "python3 ";
|
||||
#endif
|
||||
cmd += "-c \"";
|
||||
cmd += "from medutilities import my_remove ; my_remove(r'" + medfilename + "')";
|
||||
cmd += "\"";
|
||||
system(cmd.c_str());
|
||||
try {
|
||||
ExportMED( medfilename.c_str(), theMeshName, theAutoGroups, /*minor=*/-1,
|
||||
/*meshPart=*/NULL, /*theAutoDimension=*/false, /*theAddODOnVertices=*/false,
|
||||
/*zTol=*/-1, /*theSaveNumbers=*/false,
|
||||
/*theAllElemsToGroup=*/true ); // theAllElemsToGroup is for PAL0023413
|
||||
}
|
||||
catch ( TooLargeForExport )
|
||||
{
|
||||
throw TooLargeForExport("SAUV");
|
||||
}
|
||||
#ifdef WIN32
|
||||
cmd = "%PYTHONBIN% ";
|
||||
#else
|
||||
cmd = "python3 ";
|
||||
#endif
|
||||
cmd += "-c \"";
|
||||
cmd += "from medutilities import convert ; convert(r'" + medfilename + "', 'MED', 'GIBI', 1, r'" + theFile + "')";
|
||||
cmd += "\"";
|
||||
system(cmd.c_str());
|
||||
#ifdef WIN32
|
||||
cmd = "%PYTHONBIN% ";
|
||||
#else
|
||||
cmd = "python3 ";
|
||||
#endif
|
||||
cmd += "-c \"";
|
||||
cmd += "from medutilities import my_remove ; my_remove(r'" + medfilename + "')";
|
||||
cmd += "\"";
|
||||
system(cmd.c_str());
|
||||
this->exportMEDCommmon( writer, theMeshName, theAutoGroups, theMeshPart, theAutoDimension, theAddODOnVertices, theZTolerance, theSaveNumbers );
|
||||
}
|
||||
|
||||
//================================================================================
|
||||
|
@ -282,8 +282,7 @@ class SMESH_EXPORT SMESH_Mesh
|
||||
bool theAutoDimension = false,
|
||||
bool theAddODOnVertices = false,
|
||||
double theZTolerance = -1.,
|
||||
bool theSaveNumbers = true,
|
||||
bool theAllElemsToGroup = false);
|
||||
bool theSaveNumbers = true);
|
||||
|
||||
void ExportDAT(const char * file,
|
||||
const SMESHDS_Mesh* meshPart = 0,
|
||||
@ -302,9 +301,6 @@ class SMESH_EXPORT SMESH_Mesh
|
||||
void ExportGMF(const char * file,
|
||||
const SMESHDS_Mesh* mesh,
|
||||
bool withRequiredGroups = true );
|
||||
void ExportSAUV(const char *file,
|
||||
const char* theMeshName = NULL,
|
||||
bool theAutoGroups = true);
|
||||
|
||||
double GetComputeProgress() const;
|
||||
|
||||
@ -395,8 +391,7 @@ private:
|
||||
bool theAutoDimension,
|
||||
bool theAddODOnVertices,
|
||||
double theZTolerance,
|
||||
bool theSaveNumbers,
|
||||
bool theAllElemsToGroup);
|
||||
bool theSaveNumbers);
|
||||
|
||||
private:
|
||||
void fillAncestorsMap(const TopoDS_Shape& theShape);
|
||||
|
@ -239,11 +239,6 @@ namespace
|
||||
theCommandID == SMESHOp::OpPopupImportCGNS ) {
|
||||
filter.append( QObject::tr( "CGNS_FILES_FILTER" ) + " (*.cgns)" );
|
||||
}
|
||||
else if ( theCommandID == SMESHOp::OpImportSAUV ||
|
||||
theCommandID == SMESHOp::OpPopupImportSAUV ) {
|
||||
filter.append( QObject::tr( "SAUV_FILES_FILTER" ) + " (*.sauv *.sauve)" );
|
||||
filter.append( QObject::tr( "ALL_FILES_FILTER" ) + " (*)" );
|
||||
}
|
||||
else if ( theCommandID == SMESHOp::OpImportGMF ||
|
||||
theCommandID == SMESHOp::OpPopupImportGMF ) {
|
||||
filter.append( QObject::tr( "GMF_ASCII_FILES_FILTER" ) + " (*.mesh)" );
|
||||
@ -345,18 +340,6 @@ namespace
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SMESHOp::OpImportSAUV:
|
||||
case SMESHOp::OpPopupImportSAUV:
|
||||
{
|
||||
// SAUV format
|
||||
SMESH::DriverMED_ReadStatus res;
|
||||
aMeshes = theComponentMesh->CreateMeshesFromSAUV( filename.toUtf8().constData(), res );
|
||||
if ( res != SMESH::DRS_OK ) {
|
||||
errors.append( QString( "%1 :\n\t%2" ).arg( filename ).
|
||||
arg( QObject::tr( QString( "SMESH_DRS_%1" ).arg( res ).toLatin1().data() ) ) );
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SMESHOp::OpImportGMF:
|
||||
case SMESHOp::OpPopupImportGMF:
|
||||
{
|
||||
@ -448,8 +431,6 @@ namespace
|
||||
theCommandID == SMESHOp::OpPopupExportSTL );
|
||||
const bool isCGNS= ( theCommandID == SMESHOp::OpExportCGNS ||
|
||||
theCommandID == SMESHOp::OpPopupExportCGNS );
|
||||
const bool isSAUV= ( theCommandID == SMESHOp::OpExportSAUV ||
|
||||
theCommandID == SMESHOp::OpPopupExportSAUV );
|
||||
const bool isGMF = ( theCommandID == SMESHOp::OpExportGMF ||
|
||||
theCommandID == SMESHOp::OpPopupExportGMF );
|
||||
|
||||
@ -529,7 +510,7 @@ namespace
|
||||
SMESH::SMESH_Mesh_var aMesh = aMeshOrGroup->GetMesh();
|
||||
QString aMeshName = (*aMeshIter).second;
|
||||
|
||||
if ( isMED || isCGNS || isSAUV ) // formats where group names must be unique
|
||||
if ( isMED || isCGNS ) // formats where group names must be unique
|
||||
{
|
||||
// check for equal group names within each mesh
|
||||
for( aMeshIter = aMeshList.begin(); aMeshIter != aMeshList.end(); aMeshIter++ ) {
|
||||
@ -581,18 +562,6 @@ namespace
|
||||
format = "CGNS";
|
||||
notSupportedElemTypes.push_back( SMESH::Entity_Ball );
|
||||
}
|
||||
else if ( isSAUV )
|
||||
{
|
||||
format = "SAUV";
|
||||
notSupportedElemTypes.push_back( SMESH::Entity_Ball );
|
||||
notSupportedElemTypes.push_back( SMESH::Entity_BiQuad_Triangle );
|
||||
notSupportedElemTypes.push_back( SMESH::Entity_BiQuad_Quadrangle );
|
||||
notSupportedElemTypes.push_back( SMESH::Entity_TriQuad_Hexa );
|
||||
notSupportedElemTypes.push_back( SMESH::Entity_Hexagonal_Prism );
|
||||
notSupportedElemTypes.push_back( SMESH::Entity_Polygon );
|
||||
notSupportedElemTypes.push_back( SMESH::Entity_Quad_Polygon );
|
||||
notSupportedElemTypes.push_back( SMESH::Entity_Polyhedra );
|
||||
}
|
||||
else if ( isGMF )
|
||||
{
|
||||
format = "GMF";
|
||||
@ -741,26 +710,19 @@ namespace
|
||||
}
|
||||
delete fd;
|
||||
}
|
||||
else if ( isMED || isSAUV ) // Export to MED or SAUV
|
||||
else if ( isMED ) // Export to MED
|
||||
{
|
||||
int defaultVersion = 0;
|
||||
QMap<QString, int> aFilterMap;
|
||||
if ( isMED ) {
|
||||
//filters << QObject::tr( "MED_FILES_FILTER" ) + " (*.med)";
|
||||
//QString vmed (aMesh->GetVersionString(-1, 2));
|
||||
SMESH::long_array_var mvok = aMesh->GetMEDVersionsCompatibleForAppend();
|
||||
if ( mvok->length() > 0)
|
||||
defaultVersion = mvok[0]; // the current version to set the default filter on it
|
||||
for ( CORBA::ULong i = 0; i < mvok->length(); ++i )
|
||||
{
|
||||
QString vs = (char*)( SMESH_Comment( mvok[i]/10 ) << "." << mvok[i]%10 );
|
||||
aFilterMap.insert( QObject::tr( "MED_VX_FILES_FILTER" ).arg( vs ) + " (*.med)", mvok[i]);
|
||||
}
|
||||
}
|
||||
else { // isSAUV
|
||||
aFilterMap.insert("All files (*)", -1 );
|
||||
aFilterMap.insert("SAUV files (*.sauv)", defaultVersion ); // 0 = default filter (defaultVersion)
|
||||
aFilterMap.insert("SAUV files (*.sauve)", -1 );
|
||||
//filters << QObject::tr( "MED_FILES_FILTER" ) + " (*.med)";
|
||||
//QString vmed (aMesh->GetVersionString(-1, 2));
|
||||
SMESH::long_array_var mvok = aMesh->GetMEDVersionsCompatibleForAppend();
|
||||
if ( mvok->length() > 0)
|
||||
defaultVersion = mvok[0]; // the current version to set the default filter on it
|
||||
for ( CORBA::ULong i = 0; i < mvok->length(); ++i )
|
||||
{
|
||||
QString vs = (char*)( SMESH_Comment( mvok[i]/10 ) << "." << mvok[i]%10 );
|
||||
aFilterMap.insert( QObject::tr( "MED_VX_FILES_FILTER" ).arg( vs ) + " (*.med)", mvok[i]);
|
||||
}
|
||||
QStringList filters;
|
||||
QMap<QString, int>::const_iterator it = aFilterMap.begin();
|
||||
@ -946,15 +908,6 @@ namespace
|
||||
fields, geoAssFields.toLatin1().data(), zTol, saveNumbers );
|
||||
}
|
||||
}
|
||||
else if ( isSAUV )
|
||||
{
|
||||
for( aMeshIter = aMeshList.begin(); aMeshIter != aMeshList.end(); aMeshIter++ )
|
||||
{
|
||||
SMESH::SMESH_Mesh_var aMeshItem = SMESH::SMESH_Mesh::_narrow( (*aMeshIter).first );
|
||||
if( !aMeshItem->_is_nil() )
|
||||
aMeshItem->ExportSAUV( aFilename.toUtf8().data(), toCreateGroups );
|
||||
}
|
||||
}
|
||||
else if ( isDAT )
|
||||
{
|
||||
if ( aMeshOrGroup->_is_equivalent( aMesh ))
|
||||
@ -2599,14 +2552,12 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
||||
case SMESHOp::OpImportMED:
|
||||
case SMESHOp::OpImportSTL:
|
||||
case SMESHOp::OpImportCGNS:
|
||||
case SMESHOp::OpImportSAUV:
|
||||
case SMESHOp::OpImportGMF:
|
||||
case SMESHOp::OpPopupImportDAT:
|
||||
case SMESHOp::OpPopupImportUNV:
|
||||
case SMESHOp::OpPopupImportMED:
|
||||
case SMESHOp::OpPopupImportSTL:
|
||||
case SMESHOp::OpPopupImportCGNS:
|
||||
case SMESHOp::OpPopupImportSAUV:
|
||||
case SMESHOp::OpPopupImportGMF:
|
||||
{
|
||||
if(isStudyLocked()) break;
|
||||
@ -2637,14 +2588,12 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
||||
case SMESHOp::OpExportUNV:
|
||||
case SMESHOp::OpExportSTL:
|
||||
case SMESHOp::OpExportCGNS:
|
||||
case SMESHOp::OpExportSAUV:
|
||||
case SMESHOp::OpExportGMF:
|
||||
case SMESHOp::OpPopupExportDAT:
|
||||
case SMESHOp::OpPopupExportMED:
|
||||
case SMESHOp::OpPopupExportUNV:
|
||||
case SMESHOp::OpPopupExportSTL:
|
||||
case SMESHOp::OpPopupExportCGNS:
|
||||
case SMESHOp::OpPopupExportSAUV:
|
||||
case SMESHOp::OpPopupExportGMF:
|
||||
{
|
||||
::ExportMeshToFile(theCommandID);
|
||||
@ -4114,7 +4063,6 @@ void SMESHGUI::initialize( CAM_Application* app )
|
||||
#ifdef WITH_CGNS
|
||||
createSMESHAction( SMESHOp::OpImportCGNS, "IMPORT_CGNS" );
|
||||
#endif
|
||||
createSMESHAction( SMESHOp::OpImportSAUV, "IMPORT_SAUV" );
|
||||
createSMESHAction( SMESHOp::OpImportGMF, "IMPORT_GMF" );
|
||||
createSMESHAction( SMESHOp::OpPopupImportUNV, "IMPORT_UNV");
|
||||
createSMESHAction( SMESHOp::OpPopupImportMED, "IMPORT_MED");
|
||||
@ -4122,7 +4070,6 @@ void SMESHGUI::initialize( CAM_Application* app )
|
||||
#ifdef WITH_CGNS
|
||||
createSMESHAction( SMESHOp::OpPopupImportCGNS, "IMPORT_CGNS" );
|
||||
#endif
|
||||
createSMESHAction( SMESHOp::OpPopupImportSAUV, "IMPORT_SAUV" );
|
||||
createSMESHAction( SMESHOp::OpPopupImportGMF, "IMPORT_GMF" );
|
||||
|
||||
createSMESHAction( SMESHOp::OpExportDAT, "DAT" );
|
||||
@ -4132,7 +4079,6 @@ void SMESHGUI::initialize( CAM_Application* app )
|
||||
#ifdef WITH_CGNS
|
||||
createSMESHAction( SMESHOp::OpExportCGNS, "CGNS");
|
||||
#endif
|
||||
createSMESHAction( SMESHOp::OpExportSAUV, "SAUV");
|
||||
createSMESHAction( SMESHOp::OpExportGMF, "GMF" );
|
||||
createSMESHAction( SMESHOp::OpPopupExportDAT, "DAT" );
|
||||
createSMESHAction( SMESHOp::OpPopupExportMED, "MED" );
|
||||
@ -4141,7 +4087,6 @@ void SMESHGUI::initialize( CAM_Application* app )
|
||||
#ifdef WITH_CGNS
|
||||
createSMESHAction( SMESHOp::OpPopupExportCGNS, "CGNS");
|
||||
#endif
|
||||
createSMESHAction( SMESHOp::OpPopupExportSAUV, "SAUV");
|
||||
createSMESHAction( SMESHOp::OpPopupExportGMF, "GMF" );
|
||||
createSMESHAction( SMESHOp::OpFileInformation, "FILE_INFO" );
|
||||
createSMESHAction( SMESHOp::OpDelete, "DELETE", "ICON_DELETE", Qt::Key_Delete );
|
||||
@ -4380,7 +4325,6 @@ void SMESHGUI::initialize( CAM_Application* app )
|
||||
#ifdef WITH_CGNS
|
||||
createMenu( SMESHOp::OpImportCGNS, importId, -1 );
|
||||
#endif
|
||||
createMenu( SMESHOp::OpImportSAUV, importId, -1 );
|
||||
createMenu( SMESHOp::OpImportGMF, importId, -1 );
|
||||
createMenu( SMESHOp::OpExportDAT, exportId, -1 );
|
||||
createMenu( SMESHOp::OpExportMED, exportId, -1 );
|
||||
@ -4389,7 +4333,6 @@ void SMESHGUI::initialize( CAM_Application* app )
|
||||
#ifdef WITH_CGNS
|
||||
createMenu( SMESHOp::OpExportCGNS, exportId, -1 );
|
||||
#endif
|
||||
createMenu( SMESHOp::OpExportSAUV, exportId, -1 );
|
||||
createMenu( SMESHOp::OpExportGMF, exportId, -1 );
|
||||
createMenu( separator(), fileId, 10 );
|
||||
|
||||
@ -4782,7 +4725,6 @@ void SMESHGUI::initialize( CAM_Application* app )
|
||||
#ifdef WITH_CGNS
|
||||
createPopupItem( SMESHOp::OpPopupExportCGNS, OB, mesh_group, multiple_non_empty, anId );
|
||||
#endif
|
||||
createPopupItem( SMESHOp::OpPopupExportSAUV, OB, mesh_group, only_one_non_empty, anId );
|
||||
createPopupItem( SMESHOp::OpPopupExportGMF, OB, mesh_group, only_one_non_empty, anId );
|
||||
createPopupItem( SMESHOp::OpPopupExportDAT, OB, mesh_group, only_one_non_empty, anId );
|
||||
|
||||
@ -4793,7 +4735,6 @@ void SMESHGUI::initialize( CAM_Application* app )
|
||||
#ifdef WITH_CGNS
|
||||
createPopupItem( SMESHOp::OpPopupImportCGNS, OB, smesh, "", anId );
|
||||
#endif
|
||||
createPopupItem( SMESHOp::OpPopupImportSAUV, OB, smesh, "", anId );
|
||||
createPopupItem( SMESHOp::OpPopupImportGMF, OB, smesh, "", anId );
|
||||
createPopupItem( SMESHOp::OpPopupImportDAT, OB, smesh, "", anId );
|
||||
popupMgr()->insert( separator(), -1, 0 );
|
||||
@ -5201,7 +5142,6 @@ bool SMESHGUI::activateModule( SUIT_Study* study )
|
||||
<< wrap("MED", "li")
|
||||
<< wrap("STL", "li")
|
||||
<< wrap("CGNS", "li")
|
||||
<< wrap("SAUV", "li")
|
||||
<< wrap("GMF", "li");
|
||||
lab = tr("INFO_AVAILABLE_FORMATS") + ":" + wrap(items.join(""), "ul");
|
||||
items.clear();
|
||||
|
@ -40,14 +40,12 @@ namespace SMESHOp {
|
||||
OpImportMED = 1102, // MENU FILE - IMPORT - MED FILE
|
||||
OpImportSTL = 1103, // MENU FILE - IMPORT - STL FILE
|
||||
OpImportCGNS = 1104, // MENU FILE - IMPORT - CGNS FILE
|
||||
OpImportSAUV = 1105, // MENU FILE - IMPORT - SAUV FILE
|
||||
OpImportGMF = 1106, // MENU FILE - IMPORT - GMF FILE
|
||||
OpPopupImportDAT = 1120, // POPUP MENU - IMPORT - DAT FILE
|
||||
OpPopupImportUNV = 1121, // POPUP MENU - IMPORT - UNV FILE
|
||||
OpPopupImportMED = 1122, // POPUP MENU - IMPORT - MED FILE
|
||||
OpPopupImportSTL = 1123, // POPUP MENU - IMPORT - STL FILE
|
||||
OpPopupImportCGNS = 1124, // POPUP MENU - IMPORT - CGNS FILE
|
||||
OpPopupImportSAUV = 1125, // POPUP MENU - IMPORT - SAUV FILE
|
||||
OpPopupImportGMF = 1126, // POPUP MENU - IMPORT - GMF FILE
|
||||
// Export -------------------------//--------------------------------
|
||||
OpExportDAT = 1200, // MENU FILE - EXPORT - DAT FILE
|
||||
@ -55,14 +53,12 @@ namespace SMESHOp {
|
||||
OpExportUNV = 1202, // MENU FILE - EXPORT - UNV FILE
|
||||
OpExportSTL = 1203, // MENU FILE - EXPORT - STL FILE
|
||||
OpExportCGNS = 1204, // MENU FILE - EXPORT - CGNS FILE
|
||||
OpExportSAUV = 1205, // MENU FILE - EXPORT - SAUV FILE
|
||||
OpExportGMF = 1206, // MENU FILE - EXPORT - GMF FILE
|
||||
OpPopupExportDAT = 1210, // POPUP MENU - EXPORT - DAT FILE
|
||||
OpPopupExportMED = 1211, // POPUP MENU - EXPORT - MED FILE
|
||||
OpPopupExportUNV = 1212, // POPUP MENU - EXPORT - UNV FILE
|
||||
OpPopupExportSTL = 1213, // POPUP MENU - EXPORT - STL FILE
|
||||
OpPopupExportCGNS = 1214, // POPUP MENU - EXPORT - CGNS FILE
|
||||
OpPopupExportSAUV = 1215, // POPUP MENU - EXPORT - SAUV FILE
|
||||
OpPopupExportGMF = 1216, // POPUP MENU - EXPORT - GMF FILE
|
||||
// Mesh ---------------------------//--------------------------------
|
||||
OpCreateMesh = 2030, // MENU MESH - CREATE MESH
|
||||
|
@ -11,10 +11,6 @@
|
||||
<source>MED_FILES_FILTER</source>
|
||||
<translation>MED files</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>SAUV_FILES_FILTER</source>
|
||||
<translation>SAUV files</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>IDEAS_FILES_FILTER</source>
|
||||
<translation>IDEAS files</translation>
|
||||
@ -648,10 +644,6 @@
|
||||
<source>MEN_EXPORT_GMF</source>
|
||||
<translation>Export to GMF file</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>MEN_EXPORT_SAUV</source>
|
||||
<translation>Export to SAUV file</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>MEN_EXPORT_STL</source>
|
||||
<translation>Export to STL file</translation>
|
||||
@ -876,14 +868,6 @@
|
||||
<source>MEN_GMF</source>
|
||||
<translation>GMF file</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>MEN_IMPORT_SAUV</source>
|
||||
<translation>SAUV file</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>MEN_SAUV</source>
|
||||
<translation>SAUV file</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>MEN_MERGE</source>
|
||||
<translation>Merge Nodes</translation>
|
||||
@ -3464,10 +3448,6 @@ Use Display Entity menu command to show them.
|
||||
<source>STB_EXPORT_GMF</source>
|
||||
<translation>Export to GMF file</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>STB_EXPORT_SAUV</source>
|
||||
<translation>Export to SAUV file</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>STB_EXPORT_STL</source>
|
||||
<translation>Export to STL file</translation>
|
||||
@ -3600,14 +3580,6 @@ Use Display Entity menu command to show them.
|
||||
<source>STB_GMF</source>
|
||||
<translation>Export GMF file</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>STB_IMPORT_SAUV</source>
|
||||
<translation>Import SAUV file</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>STB_SAUV</source>
|
||||
<translation>Export SAUV file</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>STB_MERGE</source>
|
||||
<translation>Merge nodes</translation>
|
||||
@ -4164,10 +4136,6 @@ Use Display Entity menu command to show them.
|
||||
<source>TOP_EXPORT_MED</source>
|
||||
<translation>Export to MED file</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>TOP_EXPORT_SAUV</source>
|
||||
<translation>Export to SAUV file</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>TOP_EXPORT_STL</source>
|
||||
<translation>Export to STL file</translation>
|
||||
@ -4300,14 +4268,6 @@ Use Display Entity menu command to show them.
|
||||
<source>TOP_GMF</source>
|
||||
<translation>Export GMF file</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>TOP_IMPORT_SAUV</source>
|
||||
<translation>Import SAUV file</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>TOP_SAUV</source>
|
||||
<translation>Export SAUV file</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>TOP_MERGE</source>
|
||||
<translation>Merge nodes</translation>
|
||||
|
@ -11,10 +11,6 @@
|
||||
<source>MED_FILES_FILTER</source>
|
||||
<translation>Fichiers MED</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>SAUV_FILES_FILTER</source>
|
||||
<translation>Fichiers SAUV</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>IDEAS_FILES_FILTER</source>
|
||||
<translation>Fichiers IDEAS</translation>
|
||||
@ -648,10 +644,6 @@
|
||||
<source>MEN_EXPORT_GMF</source>
|
||||
<translation>Exporter au format GMF</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>MEN_EXPORT_SAUV</source>
|
||||
<translation>Exporter au format SAUV (ASCII)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>MEN_EXPORT_STL</source>
|
||||
<translation>Exporter au format STL</translation>
|
||||
@ -876,14 +868,6 @@
|
||||
<source>MEN_GMF</source>
|
||||
<translation>Fichier GMF</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>MEN_IMPORT_SAUV</source>
|
||||
<translation>Fichier SAUV (ASCII)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>MEN_SAUV</source>
|
||||
<translation>Fichier SAUV (ASCII)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>MEN_MERGE</source>
|
||||
<translation>Fusionner les nœuds</translation>
|
||||
@ -3451,10 +3435,6 @@ Utilisez le menu "Visualiser une entité" pour les afficher.
|
||||
<source>STB_EXPORT_GMF</source>
|
||||
<translation>Exporter au format GMF</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>STB_EXPORT_SAUV</source>
|
||||
<translation>Exporter au format SAUV (ASCII)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>STB_EXPORT_STL</source>
|
||||
<translation>Exporter au format STL</translation>
|
||||
@ -3587,14 +3567,6 @@ Utilisez le menu "Visualiser une entité" pour les afficher.
|
||||
<source>STB_GMF</source>
|
||||
<translation>Exporter un fichier GMF</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>STB_IMPORT_SAUV</source>
|
||||
<translation>Importer un fichier SAUV (ASCII)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>STB_SAUV</source>
|
||||
<translation>Exporter un fichier SAUV (ASCII)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>STB_MERGE</source>
|
||||
<translation>Fusionner les nœuds</translation>
|
||||
@ -4151,10 +4123,6 @@ Utilisez le menu "Visualiser une entité" pour les afficher.
|
||||
<source>TOP_EXPORT_MED</source>
|
||||
<translation>Exporter au format MED</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>TOP_EXPORT_SAUV</source>
|
||||
<translation>Exporter au format SAUV (ASCII)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>TOP_EXPORT_STL</source>
|
||||
<translation>Exporter au format STL</translation>
|
||||
@ -4287,14 +4255,6 @@ Utilisez le menu "Visualiser une entité" pour les afficher.
|
||||
<source>TOP_GMF</source>
|
||||
<translation>Exporter un fichier GMF</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>TOP_IMPORT_SAUV</source>
|
||||
<translation>Importer un fichier SAUV (ASCII)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>TOP_SAUV</source>
|
||||
<translation>Exporter un fichier SAUV (ASCII)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>TOP_MERGE</source>
|
||||
<translation>Fusionner les nœuds</translation>
|
||||
|
@ -11,10 +11,6 @@
|
||||
<source>MED_FILES_FILTER</source>
|
||||
<translation>MEDファイル</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>SAUV_FILES_FILTER</source>
|
||||
<translation>SAUVファイル</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>IDEAS_FILES_FILTER</source>
|
||||
<translation>IDEAS ファイル</translation>
|
||||
@ -503,10 +499,6 @@
|
||||
<source>MEN_EXPORT_GMF</source>
|
||||
<translation>GMF形式でエクスポート</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>MEN_EXPORT_SAUV</source>
|
||||
<translation>SAUV (ASCII) 形式でエクスポート</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>MEN_EXPORT_STL</source>
|
||||
<translation>STL形式でエクスポート</translation>
|
||||
@ -727,14 +719,6 @@
|
||||
<source>MEN_GMF</source>
|
||||
<translation>GMFファイル</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>MEN_IMPORT_SAUV</source>
|
||||
<translation>SAUVファイル</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>MEN_SAUV</source>
|
||||
<translation>SAUVファイル</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>MEN_MERGE</source>
|
||||
<translation>節点の結合</translation>
|
||||
@ -3147,10 +3131,6 @@
|
||||
<source>STB_EXPORT_GMF</source>
|
||||
<translation>組み換えをエクスポートします。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>STB_EXPORT_SAUV</source>
|
||||
<translation>SAUV (ASCII) 形式でエクスポート</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>STB_EXPORT_STL</source>
|
||||
<translation>STL形式でエクスポート</translation>
|
||||
@ -3279,14 +3259,6 @@
|
||||
<source>STB_GMF</source>
|
||||
<translation>組み換えファイルをエクスポートします。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>STB_IMPORT_SAUV</source>
|
||||
<translation>バックアップ (ASCII) ファイルをインポートします。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>STB_SAUV</source>
|
||||
<translation>バックアップ (ASCII) ファイルをエクスポートします。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>STB_MERGE</source>
|
||||
<translation>ノードを結合します。</translation>
|
||||
@ -3827,10 +3799,6 @@
|
||||
<source>TOP_EXPORT_MED</source>
|
||||
<translation>MED形式でエクスポート</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>TOP_EXPORT_SAUV</source>
|
||||
<translation>SAUV (ASCII) 形式でエクスポート</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>TOP_EXPORT_STL</source>
|
||||
<translation>STL形式でエクスポート</translation>
|
||||
@ -3959,14 +3927,6 @@
|
||||
<source>TOP_GMF</source>
|
||||
<translation>組み換えファイルをエクスポートします。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>TOP_IMPORT_SAUV</source>
|
||||
<translation>バックアップ (ASCII) ファイルをインポートします。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>TOP_SAUV</source>
|
||||
<translation>バックアップ (ASCII) ファイルをエクスポートします。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>TOP_MERGE</source>
|
||||
<translation>ノードを結合します。</translation>
|
||||
|
@ -1024,7 +1024,6 @@ void _pyGen::Process( const Handle(_pyCommand)& theCommand )
|
||||
return;
|
||||
}
|
||||
if ( method == "CreateMeshesFromMED" ||
|
||||
method == "CreateMeshesFromSAUV"||
|
||||
method == "CreateMeshesFromCGNS" ||
|
||||
method == "CreateMeshesFromGMF" ) // command result is ( [mesh1,mesh2], status )
|
||||
{
|
||||
@ -2194,7 +2193,7 @@ bool _pyMesh::NeedMeshAccess( const Handle(_pyCommand)& theCommand )
|
||||
static TStringSet sameMethods;
|
||||
if ( sameMethods.empty() ) {
|
||||
const char * names[] =
|
||||
{ "ExportDAT","ExportUNV","ExportSTL","ExportSAUV", "RemoveGroup","RemoveGroupWithContents",
|
||||
{ "ExportDAT","ExportUNV","ExportSTL", "RemoveGroup","RemoveGroupWithContents",
|
||||
"GetGroups","UnionGroups","IntersectGroups","CutGroups","CreateDimGroup","GetLog","GetId",
|
||||
"ClearLog","HasDuplicatedGroupNamesMED","GetMEDMesh","NbNodes","NbElements",
|
||||
"NbEdges","NbEdgesOfOrder","NbFaces","NbFacesOfOrder","NbTriangles",
|
||||
|
@ -1316,17 +1316,17 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::CreateMeshesFromUNV( const char* theFileName
|
||||
*/
|
||||
//=============================================================================
|
||||
|
||||
SMESH::mesh_array* SMESH_Gen_i::CreateMeshesFromMEDorSAUV( const char* theFileName,
|
||||
SMESH::DriverMED_ReadStatus& theStatus,
|
||||
const char* theCommandNameForPython,
|
||||
const char* theFileNameForPython)
|
||||
SMESH::mesh_array* SMESH_Gen_i::CreateMeshesFromMED( const char* theFileName,
|
||||
SMESH::DriverMED_ReadStatus& theStatus )
|
||||
{
|
||||
checkFileReadable( theFileName );
|
||||
|
||||
#ifdef WIN32
|
||||
char bname[ _MAX_FNAME ];
|
||||
_splitpath( theFileNameForPython, NULL, NULL, bname, NULL );
|
||||
_splitpath( theFileName, NULL, NULL, bname, NULL );
|
||||
string aFileName = bname;
|
||||
#else
|
||||
string aFileName = basename( const_cast<char *>(theFileNameForPython) );
|
||||
string aFileName = basename( const_cast<char *>( theFileName ));
|
||||
#endif
|
||||
// Retrieve mesh names from the file
|
||||
DriverMED_R_SMESHDS_Mesh myReader;
|
||||
@ -1339,59 +1339,57 @@ SMESH::mesh_array* SMESH_Gen_i::CreateMeshesFromMEDorSAUV( const char* theFileNa
|
||||
|
||||
{ // open a new scope to make aPythonDump die before PythonDump in SMESH_Mesh::GetGroups()
|
||||
|
||||
// Python Dump
|
||||
TPythonDump aPythonDump(this);
|
||||
aPythonDump << "([";
|
||||
// Python Dump
|
||||
TPythonDump aPythonDump(this);
|
||||
aPythonDump << "([";
|
||||
|
||||
if (theStatus == SMESH::DRS_OK) {
|
||||
SALOMEDS::StudyBuilder_var aStudyBuilder;
|
||||
aStudyBuilder = getStudyServant()->NewBuilder();
|
||||
aStudyBuilder->NewCommand(); // There is a transaction
|
||||
|
||||
aResult->length( aNames.size() );
|
||||
int i = 0;
|
||||
|
||||
// Iterate through all meshes and create mesh objects
|
||||
for ( list<string>::iterator it = aNames.begin(); it != aNames.end(); it++ )
|
||||
if (theStatus == SMESH::DRS_OK)
|
||||
{
|
||||
// Python Dump
|
||||
if (i > 0) aPythonDump << ", ";
|
||||
SALOMEDS::StudyBuilder_var aStudyBuilder;
|
||||
aStudyBuilder = getStudyServant()->NewBuilder();
|
||||
aStudyBuilder->NewCommand(); // There is a transaction
|
||||
|
||||
// create mesh
|
||||
SMESH::SMESH_Mesh_var mesh = createMesh();
|
||||
aResult->length( aNames.size() );
|
||||
int i = 0;
|
||||
|
||||
// publish mesh in the study
|
||||
SALOMEDS::SObject_wrap aSO;
|
||||
if ( CanPublishInStudy( mesh ) )
|
||||
// little trick: for MED file theFileName and theFileNameForPython are the same, but they are different for SAUV
|
||||
// - as names of meshes are stored in MED file, we use them for data publishing
|
||||
// - as mesh name is not stored in UNV file, we use file name as name of mesh when publishing data
|
||||
aSO = PublishMesh( mesh.in(), ( theFileName == theFileNameForPython ) ? (*it).c_str() : aFileName.c_str() );
|
||||
// Iterate through all meshes and create mesh objects
|
||||
for ( const std::string & meshName : aNames )
|
||||
{
|
||||
// Python Dump
|
||||
if (i > 0) aPythonDump << ", ";
|
||||
|
||||
// Python Dump
|
||||
if ( !aSO->_is_nil() ) {
|
||||
aPythonDump << aSO;
|
||||
} else {
|
||||
aPythonDump << "mesh_" << i;
|
||||
// create mesh
|
||||
SMESH::SMESH_Mesh_var mesh = createMesh();
|
||||
|
||||
// publish mesh in the study
|
||||
SALOMEDS::SObject_wrap aSO;
|
||||
if ( CanPublishInStudy( mesh ) )
|
||||
aSO = PublishMesh( mesh.in(), meshName.c_str() );
|
||||
|
||||
// Python Dump
|
||||
if ( !aSO->_is_nil() ) {
|
||||
aPythonDump << aSO;
|
||||
} else {
|
||||
aPythonDump << "mesh_" << i;
|
||||
}
|
||||
|
||||
// Read mesh data (groups are published automatically by ImportMEDFile())
|
||||
SMESH_Mesh_i* meshServant = dynamic_cast<SMESH_Mesh_i*>( GetServant( mesh ).in() );
|
||||
ASSERT( meshServant );
|
||||
SMESH::DriverMED_ReadStatus status1 =
|
||||
meshServant->ImportMEDFile( theFileName, meshName.c_str() );
|
||||
if (status1 > theStatus)
|
||||
theStatus = status1;
|
||||
|
||||
aResult[i++] = SMESH::SMESH_Mesh::_duplicate( mesh );
|
||||
meshServant->GetImpl().GetMeshDS()->Modified();
|
||||
}
|
||||
|
||||
// Read mesh data (groups are published automatically by ImportMEDFile())
|
||||
SMESH_Mesh_i* meshServant = dynamic_cast<SMESH_Mesh_i*>( GetServant( mesh ).in() );
|
||||
ASSERT( meshServant );
|
||||
SMESH::DriverMED_ReadStatus status1 =
|
||||
meshServant->ImportMEDFile( theFileName, (*it).c_str() );
|
||||
if (status1 > theStatus)
|
||||
theStatus = status1;
|
||||
|
||||
aResult[i++] = SMESH::SMESH_Mesh::_duplicate( mesh );
|
||||
meshServant->GetImpl().GetMeshDS()->Modified();
|
||||
if ( !aStudyBuilder->_is_nil() )
|
||||
aStudyBuilder->CommitCommand();
|
||||
}
|
||||
if ( !aStudyBuilder->_is_nil() )
|
||||
aStudyBuilder->CommitCommand();
|
||||
}
|
||||
|
||||
// Update Python script
|
||||
aPythonDump << "], status) = " << this << "." << theCommandNameForPython << "(r'" << theFileNameForPython << "')";
|
||||
// Update Python script
|
||||
aPythonDump << "], status) = " << this << ".CreateMeshesFromMED( r'" << theFileName << "' )";
|
||||
}
|
||||
// Dump creation of groups
|
||||
for ( CORBA::ULong i = 0; i < aResult->length(); ++i )
|
||||
@ -1400,66 +1398,6 @@ SMESH::mesh_array* SMESH_Gen_i::CreateMeshesFromMEDorSAUV( const char* theFileNa
|
||||
return aResult._retn();
|
||||
}
|
||||
|
||||
//================================================================================
|
||||
/*!
|
||||
* \brief Create meshes by reading a MED file
|
||||
*/
|
||||
//================================================================================
|
||||
|
||||
SMESH::mesh_array* SMESH_Gen_i::CreateMeshesFromMED( const char* theFileName,
|
||||
SMESH::DriverMED_ReadStatus& theStatus)
|
||||
{
|
||||
Unexpect aCatch(SALOME_SalomeException);
|
||||
checkFileReadable( theFileName );
|
||||
|
||||
SMESH::mesh_array* result = CreateMeshesFromMEDorSAUV(theFileName, theStatus,
|
||||
"CreateMeshesFromMED", theFileName);
|
||||
return result;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
/*!
|
||||
* SMESH_Gen_i::CreateMeshFromSAUV
|
||||
*
|
||||
* Create mesh and import data from SAUV file
|
||||
*/
|
||||
//=============================================================================
|
||||
|
||||
SMESH::mesh_array* SMESH_Gen_i::CreateMeshesFromSAUV( const char* theFileName,
|
||||
SMESH::DriverMED_ReadStatus& theStatus)
|
||||
{
|
||||
Unexpect aCatch(SALOME_SalomeException);
|
||||
checkFileReadable( theFileName );
|
||||
|
||||
std::string sauvfilename(theFileName);
|
||||
std::string medfilename(theFileName);
|
||||
medfilename += ".med";
|
||||
std::string cmd;
|
||||
#ifdef WIN32
|
||||
cmd = "%PYTHONBIN% ";
|
||||
#else
|
||||
cmd = "python3 ";
|
||||
#endif
|
||||
cmd += "-c \"";
|
||||
cmd += "from medutilities import convert ; convert(r'" + sauvfilename + "', 'GIBI', 'MED', 1, r'" + medfilename + "')";
|
||||
cmd += "\"";
|
||||
system(cmd.c_str());
|
||||
SMESH::mesh_array* result = CreateMeshesFromMEDorSAUV(medfilename.c_str(),
|
||||
theStatus,
|
||||
"CreateMeshesFromSAUV",
|
||||
sauvfilename.c_str());
|
||||
#ifdef WIN32
|
||||
cmd = "%PYTHONBIN% ";
|
||||
#else
|
||||
cmd = "python3 ";
|
||||
#endif
|
||||
cmd += "-c \"";
|
||||
cmd += "from medutilities import my_remove ; my_remove(r'" + medfilename + "')";
|
||||
cmd += "\"";
|
||||
system(cmd.c_str());
|
||||
return result;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
/*!
|
||||
* SMESH_Gen_i::CreateMeshFromSTL
|
||||
|
@ -241,10 +241,6 @@ public:
|
||||
SMESH::mesh_array* CreateMeshesFromMED( const char* theFileName,
|
||||
SMESH::DriverMED_ReadStatus& theStatus );
|
||||
|
||||
// Create mesh(es) and import data from MED file
|
||||
SMESH::mesh_array* CreateMeshesFromSAUV( const char* theFileName,
|
||||
SMESH::DriverMED_ReadStatus& theStatus );
|
||||
|
||||
// Create a mesh and import data from a STL file
|
||||
SMESH::SMESH_Mesh_ptr CreateMeshesFromSTL( const char* theFileName );
|
||||
|
||||
@ -641,11 +637,6 @@ private:
|
||||
|
||||
void highLightInvalid( SALOMEDS::SObject_ptr theSObject, bool isInvalid );
|
||||
|
||||
SMESH::mesh_array* CreateMeshesFromMEDorSAUV( const char* theFileName,
|
||||
SMESH::DriverMED_ReadStatus& theStatus,
|
||||
const char* theCommandNameForPython,
|
||||
const char* theFileNameForPython);
|
||||
|
||||
std::vector<long> _GetInside(SMESH::SMESH_IDSource_ptr meshPart,
|
||||
SMESH::ElementType ElemType,
|
||||
const TopoDS_Shape& Shape,
|
||||
|
@ -3797,27 +3797,6 @@ CORBA::LongLong SMESH_Mesh_i::ExportMEDCoupling(CORBA::Boolean auto_groups, CORB
|
||||
return reinterpret_cast<CORBA::LongLong>(ret);
|
||||
}
|
||||
|
||||
//================================================================================
|
||||
/*!
|
||||
* \brief Export a mesh to a SAUV file
|
||||
*/
|
||||
//================================================================================
|
||||
|
||||
void SMESH_Mesh_i::ExportSAUV( const char* file, CORBA::Boolean auto_groups )
|
||||
{
|
||||
SMESH_TRY;
|
||||
if ( _preMeshInfo )
|
||||
_preMeshInfo->FullLoadFromFile();
|
||||
|
||||
string aMeshName = prepareMeshNameAndGroups(file, true);
|
||||
TPythonDump() << SMESH::SMESH_Mesh_var( _this())
|
||||
<< ".ExportSAUV( r'" << file << "', " << auto_groups << " )";
|
||||
_impl->ExportSAUV(file, aMeshName.c_str(), auto_groups);
|
||||
|
||||
SMESH_CATCH( SMESH::throwCorbaException );
|
||||
}
|
||||
|
||||
|
||||
//================================================================================
|
||||
/*!
|
||||
* \brief Export a mesh to a DAT file
|
||||
|
@ -215,8 +215,6 @@ public:
|
||||
CORBA::LongLong ExportMEDCoupling(CORBA::Boolean auto_groups,
|
||||
CORBA::Boolean autoDimension = true);
|
||||
|
||||
void ExportSAUV( const char* file, CORBA::Boolean auto_groups );
|
||||
|
||||
void ExportDAT( const char* file, const CORBA::Boolean renumber );
|
||||
void ExportUNV( const char* file, const CORBA::Boolean renumber );
|
||||
void ExportSTL( const char* file, bool isascii );
|
||||
|
@ -685,18 +685,6 @@ class smeshBuilder( SMESH._objref_SMESH_Gen, object ):
|
||||
aMeshes = [ Mesh(self, self.geompyD, m) for m in aSmeshMeshes ]
|
||||
return aMeshes, aStatus
|
||||
|
||||
def CreateMeshesFromSAUV( self,theFileName ):
|
||||
"""
|
||||
Create a Mesh object(s) importing data from the given SAUV file
|
||||
|
||||
Returns:
|
||||
a tuple ( list of class :class:`Mesh` instances, :class:`SMESH.DriverMED_ReadStatus` )
|
||||
"""
|
||||
|
||||
aSmeshMeshes, aStatus = SMESH._objref_SMESH_Gen.CreateMeshesFromSAUV(self,theFileName)
|
||||
aMeshes = [ Mesh(self, self.geompyD, m) for m in aSmeshMeshes ]
|
||||
return aMeshes, aStatus
|
||||
|
||||
def CreateMeshesFromSTL( self, theFileName ):
|
||||
"""
|
||||
Create a Mesh object importing data from the given STL file
|
||||
@ -2456,20 +2444,6 @@ class Mesh(metaclass = MeshMeta):
|
||||
else:
|
||||
self.mesh.ExportMED(fileName, auto_groups, version, overwrite, autoDimension)
|
||||
|
||||
def ExportSAUV(self, f, auto_groups=0):
|
||||
"""
|
||||
Export the mesh in a file in SAUV format
|
||||
|
||||
|
||||
Parameters:
|
||||
f: is the file name
|
||||
auto_groups: boolean parameter for creating/not creating
|
||||
the groups Group_On_All_Nodes, Group_On_All_Faces, ... ;
|
||||
the typical use is auto_groups=False.
|
||||
"""
|
||||
|
||||
self.mesh.ExportSAUV(f, auto_groups)
|
||||
|
||||
def ExportDAT(self, f, meshPart=None, renumber=True):
|
||||
"""
|
||||
Export the mesh in a file in DAT format
|
||||
|
Loading…
Reference in New Issue
Block a user