ModuleBase_IWorkshop* theWorkshop,
const Config_WidgetAPI* theData,
const QMap<PartSet_Tools::ConstraintVisibleState, bool>& toShowConstraints)
-: ModuleBase_WidgetValidated(theParent, theWorkshop, theData), myOpenTransaction(false)
+: ModuleBase_WidgetValidated(theParent, theWorkshop, theData), myOpenTransaction(false),
+myIsSelection(false)
{
QVBoxLayout* aLayout = new QVBoxLayout(this);
ModuleBase_Tools::zeroMargins(aLayout);
if (toShowConstraints.contains(aState))
aShowConstraints->setChecked(toShowConstraints[aState]);
}
-
+ myShowPoints = new QCheckBox(tr("Show free points"), this);
+ connect(myShowPoints, SIGNAL(toggled(bool)), this, SIGNAL(showFreePoints(bool)));
+ aLayout->addWidget(myShowPoints);
QPushButton* aPlaneBtn = new QPushButton(tr("Change sketch plane"), aSecondWgt);
connect(aPlaneBtn, SIGNAL(clicked(bool)), SLOT(onChangePlane()));
else {
// it removes the processed value from the parameters list
ModuleBase_ViewerPrsPtr aValue = theValues.first();//.takeFirst();
- if (!theToValidate || isValidInFilters(aValue))
+ if (!theToValidate || isValidInFilters(aValue)) {
+ myIsSelection = true;
aDone = setSelectionCustom(aValue);
+ myIsSelection = false;
+ }
}
return aDone;
isSetSizeOfView = false;
}
}
- if (isSetSizeOfView)
- aModule->sketchMgr()->previewSketchPlane()->setSizeOfView(aSizeOfView, true);
+ aModule->sketchMgr()->previewSketchPlane()->setSizeOfView(aSizeOfView, isSetSizeOfView);
aModule->sketchMgr()->previewSketchPlane()->createSketchPlane(aSketch, myWorkshop);
- if (isSetSizeOfView)
- aModule->sketchMgr()->previewSketchPlane()->setSizeOfView(aSizeOfView, false);
}
// 2. if the planes were displayed, change the view projection
}
}
}
- if (aModule)
- aModule->onViewTransformed();
-
if (myOpenTransaction) {
SessionPtr aMgr = ModelAPI_Session::get();
aMgr->finishOperation();
myWorkshop->selectionActivate()->updateSelectionFilters();
myWorkshop->selectionActivate()->updateSelectionModes();
+ if (aModule)
+ aModule->onViewTransformed();
+
// 6. Update sketcher actions
XGUI_ActionsMgr* anActMgr = aWorkshop->actionsMgr();
bool PartSet_WidgetSketchLabel::setSelectionCustom(const ModuleBase_ViewerPrsPtr& thePrs)
{
- if (myRemoveExternal->isVisible()) {
+ if (myIsSelection && myRemoveExternal->isVisible()) {
if (myRemoveExternal->isChecked()) {
myFeature->customAction(SketchPlugin_Sketch::ACTION_REMOVE_EXTERNAL());
}
aWorkshop->selectionActivate()->updateSelectionModes();
SessionPtr aMgr = ModelAPI_Session::get();
- aMgr->startOperation();
+ aMgr->startOperation("Change Sketch plane");
myOpenTransaction = true;
}
-}
\ No newline at end of file
+}
+
+void PartSet_WidgetSketchLabel::setShowPointsState(bool theState)
+{
+ bool aBlock = myShowPoints->blockSignals(true);
+ myShowPoints->setChecked(theState);
+ myShowPoints->blockSignals(aBlock);
+}