mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-11-13 17:18:35 +05:00
IPAL54303: CGNS export problems
This commit is contained in:
parent
7c1bf48314
commit
223c5b7f5d
@ -715,7 +715,8 @@ module SMESH
|
|||||||
in boolean isascii ) raises (SALOME::SALOME_Exception);
|
in boolean isascii ) raises (SALOME::SALOME_Exception);
|
||||||
void ExportCGNS( in SMESH_IDSource meshPart,
|
void ExportCGNS( in SMESH_IDSource meshPart,
|
||||||
in string file,
|
in string file,
|
||||||
in boolean overwrite ) raises (SALOME::SALOME_Exception);
|
in boolean overwrite,
|
||||||
|
in boolean groupElemsByType) raises (SALOME::SALOME_Exception);
|
||||||
void ExportGMF( in SMESH_IDSource meshPart,
|
void ExportGMF( in SMESH_IDSource meshPart,
|
||||||
in string file,
|
in string file,
|
||||||
in boolean withRequiredGroups) raises (SALOME::SALOME_Exception);
|
in boolean withRequiredGroups) raises (SALOME::SALOME_Exception);
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
#include "DriverCGNS_Write.hxx"
|
#include "DriverCGNS_Write.hxx"
|
||||||
|
|
||||||
|
#include "SMDS_IteratorOnIterators.hxx"
|
||||||
#include "SMDS_MeshNode.hxx"
|
#include "SMDS_MeshNode.hxx"
|
||||||
#include "SMDS_VolumeTool.hxx"
|
#include "SMDS_VolumeTool.hxx"
|
||||||
#include "SMESHDS_GroupBase.hxx"
|
#include "SMESHDS_GroupBase.hxx"
|
||||||
@ -330,7 +331,24 @@ Driver_Mesh::Status DriverCGNS_Write::Perform()
|
|||||||
// write into a section all successive elements of one geom type
|
// write into a section all successive elements of one geom type
|
||||||
int iSec;
|
int iSec;
|
||||||
vector< cgsize_t > elemData;
|
vector< cgsize_t > elemData;
|
||||||
SMDS_ElemIteratorPtr elemIt = myMesh->elementsIterator();
|
SMDS_ElemIteratorPtr elemIt = myMesh->elementsIterator();
|
||||||
|
vector< SMDS_ElemIteratorPtr > elemItVec;
|
||||||
|
if ( _elementsByType )
|
||||||
|
{
|
||||||
|
// create an iterator returning all elements by type
|
||||||
|
for ( int type = SMDSEntity_Node + 1; type < SMDSEntity_Last; ++type )
|
||||||
|
{
|
||||||
|
if ( type == SMDSEntity_Ball )
|
||||||
|
continue; // not supported
|
||||||
|
elemIt = myMesh->elementEntityIterator( SMDSAbs_EntityType( type ));
|
||||||
|
if ( elemIt->more() )
|
||||||
|
elemItVec.push_back( elemIt );
|
||||||
|
}
|
||||||
|
typedef SMDS_IteratorOnIterators< const SMDS_MeshElement*,
|
||||||
|
vector< SMDS_ElemIteratorPtr > > TVecIterator;
|
||||||
|
elemIt.reset( new TVecIterator( elemItVec ));
|
||||||
|
}
|
||||||
|
|
||||||
const SMDS_MeshElement* elem = elemIt->next();
|
const SMDS_MeshElement* elem = elemIt->next();
|
||||||
while ( elem )
|
while ( elem )
|
||||||
{
|
{
|
||||||
@ -397,6 +415,15 @@ Driver_Mesh::Status DriverCGNS_Write::Perform()
|
|||||||
elem = elemIt->more() ? elemIt->next() : 0;
|
elem = elemIt->more() ? elemIt->next() : 0;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
else // skip NOT SUPPORTED elements
|
||||||
|
{
|
||||||
|
while ( elemIt->more() )
|
||||||
|
{
|
||||||
|
elem = elemIt->next();
|
||||||
|
if ( elem->GetEntityType() != elemType )
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
SMESH_Comment sectionName( cg_ElementTypeName( cgType ));
|
SMESH_Comment sectionName( cg_ElementTypeName( cgType ));
|
||||||
sectionName << " " << startID << " - " << cgID-1;
|
sectionName << " " << startID << " - " << cgID-1;
|
||||||
@ -405,6 +432,7 @@ Driver_Mesh::Status DriverCGNS_Write::Perform()
|
|||||||
cgID-1, /*nbndry=*/0, &elemData[0], &iSec) != CG_OK )
|
cgID-1, /*nbndry=*/0, &elemData[0], &iSec) != CG_OK )
|
||||||
return addMessage( cg_get_error(), /*fatal = */true );
|
return addMessage( cg_get_error(), /*fatal = */true );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write polyhedral volumes
|
// Write polyhedral volumes
|
||||||
// -------------------------
|
// -------------------------
|
||||||
|
|
||||||
@ -531,6 +559,9 @@ Driver_Mesh::Status DriverCGNS_Write::Perform()
|
|||||||
CGNS_ENUMT( GridLocation_t ) location = CGNS_ENUMV( Vertex );
|
CGNS_ENUMT( GridLocation_t ) location = CGNS_ENUMV( Vertex );
|
||||||
if ( group->GetType() != SMDSAbs_Node )
|
if ( group->GetType() != SMDSAbs_Node )
|
||||||
{
|
{
|
||||||
|
#if CGNS_VERSION > 3130
|
||||||
|
location = CGNS_ENUMV( CellCenter );
|
||||||
|
#else
|
||||||
switch ( meshDim ) {
|
switch ( meshDim ) {
|
||||||
case 3:
|
case 3:
|
||||||
switch ( group->GetType() ) {
|
switch ( group->GetType() ) {
|
||||||
@ -551,6 +582,7 @@ Driver_Mesh::Status DriverCGNS_Write::Perform()
|
|||||||
location = CGNS_ENUMV( EdgeCenter ); break; // ???
|
location = CGNS_ENUMV( EdgeCenter ); break; // ???
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// try to extract type of boundary condition from the group name
|
// try to extract type of boundary condition from the group name
|
||||||
@ -568,6 +600,8 @@ Driver_Mesh::Status DriverCGNS_Write::Perform()
|
|||||||
const SMDS_MeshElement* elem = elemIt->next();
|
const SMDS_MeshElement* elem = elemIt->next();
|
||||||
pnts.push_back( cgnsID( elem, elem2cgIDByEntity[ elem->GetEntityType() ]));
|
pnts.push_back( cgnsID( elem, elem2cgIDByEntity[ elem->GetEntityType() ]));
|
||||||
}
|
}
|
||||||
|
if ( pnts.size() == 0 )
|
||||||
|
continue; // can't store empty group
|
||||||
int iBC;
|
int iBC;
|
||||||
if ( cg_boco_write( _fn, iBase, iZone, name.c_str(), bcType,
|
if ( cg_boco_write( _fn, iBase, iZone, name.c_str(), bcType,
|
||||||
CGNS_ENUMV( PointList ), pnts.size(), &pnts[0], &iBC) != CG_OK )
|
CGNS_ENUMV( PointList ), pnts.size(), &pnts[0], &iBC) != CG_OK )
|
||||||
@ -589,7 +623,7 @@ Driver_Mesh::Status DriverCGNS_Write::Perform()
|
|||||||
*/
|
*/
|
||||||
//================================================================================
|
//================================================================================
|
||||||
|
|
||||||
DriverCGNS_Write::DriverCGNS_Write(): _fn(0)
|
DriverCGNS_Write::DriverCGNS_Write(): _fn(0), _elementsByType( false )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,9 +45,16 @@ public:
|
|||||||
|
|
||||||
virtual Status Perform();
|
virtual Status Perform();
|
||||||
|
|
||||||
|
// to export elements either in the order of their IDs or by geometric type
|
||||||
|
void SetElementsByType( bool isByType ) { _elementsByType = isByType; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
int _fn; //!< file index
|
int _fn; //!< file index
|
||||||
|
|
||||||
|
// if true all elements of same geometry are exported at ones,
|
||||||
|
// else elements are exported in order of their IDs
|
||||||
|
bool _elementsByType;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1537,6 +1537,7 @@ void SMESH_Mesh::ExportUNV(const char * file,
|
|||||||
myWriter.SetMeshId(_id);
|
myWriter.SetMeshId(_id);
|
||||||
// myWriter.SetGroups(_mapGroup);
|
// myWriter.SetGroups(_mapGroup);
|
||||||
|
|
||||||
|
// pass group names to SMESHDS
|
||||||
if ( !meshPart )
|
if ( !meshPart )
|
||||||
{
|
{
|
||||||
for ( map<int, SMESH_Group*>::iterator it = _mapGroup.begin(); it != _mapGroup.end(); it++ ) {
|
for ( map<int, SMESH_Group*>::iterator it = _mapGroup.begin(); it != _mapGroup.end(); it++ ) {
|
||||||
@ -1581,17 +1582,37 @@ void SMESH_Mesh::ExportSTL(const char * file,
|
|||||||
|
|
||||||
void SMESH_Mesh::ExportCGNS(const char * file,
|
void SMESH_Mesh::ExportCGNS(const char * file,
|
||||||
const SMESHDS_Mesh* meshDS,
|
const SMESHDS_Mesh* meshDS,
|
||||||
const char * meshName)
|
const char * meshName,
|
||||||
|
const bool groupElemsByType)
|
||||||
{
|
{
|
||||||
int res = Driver_Mesh::DRS_FAIL;
|
int res = Driver_Mesh::DRS_FAIL;
|
||||||
|
|
||||||
|
// pass group names to SMESHDS
|
||||||
|
for ( map<int, SMESH_Group*>::iterator it = _mapGroup.begin(); it != _mapGroup.end(); it++ ) {
|
||||||
|
SMESH_Group* group = it->second;
|
||||||
|
SMESHDS_GroupBase* groupDS = group->GetGroupDS();
|
||||||
|
if ( groupDS ) {
|
||||||
|
string groupName = group->GetName();
|
||||||
|
groupDS->SetStoreName( groupName.c_str() );
|
||||||
|
}
|
||||||
|
}
|
||||||
#ifdef WITH_CGNS
|
#ifdef WITH_CGNS
|
||||||
|
|
||||||
DriverCGNS_Write myWriter;
|
DriverCGNS_Write myWriter;
|
||||||
myWriter.SetFile( file );
|
myWriter.SetFile( file );
|
||||||
myWriter.SetMesh( const_cast<SMESHDS_Mesh*>( meshDS ));
|
myWriter.SetMesh( const_cast<SMESHDS_Mesh*>( meshDS ));
|
||||||
myWriter.SetMeshName( SMESH_Comment("Mesh_") << meshDS->GetPersistentId());
|
myWriter.SetMeshName( SMESH_Comment("Mesh_") << meshDS->GetPersistentId());
|
||||||
if ( meshName && meshName[0] )
|
if ( meshName && meshName[0] )
|
||||||
myWriter.SetMeshName( meshName );
|
myWriter.SetMeshName( meshName );
|
||||||
|
myWriter.SetElementsByType( groupElemsByType );
|
||||||
res = myWriter.Perform();
|
res = myWriter.Perform();
|
||||||
|
if ( res != Driver_Mesh::DRS_OK )
|
||||||
|
{
|
||||||
|
SMESH_ComputeErrorPtr err = myWriter.GetError();
|
||||||
|
if ( err && !err->IsOK() && !err->myComment.empty() )
|
||||||
|
throw SALOME_Exception(("Export failed: " + err->myComment ).c_str() );
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
if ( res != Driver_Mesh::DRS_OK )
|
if ( res != Driver_Mesh::DRS_OK )
|
||||||
throw SALOME_Exception("Export failed");
|
throw SALOME_Exception("Export failed");
|
||||||
|
@ -267,7 +267,8 @@ class SMESH_EXPORT SMESH_Mesh
|
|||||||
const SMESHDS_Mesh* meshPart = 0) throw(SALOME_Exception);
|
const SMESHDS_Mesh* meshPart = 0) throw(SALOME_Exception);
|
||||||
void ExportCGNS(const char * file,
|
void ExportCGNS(const char * file,
|
||||||
const SMESHDS_Mesh* mesh,
|
const SMESHDS_Mesh* mesh,
|
||||||
const char * meshName = 0);
|
const char * meshName = 0,
|
||||||
|
const bool groupElemsByType = false);
|
||||||
void ExportGMF(const char * file,
|
void ExportGMF(const char * file,
|
||||||
const SMESHDS_Mesh* mesh,
|
const SMESHDS_Mesh* mesh,
|
||||||
bool withRequiredGroups = true );
|
bool withRequiredGroups = true );
|
||||||
|
@ -684,7 +684,14 @@ namespace
|
|||||||
}
|
}
|
||||||
else if ( isCGNS )// Export to CGNS
|
else if ( isCGNS )// Export to CGNS
|
||||||
{
|
{
|
||||||
SUIT_FileDlg* fd = new SUIT_FileDlg( SMESHGUI::desktop(), false, true, true );
|
const char* theByTypeResource = "cgns_group_elems_by_type";
|
||||||
|
toCreateGroups = SMESHGUI::resourceMgr()->booleanValue( "SMESH", theByTypeResource, false );
|
||||||
|
|
||||||
|
QStringList checkBoxes;
|
||||||
|
checkBoxes << QObject::tr("CGNS_EXPORT_ELEMS_BY_TYPE");
|
||||||
|
|
||||||
|
SalomeApp_CheckFileDlg* fd =
|
||||||
|
new SalomeApp_CheckFileDlg ( SMESHGUI::desktop(), false, checkBoxes, true, true );
|
||||||
fd->setWindowTitle( aTitle );
|
fd->setWindowTitle( aTitle );
|
||||||
fd->setNameFilter( QObject::tr( "CGNS_FILES_FILTER" ) + " (*.cgns)" );
|
fd->setNameFilter( QObject::tr( "CGNS_FILES_FILTER" ) + " (*.cgns)" );
|
||||||
if ( !anInitialPath.isEmpty() )
|
if ( !anInitialPath.isEmpty() )
|
||||||
@ -692,10 +699,13 @@ namespace
|
|||||||
fd->selectFile(aMeshName);
|
fd->selectFile(aMeshName);
|
||||||
SMESHGUI_FileValidator* fv = new SMESHGUI_FileValidator( fd );
|
SMESHGUI_FileValidator* fv = new SMESHGUI_FileValidator( fd );
|
||||||
fd->setValidator( fv );
|
fd->setValidator( fv );
|
||||||
|
fd->SetChecked( toCreateGroups, 0 );
|
||||||
|
|
||||||
if ( fd->exec() )
|
if ( fd->exec() )
|
||||||
aFilename = fd->selectedFile();
|
aFilename = fd->selectedFile();
|
||||||
toOverwrite = fv->isOverwrite();
|
toOverwrite = fv->isOverwrite();
|
||||||
|
toCreateGroups = fd->IsChecked(0);
|
||||||
|
SMESHGUI::resourceMgr()->setValue("SMESH", theByTypeResource, toCreateGroups );
|
||||||
|
|
||||||
delete fd;
|
delete fd;
|
||||||
}
|
}
|
||||||
@ -754,7 +764,7 @@ namespace
|
|||||||
|
|
||||||
SMESHGUI_FieldSelectorWdg* fieldSelWdg = new SMESHGUI_FieldSelectorWdg();
|
SMESHGUI_FieldSelectorWdg* fieldSelWdg = new SMESHGUI_FieldSelectorWdg();
|
||||||
QList< QWidget* > wdgList;
|
QList< QWidget* > wdgList;
|
||||||
if ( fieldSelWdg->GetAllFeilds( aMeshList, aFieldList ))
|
if ( fieldSelWdg->GetAllFields( aMeshList, aFieldList ))
|
||||||
wdgList.append( fieldSelWdg );
|
wdgList.append( fieldSelWdg );
|
||||||
|
|
||||||
SalomeApp_CheckFileDlg* fd =
|
SalomeApp_CheckFileDlg* fd =
|
||||||
@ -858,7 +868,7 @@ namespace
|
|||||||
}
|
}
|
||||||
toCreateGroups = fd->IsChecked(0);
|
toCreateGroups = fd->IsChecked(0);
|
||||||
toFindOutDim = fd->IsChecked(1);
|
toFindOutDim = fd->IsChecked(1);
|
||||||
fieldSelWdg->GetSelectedFeilds();
|
fieldSelWdg->GetSelectedFields();
|
||||||
if ( !fieldSelWdg->parent() )
|
if ( !fieldSelWdg->parent() )
|
||||||
delete fieldSelWdg;
|
delete fieldSelWdg;
|
||||||
delete fd;
|
delete fd;
|
||||||
@ -948,7 +958,8 @@ namespace
|
|||||||
SMESH::SMESH_Mesh_var aMeshItem = aMeshOrGroup->GetMesh();
|
SMESH::SMESH_Mesh_var aMeshItem = aMeshOrGroup->GetMesh();
|
||||||
aMeshItem->ExportCGNS( aMeshOrGroup,
|
aMeshItem->ExportCGNS( aMeshOrGroup,
|
||||||
aFilename.toUtf8().data(),
|
aFilename.toUtf8().data(),
|
||||||
toOverwrite && aMeshIndex == 0 );
|
toOverwrite && aMeshIndex == 0,
|
||||||
|
toCreateGroups );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( isGMF )
|
else if ( isGMF )
|
||||||
|
@ -86,7 +86,7 @@ SMESHGUI_FieldSelectorWdg::SMESHGUI_FieldSelectorWdg( QWidget* p )
|
|||||||
* \brief Retrieves all fields defined on geometry of given meshes
|
* \brief Retrieves all fields defined on geometry of given meshes
|
||||||
*/
|
*/
|
||||||
bool SMESHGUI_FieldSelectorWdg::
|
bool SMESHGUI_FieldSelectorWdg::
|
||||||
GetAllFeilds(const QList< QPair< SMESH::SMESH_IDSource_var, QString > >& meshes,
|
GetAllFields(const QList< QPair< SMESH::SMESH_IDSource_var, QString > >& meshes,
|
||||||
QList< QPair< GEOM::ListOfFields_var, QString > >& fields)
|
QList< QPair< GEOM::ListOfFields_var, QString > >& fields)
|
||||||
{
|
{
|
||||||
myFields = & fields;
|
myFields = & fields;
|
||||||
@ -166,7 +166,7 @@ GetAllFeilds(const QList< QPair< SMESH::SMESH_IDSource_var, QString > >& meshes,
|
|||||||
/*!
|
/*!
|
||||||
* \brief Filter off not selected fields from myFields
|
* \brief Filter off not selected fields from myFields
|
||||||
*/
|
*/
|
||||||
bool SMESHGUI_FieldSelectorWdg::GetSelectedFeilds()
|
bool SMESHGUI_FieldSelectorWdg::GetSelectedFields()
|
||||||
{
|
{
|
||||||
int nbSelected = 0;
|
int nbSelected = 0;
|
||||||
if ( myTree->isEnabled() )
|
if ( myTree->isEnabled() )
|
||||||
|
@ -43,10 +43,10 @@ class SMESHGUI_EXPORT SMESHGUI_FieldSelectorWdg : public QGroupBox
|
|||||||
public:
|
public:
|
||||||
SMESHGUI_FieldSelectorWdg( QWidget* = 0 );
|
SMESHGUI_FieldSelectorWdg( QWidget* = 0 );
|
||||||
|
|
||||||
bool GetAllFeilds(const QList< QPair< SMESH::SMESH_IDSource_var, QString > >& meshes,
|
bool GetAllFields(const QList< QPair< SMESH::SMESH_IDSource_var, QString > >& meshes,
|
||||||
QList< QPair< GEOM::ListOfFields_var, QString > >& fields);
|
QList< QPair< GEOM::ListOfFields_var, QString > >& fields);
|
||||||
|
|
||||||
bool GetSelectedFeilds();
|
bool GetSelectedFields();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
|
@ -39,6 +39,10 @@
|
|||||||
<source>CGNS_FILES_FILTER</source>
|
<source>CGNS_FILES_FILTER</source>
|
||||||
<translation>CGNS files</translation>
|
<translation>CGNS files</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>CGNS_EXPORT_ELEMS_BY_TYPE</source>
|
||||||
|
<translation>Group elements by type</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>GMF_ASCII_FILES_FILTER</source>
|
<source>GMF_ASCII_FILES_FILTER</source>
|
||||||
<translation>GMF ASCII files</translation>
|
<translation>GMF ASCII files</translation>
|
||||||
|
@ -42,7 +42,11 @@
|
|||||||
#define OCC_CATCH_SIGNALS
|
#define OCC_CATCH_SIGNALS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Define macros to catch and convert some of possible exceptions into text or SALOME_Exception
|
// Define macros to catch and convert some of possible exceptions into text or SALOME_Exception.
|
||||||
|
// WARNING: SALOME::SALOME_Exception (CORBA exception) is not treated here; to care about it add
|
||||||
|
// #define SMY_OWN_CATCH catch ( SALOME::SALOME_Exception & e ) { do_something(e); }
|
||||||
|
// before #include<SMESH_TryCatch.hxx>
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------
|
||||||
#define SMESH_TRY \
|
#define SMESH_TRY \
|
||||||
|
@ -3628,7 +3628,8 @@ void SMESH_Mesh_i::ExportPartToSTL(::SMESH::SMESH_IDSource_ptr meshPart,
|
|||||||
|
|
||||||
void SMESH_Mesh_i::ExportCGNS(::SMESH::SMESH_IDSource_ptr meshPart,
|
void SMESH_Mesh_i::ExportCGNS(::SMESH::SMESH_IDSource_ptr meshPart,
|
||||||
const char* file,
|
const char* file,
|
||||||
CORBA::Boolean overwrite)
|
CORBA::Boolean overwrite,
|
||||||
|
CORBA::Boolean groupElemsByType)
|
||||||
throw (SALOME::SALOME_Exception)
|
throw (SALOME::SALOME_Exception)
|
||||||
{
|
{
|
||||||
#ifdef WITH_CGNS
|
#ifdef WITH_CGNS
|
||||||
@ -3646,8 +3647,12 @@ void SMESH_Mesh_i::ExportCGNS(::SMESH::SMESH_IDSource_ptr meshPart,
|
|||||||
CORBA::String_var name = so->GetName();
|
CORBA::String_var name = so->GetName();
|
||||||
meshName = name.in();
|
meshName = name.in();
|
||||||
}
|
}
|
||||||
|
SMESH_TRY;
|
||||||
|
|
||||||
SMESH_MeshPartDS partDS( meshPart );
|
SMESH_MeshPartDS partDS( meshPart );
|
||||||
_impl->ExportCGNS(file, &partDS, meshName.c_str() );
|
_impl->ExportCGNS(file, &partDS, meshName.c_str(), groupElemsByType );
|
||||||
|
|
||||||
|
SMESH_CATCH( SMESH::throwCorbaException );
|
||||||
|
|
||||||
TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".ExportCGNS( "
|
TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".ExportCGNS( "
|
||||||
<< meshPart<< ", r'" << file << "', " << overwrite << ")";
|
<< meshPart<< ", r'" << file << "', " << overwrite << ")";
|
||||||
|
@ -251,7 +251,8 @@ public:
|
|||||||
void ExportSTL( const char* file, bool isascii ) throw (SALOME::SALOME_Exception);
|
void ExportSTL( const char* file, bool isascii ) throw (SALOME::SALOME_Exception);
|
||||||
void ExportCGNS(SMESH::SMESH_IDSource_ptr meshPart,
|
void ExportCGNS(SMESH::SMESH_IDSource_ptr meshPart,
|
||||||
const char* file,
|
const char* file,
|
||||||
CORBA::Boolean overwrite) throw (SALOME::SALOME_Exception);
|
CORBA::Boolean overwrite,
|
||||||
|
CORBA::Boolean groupElemsByType) throw (SALOME::SALOME_Exception);
|
||||||
void ExportGMF(SMESH::SMESH_IDSource_ptr meshPart,
|
void ExportGMF(SMESH::SMESH_IDSource_ptr meshPart,
|
||||||
const char* file,
|
const char* file,
|
||||||
CORBA::Boolean withRequiredGroups) throw (SALOME::SALOME_Exception);
|
CORBA::Boolean withRequiredGroups) throw (SALOME::SALOME_Exception);
|
||||||
|
@ -1879,8 +1879,11 @@ class Mesh:
|
|||||||
# @param f is the file name
|
# @param f is the file name
|
||||||
# @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 groupElemsByType if true all elements of same entity type are exported at ones,
|
||||||
|
# else elements are exported in order of their IDs which can cause creation
|
||||||
|
# of multiple cgns sections
|
||||||
# @ingroup l2_impexp
|
# @ingroup l2_impexp
|
||||||
def ExportCGNS(self, f, overwrite=1, meshPart=None):
|
def ExportCGNS(self, f, overwrite=1, meshPart=None, groupElemsByType=False):
|
||||||
unRegister = genObjUnRegister()
|
unRegister = genObjUnRegister()
|
||||||
if isinstance( meshPart, list ):
|
if isinstance( meshPart, list ):
|
||||||
meshPart = self.GetIDSource( meshPart, SMESH.ALL )
|
meshPart = self.GetIDSource( meshPart, SMESH.ALL )
|
||||||
@ -1889,7 +1892,7 @@ class Mesh:
|
|||||||
meshPart = meshPart.mesh
|
meshPart = meshPart.mesh
|
||||||
elif not meshPart:
|
elif not meshPart:
|
||||||
meshPart = self.mesh
|
meshPart = self.mesh
|
||||||
self.mesh.ExportCGNS(meshPart, f, overwrite)
|
self.mesh.ExportCGNS(meshPart, f, overwrite, groupElemsByType)
|
||||||
|
|
||||||
## Export the mesh in a file in GMF format.
|
## Export the mesh in a file in GMF format.
|
||||||
# GMF files must have .mesh extension for the ASCII format and .meshb for
|
# GMF files must have .mesh extension for the ASCII format and .meshb for
|
||||||
@ -2010,6 +2013,8 @@ class Mesh:
|
|||||||
# @ingroup l2_grps_create
|
# @ingroup l2_grps_create
|
||||||
def MakeGroupByIds(self, groupName, elementType, elemIDs):
|
def MakeGroupByIds(self, groupName, elementType, elemIDs):
|
||||||
group = self.mesh.CreateGroup(elementType, groupName)
|
group = self.mesh.CreateGroup(elementType, groupName)
|
||||||
|
if isinstance( elemIDs, Mesh ):
|
||||||
|
elemIDs = elemIDs.GetMesh()
|
||||||
if hasattr( elemIDs, "GetIDs" ):
|
if hasattr( elemIDs, "GetIDs" ):
|
||||||
if hasattr( elemIDs, "SetMesh" ):
|
if hasattr( elemIDs, "SetMesh" ):
|
||||||
elemIDs.SetMesh( self.GetMesh() )
|
elemIDs.SetMesh( self.GetMesh() )
|
||||||
|
Loading…
Reference in New Issue
Block a user