]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Call customAction for Sketcher feature
authorvsv <vsv@opencascade.com>
Thu, 30 May 2019 12:08:10 +0000 (15:08 +0300)
committervsv <vsv@opencascade.com>
Thu, 30 May 2019 12:08:10 +0000 (15:08 +0300)
src/PartSet/PartSet_WidgetSketchLabel.cpp
src/PartSet/PartSet_WidgetSketchLabel.h

index f8e8d39245c5747559aedd97d7981abad1187d92..a32267f1a6d72bc230712f4b407776d920e6a0a5 100644 (file)
@@ -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<GeomAPI_Pln> 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<PartSet_Module*>(myWorkshop->module());
   if (aModule) {
     mySizeOfViewWidget->setVisible(false);
+    myRemoveExternal->setVisible(true);
     myStackWidget->setCurrentIndex(0);
 
     CompositeFeaturePtr aSketch = std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(myFeature);
index 6f7b1a8d05f4e56acf63627e46a0c556f10f13d0..5fe95dff79e1171694d2475a23be3df7e9821b5e 100644 (file)
@@ -215,6 +215,7 @@ private:
   PartSet_PreviewPlanes* myPreviewPlanes;
 
   QCheckBox* myViewInverted;
+  QCheckBox* myRemoveExternal;
 
   QMap<PartSet_Tools::ConstraintVisibleState, QCheckBox*> myShowConstraints;