-// Copyright (C) 2007-2012 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
// 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
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() );
} 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();
}
return;
// get selected mesh
- const SALOME_ListIO& aList = mySelector->StoredIObjects();
-
+ SALOME_ListIO aList;
+ mySelectionMgr->selectedObjects(aList);
int nbSel = aList.Extent();
if (nbSel != 1)
return;