23416: [CEA 2033] Impossible to re-compute a mesh from an hdf

Optimize mesh loading in case of complex shape + a group on geometry
  (SMESHDS_GroupBase.cxx)


+ While MED export, create groups of all balls and 0D elements, if required
  (SMESH_Mesh.cxx)

+ Remember collapsed state of information on elements and nodes in Mesh Information dlg
  (SMESHGUI_MeshInfo)
This commit is contained in:
eap 2017-03-02 17:22:58 +03:00
parent c80762b0a1
commit 3957e28e35
8 changed files with 481 additions and 453 deletions

View File

@ -20,7 +20,6 @@
# --- options --- # --- options ---
# additional include directories # additional include directories
INCLUDE_DIRECTORIES( INCLUDE_DIRECTORIES(
${QT_INCLUDES}
${KERNEL_INCLUDE_DIRS} ${KERNEL_INCLUDE_DIRS}
${GUI_INCLUDE_DIRS} ${GUI_INCLUDE_DIRS}
${MEDFILE_INCLUDE_DIRS} ${MEDFILE_INCLUDE_DIRS}

View File

@ -1421,6 +1421,8 @@ void SMESH_Mesh::ExportMED(const char * file,
myWriter.AddGroupOfEdges(); myWriter.AddGroupOfEdges();
myWriter.AddGroupOfFaces(); myWriter.AddGroupOfFaces();
myWriter.AddGroupOfVolumes(); myWriter.AddGroupOfVolumes();
myWriter.AddGroupOf0DElems();
myWriter.AddGroupOfBalls();
} }
if ( theAllElemsToGroup ) if ( theAllElemsToGroup )
myWriter.AddAllToGroup(); myWriter.AddAllToGroup();

View File

@ -124,6 +124,9 @@ int SMESHDS_GroupBase::Extent() const
bool SMESHDS_GroupBase::IsEmpty() bool SMESHDS_GroupBase::IsEmpty()
{ {
if ( myMesh->GetMeshInfo().NbElements( myType ) == 0 )
// avoid long iteration over sub-meshes of a complex sub-mesh of a group on geometry
return false;
SMDS_ElemIteratorPtr it = GetElements(); SMDS_ElemIteratorPtr it = GetElements();
return ( !it || !it->more() ); return ( !it || !it->more() );
} }

View File

@ -21,7 +21,6 @@
# additional include directories # additional include directories
INCLUDE_DIRECTORIES( INCLUDE_DIRECTORIES(
${CAS_INCLUDE_DIRS} ${CAS_INCLUDE_DIRS}
${QT_INCLUDES}
${PYTHON_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS}
${VTK_INCLUDE_DIRS} ${VTK_INCLUDE_DIRS}
${KERNEL_INCLUDE_DIRS} ${KERNEL_INCLUDE_DIRS}

View File

@ -467,10 +467,14 @@ namespace
QObject::tr( "SMESH_BAD_MESH_SELECTION" )); QObject::tr( "SMESH_BAD_MESH_SELECTION" ));
return; return;
} }
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( aMeshItem ); SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( aMeshItem );
if ( aCheckWarn && !aGroup->_is_nil() ) { if ( aCheckWarn && !aGroup->_is_nil() )
QMessageBox msgBox(SUIT_MessageBox::Warning,QObject::tr("SMESH_WRN_WARNING"), {
QObject::tr("SMESH_EXPORT_ONLY_GPOUP"),QMessageBox::StandardButton::NoButton, SMESHGUI::desktop()); QMessageBox msgBox(SUIT_MessageBox::Warning,
QObject::tr("SMESH_WRN_WARNING"),
QObject::tr("SMESH_EXPORT_ONLY_GPOUP"),
QMessageBox::StandardButton::NoButton,
SMESHGUI::desktop());
QCheckBox dontShowCheckBox(QObject::tr("SMESH_WRN_SHOW_DLG_CHECKBOX")); QCheckBox dontShowCheckBox(QObject::tr("SMESH_WRN_SHOW_DLG_CHECKBOX"));
msgBox.addButton(QMessageBox::Ok); msgBox.addButton(QMessageBox::Ok);
msgBox.addButton(QMessageBox::Cancel); msgBox.addButton(QMessageBox::Cancel);
@ -481,12 +485,12 @@ namespace
lt->addWidget(btnbox, lt->rowCount(), 0, lt->rowCount(), lt->columnCount()); lt->addWidget(btnbox, lt->rowCount(), 0, lt->rowCount(), lt->columnCount());
if(msgBox.exec() == QMessageBox::Ok) if(msgBox.exec() == QMessageBox::Ok)
{ {
if(dontShowCheckBox.checkState() == Qt::Checked) if(dontShowCheckBox.checkState() == Qt::Checked)
{ {
if ( resMgr ) if ( resMgr )
resMgr->setValue( "SMESH", "show_warning", false); resMgr->setValue( "SMESH", "show_warning", false);
} }
aCheckWarn = false; aCheckWarn = false;
} }
else else
return; return;

File diff suppressed because it is too large Load Diff

View File

@ -242,9 +242,11 @@ protected:
private slots: private slots:
void itemDoubleClicked( QTreeWidgetItem*, int ); void itemDoubleClicked( QTreeWidgetItem*, int );
void saveExpanded( QTreeWidgetItem* );
private: private:
QTreeWidgetItem* createItem( QTreeWidgetItem* = 0, int = 0 ); QTreeWidgetItem* createItem( QTreeWidgetItem* = 0, int = 0 );
QString expandedResource( QTreeWidgetItem* );
private: private:
QTreeWidget* myInfo; QTreeWidget* myInfo;

View File

@ -847,8 +847,8 @@ bool StdMeshers_ProjectionUtils::FindSubShapeAssociation(const TopoDS_Shape& the
} }
// Associate shells // Associate shells
// //
int nbFaces1 = SMESH_MesherHelper:: Count( shell1, TopAbs_FACE, 0 ); int nbFaces1 = SMESH_MesherHelper::Count( shell1, TopAbs_FACE, 0 );
int nbFaces2 = SMESH_MesherHelper:: Count( shell2, TopAbs_FACE, 0 ); int nbFaces2 = SMESH_MesherHelper::Count( shell2, TopAbs_FACE, 0 );
if ( nbFaces1 != nbFaces2 ) if ( nbFaces1 != nbFaces2 )
RETURN_BAD_RESULT("Different nb of faces found for shells"); RETURN_BAD_RESULT("Different nb of faces found for shells");
if ( nbFaces1 > 0 ) { if ( nbFaces1 > 0 ) {