X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_RevolutionDlg.cxx;h=3c0f04bbbadd96df8e6b57dce944aa11a8efc8e9;hb=251f8c052dd12dd29922210dc901b295fe999a0e;hp=a70f3e02c0ab8826cec1bd32080552b3472b4b6c;hpb=bd8f1aee7c78f7d2eb82bd4fec5e08c9e3d280ce;p=modules%2Fsmesh.git diff --git a/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx b/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx index a70f3e02c..3c0f04bbb 100644 --- a/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -6,7 +6,7 @@ // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -516,8 +516,18 @@ bool SMESHGUI_RevolutionDlg::ClickOnApply() aParameters << SpinBox_NbSteps->text(); aParameters << SpinBox_Tolerance->text(); + bool meshHadNewTypeBefore = true; + try { SUIT_OverrideCursor aWaitCursor; + + // is it necessary to switch on the next Display Mode? + SMESH::ElementType newType = (SMESH::ElementType)( SMESH::FACE + GetConstructorId() ); + SMESH::array_of_ElementType_var oldTypes = myMesh->GetTypes(); + meshHadNewTypeBefore = false; + for ( size_t i = 0; i < oldTypes->length() && !meshHadNewTypeBefore; ++i ) + meshHadNewTypeBefore = ( oldTypes[i] >= newType ); + SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor(); myMesh->SetParameters( aParameters.join(":").toLatin1().constData() ); @@ -552,14 +562,30 @@ bool SMESHGUI_RevolutionDlg::ClickOnApply() } catch (...) { } + if ( myActor && !meshHadNewTypeBefore ) + { + unsigned int aMode = myActor->GetEntityMode(); + switch ( GetConstructorId() ) { + case 0-1: // extrude node -> edges + myActor->SetRepresentation(SMESH_Actor::eEdge); + myActor->SetEntityMode( aMode |= SMESH_Actor::eEdges ); break; + case 1-1: // edge -> faces + myActor->SetRepresentation(SMESH_Actor::eSurface); + myActor->SetEntityMode( aMode |= SMESH_Actor::eFaces ); break; + case 2-1: // faces -> volumes + myActor->SetRepresentation(SMESH_Actor::eSurface); + myActor->SetEntityMode( aMode |= SMESH_Actor::eVolumes ); break; + } + } SMESH::UpdateView(); SMESH::Update(myIO, SMESH::eDisplay); if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ) mySMESHGUI->updateObjBrowser(true); // new groups may appear Init(false); - ConstructorsClicked(GetConstructorId()); + mySelectionMgr->clearSelected(); mySelectedObject = SMESH::SMESH_IDSource::_nil(); SelectionIntoArgument(); + ConstructorsClicked(GetConstructorId()); SMESHGUI::Modified(); } @@ -712,8 +738,8 @@ void SMESHGUI_RevolutionDlg::SelectionIntoArgument() return; // get selected mesh - const SALOME_ListIO& aList = mySelector->StoredIObjects(); - + SALOME_ListIO aList; + mySelectionMgr->selectedObjects(aList); int nbSel = aList.Extent(); if (nbSel != 1) return;