]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Commmented the Increase the sensitivity of selection to 10 pixels because vertexes...
authornds <natalia.donis@opencascade.com>
Fri, 23 May 2014 05:19:29 +0000 (09:19 +0400)
committernds <natalia.donis@opencascade.com>
Fri, 23 May 2014 05:19:29 +0000 (09:19 +0400)
Skip vertexes selection during the operation initialization.

src/PartSet/PartSet_Module.cpp
src/XGUI/XGUI_Displayer.cpp
src/XGUI/XGUI_Displayer.h

index 23231b3dc15b398ff57351c1c6d2e83440360fec..06e21761f06a556a84592b0a81c69452a4c3901c 100644 (file)
@@ -180,8 +180,9 @@ void PartSet_Module::onLaunchOperation(std::string theName, boost::shared_ptr<Mo
   if (aPreviewOp)
   {
     XGUI_Displayer* aDisplayer = myWorkshop->displayer();
-    std::list<XGUI_ViewerPrs> aSelected = aDisplayer->GetSelected();
-    std::list<XGUI_ViewerPrs> aHighlighted = aDisplayer->GetHighlighted();
+      // refill the features list with avoiding of the features, obtained only by vertex shape (TODO)
+    std::list<XGUI_ViewerPrs> aSelected = aDisplayer->GetSelected(TopAbs_VERTEX);
+    std::list<XGUI_ViewerPrs> aHighlighted = aDisplayer->GetHighlighted(TopAbs_VERTEX);
     aPreviewOp->init(theFeature, aSelected, aHighlighted);
   }
   myWorkshop->actionsMgr()->updateCheckState();
index 3eb66b044ede7782de3871109ce49c41496cde64..7e5deb50ed54333a332d96c841dd1b68a05a78d0 100644 (file)
@@ -55,7 +55,7 @@ void XGUI_Displayer::Display(boost::shared_ptr<ModelAPI_Feature> theFeature,
 }*/
 
 
-std::list<XGUI_ViewerPrs> XGUI_Displayer::GetSelected()
+std::list<XGUI_ViewerPrs> XGUI_Displayer::GetSelected(const int theShapeTypeToSkip)
 {
   std::set<boost::shared_ptr<ModelAPI_Feature> > aPrsFeatures;
   std::list<XGUI_ViewerPrs> aPresentations;
@@ -64,6 +64,8 @@ std::list<XGUI_ViewerPrs> XGUI_Displayer::GetSelected()
   for (aContext->InitSelected(); aContext->MoreSelected(); aContext->NextSelected()) {
     Handle(AIS_InteractiveObject) anIO = aContext->SelectedInteractive();
     TopoDS_Shape aShape = aContext->SelectedShape();
+    if (theShapeTypeToSkip >= 0 && !aShape.IsNull() && aShape.ShapeType() == theShapeTypeToSkip)
+      continue;
 
     boost::shared_ptr<ModelAPI_Feature> aFeature = GetFeature(anIO);
     if (aPrsFeatures.find(aFeature) != aPrsFeatures.end())
@@ -74,7 +76,7 @@ std::list<XGUI_ViewerPrs> XGUI_Displayer::GetSelected()
   return aPresentations;
 }
 
-std::list<XGUI_ViewerPrs> XGUI_Displayer::GetHighlighted()
+std::list<XGUI_ViewerPrs> XGUI_Displayer::GetHighlighted(const int theShapeTypeToSkip)
 {
   std::set<boost::shared_ptr<ModelAPI_Feature> > aPrsFeatures;
   std::list<XGUI_ViewerPrs> aPresentations;
@@ -83,6 +85,8 @@ std::list<XGUI_ViewerPrs> XGUI_Displayer::GetHighlighted()
   for (aContext->InitDetected(); aContext->MoreDetected(); aContext->NextDetected()) {
     Handle(AIS_InteractiveObject) anIO = aContext->DetectedInteractive();
     TopoDS_Shape aShape = aContext->DetectedShape();
+    if (theShapeTypeToSkip >= 0 && !aShape.IsNull() && aShape.ShapeType() == theShapeTypeToSkip)
+      continue;
 
     boost::shared_ptr<ModelAPI_Feature> aFeature = GetFeature(anIO);
     if (aPrsFeatures.find(aFeature) != aPrsFeatures.end())
@@ -122,8 +126,8 @@ void XGUI_Displayer::Redisplay(boost::shared_ptr<ModelAPI_Feature> theFeature,
     aContext->ClearCurrents(false);
     aContext->OpenLocalContext(false/*use displayed objects*/, true/*allow shape decomposition*/);
     // set mouse sensitivity
-    aContext->SetSensitivityMode(StdSelect_SM_WINDOW);
-    aContext->SetPixelTolerance(MOUSE_SENSITIVITY_IN_PIXEL);
+    //aContext->SetSensitivityMode(StdSelect_SM_WINDOW);
+    //aContext->SetPixelTolerance(MOUSE_SENSITIVITY_IN_PIXEL);
   }
   // display or redisplay presentation
   Handle(AIS_Shape) anAIS;
index 080fef76a2ae4ed9e7c691599ec001e6da1fdb78..4dc28389fe72f1c51ebcfdad13b442142625eb50 100644 (file)
@@ -59,12 +59,14 @@ public:
   //             const bool isUpdateViewer = true);
   
   /// Returns a list of viewer selected presentations
+  /// \param theShapeTypeToSkip the shapes with this type will be skipped during the result list build
   /// \return list of presentations
-  std::list<XGUI_ViewerPrs> GetSelected();
+  std::list<XGUI_ViewerPrs> GetSelected(const int theShapeTypeToSkip = -1);
 
   /// Returns a list of viewer highlited presentations
+  /// \param theShapeTypeToSkip the shapes with this type will be skipped during the result list build
   /// \return list of presentations
-  std::list<XGUI_ViewerPrs> GetHighlighted();
+  std::list<XGUI_ViewerPrs> GetHighlighted(const int theShapeTypeToSkip = -1);
 
   /// Display the shape and activate selection of sub-shapes
   /// \param theFeature a feature instance