X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSet%2FPartSet_WidgetSketchCreator.cpp;h=7f9fc5adae6c9a4a3725f0d91e36e1138b66b86a;hb=384c819a1edf4b726e3a523c1ffd2b5e6b16a4c0;hp=a1bd76150cb8264ed0ab1597a6a0ef2aef8833f0;hpb=87b6a30a3afb8fb32e7e43ade8d9c947d9eb1684;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_WidgetSketchCreator.cpp b/src/PartSet/PartSet_WidgetSketchCreator.cpp index a1bd76150..7f9fc5ada 100644 --- a/src/PartSet/PartSet_WidgetSketchCreator.cpp +++ b/src/PartSet/PartSet_WidgetSketchCreator.cpp @@ -195,6 +195,10 @@ bool PartSet_WidgetSketchCreator::isValidSelectionCustom(const ModuleBase_Viewer void PartSet_WidgetSketchCreator::activateSelectionControl() { + // reset previously set size of view needed on restart extrusion after Sketch + if (myModule->sketchMgr()->previewSketchPlane()->isUseSizeOfView()) + myModule->sketchMgr()->previewSketchPlane()->setSizeOfView(0, false); + // we need to call activate here as the widget has no focus accepted controls // if these controls are added here, activate will happens automatically after focusIn() XGUI_Workshop* aWorkshop = XGUI_Tools::workshop(myModule->workshop()); @@ -323,10 +327,12 @@ bool PartSet_WidgetSketchCreator::setSelection(QList& t } //******************************************************************** -void PartSet_WidgetSketchCreator::onSelectionChanged() +bool PartSet_WidgetSketchCreator::processSelection() { QList aSelected = getFilteredSelected(); bool isDone = setSelection(aSelected, true/*false*/); + + return isDone; } //******************************************************************** @@ -359,20 +365,18 @@ bool PartSet_WidgetSketchCreator::startSketchOperation( // Set View size if a plane is selected if (myPreviewPlanes->isPreviewDisplayed() && myPreviewPlanes->isPreviewShape(aValue->shape())) { + // set default plane size + bool isSetSizeOfView = false; + double aSizeOfView = 0; QString aSizeOfViewStr = mySizeOfView->text(); if (!aSizeOfViewStr.isEmpty()) { - bool isOk; - double aSizeOfView = aSizeOfViewStr.toDouble(&isOk); - if (isOk && aSizeOfView > 0) { - Handle(V3d_View) aView3d = myWorkshop->viewer()->activeView(); - if (!aView3d.IsNull()) { - Bnd_Box aBndBox; - double aHalfSize = aSizeOfView/2.0; - aBndBox.Update(-aHalfSize, -aHalfSize, -aHalfSize, aHalfSize, aHalfSize, aHalfSize); - aView3d->FitAll(aBndBox, 0.01, false); - } + aSizeOfView = aSizeOfViewStr.toDouble(&isSetSizeOfView); + if (isSetSizeOfView && aSizeOfView <= 0) { + isSetSizeOfView = false; } } + if (isSetSizeOfView) + myModule->sketchMgr()->previewSketchPlane()->setSizeOfView(aSizeOfView, true); } // manually deactivation because the widget was not activated as has no focus acceptin controls deactivate();