From b8996402678a0abd58935ebd06b5b9c865b8df7c Mon Sep 17 00:00:00 2001 From: nds Date: Fri, 23 May 2014 09:19:29 +0400 Subject: [PATCH] Commmented the Increase the sensitivity of selection to 10 pixels because vertexes selection do not allow to select edges. Skip vertexes selection during the operation initialization. --- src/PartSet/PartSet_Module.cpp | 5 +++-- src/XGUI/XGUI_Displayer.cpp | 12 ++++++++---- src/XGUI/XGUI_Displayer.h | 6 ++++-- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index 23231b3dc..06e21761f 100644 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -180,8 +180,9 @@ void PartSet_Module::onLaunchOperation(std::string theName, boost::shared_ptrdisplayer(); - std::list aSelected = aDisplayer->GetSelected(); - std::list aHighlighted = aDisplayer->GetHighlighted(); + // refill the features list with avoiding of the features, obtained only by vertex shape (TODO) + std::list aSelected = aDisplayer->GetSelected(TopAbs_VERTEX); + std::list aHighlighted = aDisplayer->GetHighlighted(TopAbs_VERTEX); aPreviewOp->init(theFeature, aSelected, aHighlighted); } myWorkshop->actionsMgr()->updateCheckState(); diff --git a/src/XGUI/XGUI_Displayer.cpp b/src/XGUI/XGUI_Displayer.cpp index 3eb66b044..7e5deb50e 100644 --- a/src/XGUI/XGUI_Displayer.cpp +++ b/src/XGUI/XGUI_Displayer.cpp @@ -55,7 +55,7 @@ void XGUI_Displayer::Display(boost::shared_ptr theFeature, }*/ -std::list XGUI_Displayer::GetSelected() +std::list XGUI_Displayer::GetSelected(const int theShapeTypeToSkip) { std::set > aPrsFeatures; std::list aPresentations; @@ -64,6 +64,8 @@ std::list 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 aFeature = GetFeature(anIO); if (aPrsFeatures.find(aFeature) != aPrsFeatures.end()) @@ -74,7 +76,7 @@ std::list XGUI_Displayer::GetSelected() return aPresentations; } -std::list XGUI_Displayer::GetHighlighted() +std::list XGUI_Displayer::GetHighlighted(const int theShapeTypeToSkip) { std::set > aPrsFeatures; std::list aPresentations; @@ -83,6 +85,8 @@ std::list 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 aFeature = GetFeature(anIO); if (aPrsFeatures.find(aFeature) != aPrsFeatures.end()) @@ -122,8 +126,8 @@ void XGUI_Displayer::Redisplay(boost::shared_ptr 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; diff --git a/src/XGUI/XGUI_Displayer.h b/src/XGUI/XGUI_Displayer.h index 080fef76a..4dc28389f 100644 --- a/src/XGUI/XGUI_Displayer.h +++ b/src/XGUI/XGUI_Displayer.h @@ -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 GetSelected(); + std::list 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 GetHighlighted(); + std::list GetHighlighted(const int theShapeTypeToSkip = -1); /// Display the shape and activate selection of sub-shapes /// \param theFeature a feature instance -- 2.39.2