]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
Allowed selection of subfaces in for extruded boss /cut
authorrnc <rnc@opencascade.com>
Fri, 2 Mar 2012 10:53:04 +0000 (10:53 +0000)
committerrnc <rnc@opencascade.com>
Fri, 2 Mar 2012 10:53:04 +0000 (10:53 +0000)
src/OperationGUI/OperationGUI_ExtrudedFeatureDlg.cxx
src/OperationGUI/OperationGUI_ExtrudedFeatureDlg.h

index b9f0bb8f442055309c9eb51d806eb665d1382b30..d537de77977c1e87281cff954ec81845fde154ed 100644 (file)
@@ -203,20 +203,26 @@ bool OperationGUI_ExtrudedFeatureDlg::ClickOnApply()
 void OperationGUI_ExtrudedFeatureDlg::SetEditCurrentArgument()
 {
   QPushButton* send = (QPushButton*)sender();
-
+  
   if (send == myGroup->PushButton1) {
     myEditCurrentArgument = myGroup->LineEdit1;
 
     myGroup->PushButton2->setDown(false);
     myGroup->LineEdit2->setEnabled(false);
+    
+    globalSelection();   // close local selection
   }
   else if (send == myGroup->PushButton2) {
     myEditCurrentArgument = myGroup->LineEdit2;
 
     myGroup->PushButton1->setDown(false);
     myGroup->LineEdit1->setEnabled(false);
+    
+    globalSelection(); // close local selection to clear it
+//     localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
+    localSelection( GEOM::GEOM_Object::_nil(), TopAbs_FACE );
   }
-
+  
   // enable line edit
   myEditCurrentArgument->setEnabled(true);
   myEditCurrentArgument->setFocus();
@@ -244,7 +250,7 @@ void OperationGUI_ExtrudedFeatureDlg::SelectionIntoArgument()
   if (myEditCurrentArgument == myGroup->LineEdit2)
   {
     types.clear();
-    types << TopAbs_EDGE << TopAbs_WIRE;
+    types << TopAbs_EDGE << TopAbs_WIRE << TopAbs_FACE;
   }
 
   GEOM::GeomObjPtr aSelectedObject = getSelected( types );
@@ -374,6 +380,15 @@ bool OperationGUI_ExtrudedFeatureDlg::execute (ObjectList& objects)
   return true;
 }
 
+//=================================================================================
+// function : addSubshapeToStudy
+// purpose  : virtual method to add new SubObjects if local selection
+//=================================================================================
+void OperationGUI_ExtrudedFeatureDlg::addSubshapesToStudy()
+{
+  GEOMBase::PublishSubObject( myObject2.get() );
+}
+
 
 
 
index 052c69020747804ee049fd1028ea5d5a5e9e65cd..1cfd028bbe828b366de75df20a2d6c6fdb7c8557 100644 (file)
@@ -60,7 +60,8 @@ protected:
   // redefined from GEOMBase_Helper
   virtual GEOM::GEOM_IOperations_ptr createOperation();
   virtual bool                       isValid( QString& );
-  virtual bool                       execute( ObjectList& ); 
+  virtual bool                       execute( ObjectList& );
+  virtual void                       addSubshapesToStudy();
   
 private:
   void                        Init();