From 53bd086779d54791bfd119de31f01eac699e0745 Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 14 Apr 2016 18:31:42 +0300 Subject: [PATCH 1/1] 23269: Meshing a composite block with IJK StdMeshers_CompositeHexa_3D.cxx And more: 1) Avoid creating actors for not shown mesh objects SMESHGUI_ComputeDlg.cxx 2) Add wait-cursor while group deletion, which can be long on large meshes SMESHGUI_DeleteGroupDlg.cxx 3) Avoid getting elem types of a new group on filter, which can be long SMESH_Gen_i_1.cxx --- src/SMESHGUI/SMESHGUI_ComputeDlg.cxx | 8 ++++++-- src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx | 3 +++ src/SMESH_I/SMESH_Gen_i_1.cxx | 3 +-- src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx | 13 ++++++++++--- src/StdMeshers/StdMeshers_Prism_3D.cxx | 2 +- 5 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx index 05858cc14..ad4453c1c 100644 --- a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx @@ -939,7 +939,9 @@ void SMESHGUI_BaseComputeOp::computeMesh() if ( !smSObj ) continue; SMESH::SMESH_IDSource_var aSubMeshObj = SMESH::SObjectToInterface( smSObj ); - aListToUpdate.append( TListOf_IDSrc_SObj::value_type( aSubMeshObj, smSObj )); + SMESH_Actor *anActor = SMESH::FindActorByObject( aSubMeshObj ); + if ( anActor && anActor->GetVisibility() ) + aListToUpdate.append( TListOf_IDSrc_SObj::value_type( aSubMeshObj, smSObj )); } // put Groups into list SMESH::ListOfGroups_var aGroups = myMesh->GetGroups(); @@ -955,7 +957,9 @@ void SMESHGUI_BaseComputeOp::computeMesh() if ( !aGroupSO ) continue; SMESH::SMESH_IDSource_var aGroupObj = SMESH::SObjectToInterface( aGroupSO ); - aListToUpdate.append( TListOf_IDSrc_SObj::value_type( aGroupObj, aGroupSO )); + SMESH_Actor *anActor = SMESH::FindActorByObject( aGroupObj ); + if ( anActor && anActor->GetVisibility() ) + aListToUpdate.append( TListOf_IDSrc_SObj::value_type( aGroupObj, aGroupSO )); } // update mesh, sub-mesh and groups, if it's possible diff --git a/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx b/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx index 6952b96c9..7711022c3 100644 --- a/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx @@ -37,6 +37,7 @@ #include #include #include +#include #include #include @@ -205,6 +206,8 @@ bool SMESHGUI_DeleteGroupDlg::onApply() if (!isValid()) return false; + SUIT_OverrideCursor wc; + myBlockSelection = true; QList::iterator anIter; diff --git a/src/SMESH_I/SMESH_Gen_i_1.cxx b/src/SMESH_I/SMESH_Gen_i_1.cxx index 30ef9e5c6..af12566d8 100644 --- a/src/SMESH_I/SMESH_Gen_i_1.cxx +++ b/src/SMESH_I/SMESH_Gen_i_1.cxx @@ -771,8 +771,7 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishGroup (SALOMEDS::Study_ptr theStudy SetName( aRootSO, aRootNames[aType] ); // Add new group to corresponding sub-tree - SMESH::array_of_ElementType_var elemTypes = theGroup->GetTypes(); - int isEmpty = ( elemTypes->length() == 0 ); + int isEmpty = false; std::string pm[2] = { "ICON_SMESH_TREE_GROUP", "ICON_SMESH_TREE_MESH_WARN" }; if ( SMESH::DownCast< SMESH_GroupOnFilter_i* > ( theGroup )) { diff --git a/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx b/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx index cd047490a..cb0512d1f 100644 --- a/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx +++ b/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx @@ -382,12 +382,12 @@ namespace const TopTools_MapOfShape& cornerVV, TopTools_MapOfShape& internEE) { - TopTools_IndexedMapOfShape subEE, subFF; + TopTools_IndexedMapOfShape subEE; TopExp::MapShapes( shape, TopAbs_EDGE, subEE ); - TopExp::MapShapes( shape, TopAbs_FACE, subFF ); + //TopExp::MapShapes( shape, TopAbs_FACE, subFF ); TopoDS_Vertex VV[2]; - TopTools_MapOfShape subChecked/*, ridgeEE*/; + TopTools_MapOfShape subChecked, ridgeEE; TopTools_MapIteratorOfMapOfShape vIt( cornerVV ); for ( ; vIt.More(); vIt.Next() ) { @@ -401,6 +401,8 @@ namespace TopoDS_Edge ridgeE = TopoDS::Edge( *riE ); while ( !ridgeE.IsNull() ) { + if ( !ridgeEE.Add( ridgeE )) + break; TopExp::Vertices( ridgeE, VV[0], VV[1] ); TopoDS_Shape V1 = VV[ V0.IsSame( VV[0] )]; if ( cornerVV.Contains( V1 ) ) @@ -451,6 +453,11 @@ namespace } // loop on ridge EDGEs around a corner VERTEX } // loop on on corner VERTEXes + if ( subEE.Extent() > ridgeEE.Extent() + internEE.Extent() ) // PAL23269 + for ( int i = 1; i < subEE.Extent(); ++i ) + if ( !ridgeEE.Contains( subEE(i) )) + internEE.Add( subEE(i) ); + return true; } // getInternalEdges() } // namespace diff --git a/src/StdMeshers/StdMeshers_Prism_3D.cxx b/src/StdMeshers/StdMeshers_Prism_3D.cxx index c7a44bada..d60f1397e 100644 --- a/src/StdMeshers/StdMeshers_Prism_3D.cxx +++ b/src/StdMeshers/StdMeshers_Prism_3D.cxx @@ -1116,7 +1116,7 @@ bool StdMeshers_Prism_3D::compute(const Prism_3D::TPrismTopo& thePrism) ( ! botSM->GetAlgo() || ! _gen->Compute( *botSM->GetFather(), botSM->GetSubShape(), /*shapeOnly=*/true ))) return error( COMPERR_BAD_INPUT_MESH, - TCom( "No mesher defined to compute the face #") + TCom( "No mesher defined to compute the base face #") << shapeID( thePrism.myBottom )); // Make all side FACEs of thePrism meshed with quads -- 2.30.2