X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_ComputeDlg.cxx;h=26180bedb0f5776844a86e39b1240c9dba024f6b;hb=9be2f33e6895fe223940398c9b6e68af86feb1e5;hp=214dc244603a3e6ad1feb0d20334ffa6c0966d75;hpb=f4b63cd2bd34dad07c839b1da8c88fa43143bd8f;p=modules%2Fsmesh.git diff --git a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx index 214dc2446..26180bedb 100644 --- a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx @@ -737,6 +737,7 @@ SMESHGUI_ComputeDlg_QThreadQDialog::SMESHGUI_ComputeDlg_QThreadQDialog(QWidget cancelButton = new QPushButton(tr("CANCEL")); cancelButton->setDefault(true); + cancelButton->setCheckable(true); QLabel * nbNodesName = new QLabel(tr("SMESH_MESHINFO_NODES"), this ); QLabel * nbElemsName = new QLabel(tr("SMESH_MESHINFO_ELEMENTS"), this ); @@ -779,13 +780,13 @@ bool SMESHGUI_ComputeDlg_QThreadQDialog::result() void SMESHGUI_ComputeDlg_QThreadQDialog::onCancel() { qthread.cancel(); - cancelButton->setDown( true ); cancelButton->setText( tr("CANCELING")); + cancelButton->setEnabled(false); } void SMESHGUI_ComputeDlg_QThreadQDialog::timerEvent(QTimerEvent *event) { - if ( !cancelButton->isDown() ) // not yet cancelled + if ( !cancelButton->isChecked() ) // not yet cancelled progressBar->setValue( progressBar->maximum() * qthread.getMesh()->GetComputeProgress() ); if(qthread.isFinished()) @@ -894,9 +895,10 @@ void SMESHGUI_BaseComputeOp::computeMesh() bool limitExceeded; long limitSize = resMgr->integerValue( "SMESH", "update_limit", 500000 ); int entities = SMESH_Actor::eAllEntity; + int hidden = 0; if ( !memoryLack ) { - if ( getSMESHGUI()->automaticUpdate( myMesh, &entities, &limitExceeded ) ) + if ( getSMESHGUI()->automaticUpdate( myMesh, &entities, &limitExceeded, &hidden ) ) { try { #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 @@ -904,17 +906,24 @@ void SMESHGUI_BaseComputeOp::computeMesh() #endif SMESH_Actor *anActor = SMESH::FindActorByObject( myMesh ); if ( !anActor ) anActor = SMESH::CreateActor( aMeshSObj->GetStudy(), aMeshSObj->GetID().c_str(), true ); - - anActor->SetEntityMode( entities ); - SMESH::DisplayActor( SMESH::GetActiveWindow(), anActor ); - + if ( anActor ) // actor is not created for an empty mesh + { + anActor->SetEntityMode( entities ); + SMESH::DisplayActor( SMESH::GetActiveWindow(), anActor ); + } SMESH::Update(myIObject, true); if ( limitExceeded ) { + QStringList hiddenMsg; + if ( hidden & SMESH_Actor::e0DElements ) hiddenMsg << tr( "SMESH_ELEMS0D" ); + if ( hidden & SMESH_Actor::eEdges ) hiddenMsg << tr( "SMESH_EDGES" ); + if ( hidden & SMESH_Actor::eFaces ) hiddenMsg << tr( "SMESH_FACES" ); + if ( hidden & SMESH_Actor::eVolumes ) hiddenMsg << tr( "SMESH_VOLUMES" ); + if ( hidden & SMESH_Actor::eBallElem ) hiddenMsg << tr( "SMESH_BALLS" ); SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ), - tr( "SMESH_WRN_SIZE_INC_LIMIT_EXCEEDED" ).arg( myMesh->NbElements() ).arg( limitSize ) ); + tr( "SMESH_WRN_SIZE_INC_LIMIT_EXCEEDED" ).arg( myMesh->NbElements() ).arg( limitSize ).arg( hiddenMsg.join(", ") ) ); } } catch (...) {