From: vsv Date: Thu, 30 May 2019 12:08:10 +0000 (+0300) Subject: Call customAction for Sketcher feature X-Git-Tag: VEDF2019Lot4~114^2~14 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=95877ee3c4e64b20727a38057f340fd8f55845af;p=modules%2Fshaper.git Call customAction for Sketcher feature --- diff --git a/src/PartSet/PartSet_WidgetSketchLabel.cpp b/src/PartSet/PartSet_WidgetSketchLabel.cpp index f8e8d3924..a32267f1a 100644 --- a/src/PartSet/PartSet_WidgetSketchLabel.cpp +++ b/src/PartSet/PartSet_WidgetSketchLabel.cpp @@ -120,6 +120,12 @@ PartSet_WidgetSketchLabel::PartSet_WidgetSketchLabel(QWidget* theParent, ModuleBase_Tools::zeroMargins(aLayout); aLayout->addWidget(mySizeOfViewWidget); aLayout->addWidget(aLabel); + + myRemoveExternal = new QCheckBox(tr("Remove external dependencies"), aFirstWgt); + myRemoveExternal->setChecked(false); + aLayout->addWidget(myRemoveExternal); + myRemoveExternal->setVisible(false); + aLayout->addStretch(1); myStackWidget->addWidget(aFirstWgt); @@ -362,6 +368,8 @@ void PartSet_WidgetSketchLabel::updateByPlaneSelected(const ModuleBase_ViewerPrs myWorkshop->updateCommandStatus(); aWorkshop->selector()->clearSelection(); myWorkshop->viewer()->update(); + + myRemoveExternal->setVisible(false); } std::shared_ptr PartSet_WidgetSketchLabel::plane() const @@ -404,6 +412,11 @@ void PartSet_WidgetSketchLabel::restoreAttributeValue(const AttributePtr& theAtt bool PartSet_WidgetSketchLabel::setSelectionCustom(const ModuleBase_ViewerPrsPtr& thePrs) { + if (myRemoveExternal->isVisible()) { + if (myRemoveExternal->isChecked()) { + myFeature->customAction(SketchPlugin_Sketch::ACTION_REMOVE_EXTERNAL()); + } + } return fillSketchPlaneBySelection(thePrs); } @@ -661,6 +674,7 @@ void PartSet_WidgetSketchLabel::onChangePlane() PartSet_Module* aModule = dynamic_cast(myWorkshop->module()); if (aModule) { mySizeOfViewWidget->setVisible(false); + myRemoveExternal->setVisible(true); myStackWidget->setCurrentIndex(0); CompositeFeaturePtr aSketch = std::dynamic_pointer_cast(myFeature); diff --git a/src/PartSet/PartSet_WidgetSketchLabel.h b/src/PartSet/PartSet_WidgetSketchLabel.h index 6f7b1a8d0..5fe95dff7 100644 --- a/src/PartSet/PartSet_WidgetSketchLabel.h +++ b/src/PartSet/PartSet_WidgetSketchLabel.h @@ -215,6 +215,7 @@ private: PartSet_PreviewPlanes* myPreviewPlanes; QCheckBox* myViewInverted; + QCheckBox* myRemoveExternal; QMap myShowConstraints;