Salome HOME
Merge remote branch 'origin/V7_dev'
[modules/geom.git] / src / AdvancedGUI / AdvancedGUI_SmoothingSurfaceDlg.cxx
index 151af634847d6ff77adad792919e81e4a0027b68..527cbcde2703c5892854c7a5313b478f5efbaa17 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -19,6 +19,9 @@
 
 #include "AdvancedGUI_SmoothingSurfaceDlg.h"
 
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(AdvancedGEOM)
+
 #include <DlgRef.h>
 #include <GeometryGUI.h>
 #include <GEOMBase.h>
@@ -116,6 +119,8 @@ void AdvancedGUI_SmoothingSurfaceDlg::Init()
 
   showOnlyPreviewControl();
 
+  globalSelection();
+  localSelection( TopAbs_VERTEX );
   //@@ initialize dialog box widgets here @@//
 
   // Signal/slot connections
@@ -157,7 +162,8 @@ bool AdvancedGUI_SmoothingSurfaceDlg::ClickOnApply()
     return false;
 
   initName();
-
+  globalSelection();
+  localSelection( TopAbs_VERTEX );
   return true;
 }
 
@@ -168,6 +174,8 @@ bool AdvancedGUI_SmoothingSurfaceDlg::ClickOnApply()
 void AdvancedGUI_SmoothingSurfaceDlg::ActivateThisDialog()
 {
   GEOMBase_Skeleton::ActivateThisDialog();
+  globalSelection();
+  localSelection( TopAbs_VERTEX );
   //displayPreview();
 }
 
@@ -187,7 +195,6 @@ void AdvancedGUI_SmoothingSurfaceDlg::enterEvent (QEvent*)
 //=================================================================================
 GEOM::GEOM_IOperations_ptr AdvancedGUI_SmoothingSurfaceDlg::createOperation()
 {
-  //return getGeomEngine()->GetIAdvancedOperations(getStudyId());
   return getGeomEngine()->GetPluginOperations(getStudyId(), "AdvancedEngine");
 }
 
@@ -219,7 +226,7 @@ bool AdvancedGUI_SmoothingSurfaceDlg::execute (ObjectList& objects)
 
   GEOM::GEOM_Object_var anObj;
 
-  GEOM::GEOM_IAdvancedOperations_var anOper = GEOM::GEOM_IAdvancedOperations::_narrow(getOperation());
+  GEOM::IAdvancedOperations_var anOper = GEOM::IAdvancedOperations::_narrow(getOperation());
 
   //@@ retrieve input values from the widgets here @@//
   GEOM::ListOfGO_var points = new GEOM::ListOfGO();
@@ -247,6 +254,26 @@ bool AdvancedGUI_SmoothingSurfaceDlg::execute (ObjectList& objects)
   return res;
 }
 
+//=================================================================================
+// function : addSubshapesToStudy
+// purpose  : virtual method to add new SubObjects if local selection
+//=================================================================================
+void AdvancedGUI_SmoothingSurfaceDlg::addSubshapesToStudy()
+{
+  for ( int i = 0; i < myPoints.count(); i++ )
+    GEOMBase::PublishSubObject( myPoints[i].get() );
+}
+
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> AdvancedGUI_SmoothingSurfaceDlg::getSourceObjects()
+{
+  return myPoints;
+}
+
 //=================================================================================
 // function : getNbPoints()
 // purpose  : Returns the number of points in myPoints list.
@@ -335,5 +362,7 @@ void AdvancedGUI_SmoothingSurfaceDlg::SetEditCurrentArgument()
   if ( sender() == GroupPoints->PushButton1 )
     myEditCurrentArgument = GroupPoints->LineEdit1;
   myEditCurrentArgument->setFocus();
+  globalSelection();
+  localSelection( TopAbs_VERTEX );
   SelectionIntoArgument();
 }