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 ---
# additional include directories
INCLUDE_DIRECTORIES(
${QT_INCLUDES}
${KERNEL_INCLUDE_DIRS}
${GUI_INCLUDE_DIRS}
${MEDFILE_INCLUDE_DIRS}

View File

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

View File

@ -124,6 +124,9 @@ int SMESHDS_GroupBase::Extent() const
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();
return ( !it || !it->more() );
}

View File

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

View File

@ -468,9 +468,13 @@ namespace
return;
}
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( aMeshItem );
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());
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());
QCheckBox dontShowCheckBox(QObject::tr("SMESH_WRN_SHOW_DLG_CHECKBOX"));
msgBox.addButton(QMessageBox::Ok);
msgBox.addButton(QMessageBox::Cancel);

File diff suppressed because it is too large Load Diff

View File

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

View File

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