]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/PartSet/PartSet_ExternalPointsMgr.cpp
Salome HOME
updated copyright message
[modules/shaper.git] / src / PartSet / PartSet_ExternalPointsMgr.cpp
index b0faeb447c5a70281709d893de68da71e8a32547..11350c8202dc8cc7d83ac52495a2f7b830877f40 100644 (file)
@@ -1,4 +1,21 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+// Copyright (C) 2017-2023  CEA, EDF
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
 
 // File:        PartSet_ExternalPointsMgr.cpp
 // Created:     26 April 2017
@@ -9,6 +26,8 @@
 #include "PartSet_Tools.h"
 
 #include <ModelAPI_Tools.h>
+#include <ModelAPI_ResultField.h>
+#include <ModelAPI_ResultGroup.h>
 
 #include <ModuleBase_IWorkshop.h>
 #include <ModuleBase_ViewerPrs.h>
 #include <XGUI_Tools.h>
 #include <XGUI_Displayer.h>
 #include <XGUI_Workshop.h>
+#include <XGUI_SelectionActivate.h>
 #include <XGUI_SelectionMgr.h>
 
+#ifdef WIN32
+#pragma warning(disable : 4456) // for nested foreach
+#endif
+
 PartSet_ExternalPointsMgr::PartSet_ExternalPointsMgr(ModuleBase_IWorkshop* theWorkshop,
                                                      const CompositeFeaturePtr& theSketch)
   : QObject(theWorkshop), myWorkshop(theWorkshop), mySketch(theSketch)
@@ -78,6 +102,13 @@ QList<std::shared_ptr<ModuleBase_ViewerPrs>> PartSet_ExternalPointsMgr::findCirc
       continue;
 
     ResultPtr aResObj = std::dynamic_pointer_cast<ModelAPI_Result>(aObj);
+
+    // Do not use Fields and groups in selection in sketcher
+    if (!aResObj.get() ||
+      (aResObj->groupName() == ModelAPI_ResultField::group()) ||
+      (aResObj->groupName() == ModelAPI_ResultGroup::group()))
+      continue;
+
     if (aResObj.get()) {
       GeomShapePtr aShape = aResObj->shape();
       if (aShape.get()) {
@@ -160,8 +191,9 @@ void PartSet_ExternalPointsMgr::updateCenterPresentations()
     else
       myPresentations[aPrs->object()] = aList;
     foreach(AISObjectPtr anAIS, aList) {
-      aDisplayer->displayAIS(anAIS, false);
-      aDisplayer->activateAIS(anAIS->impl<Handle(AIS_InteractiveObject)>(), TopAbs_VERTEX, false);
+      aDisplayer->displayAIS(anAIS, false, 0, false);
+      aWorkshop->selectionActivate()->activateAIS(anAIS->impl<Handle(AIS_InteractiveObject)>(),
+        TopAbs_VERTEX, false);
     }
   }
 }