From 4a1eba4f4f276ed7b93e43c4dd0dc13c33b0dffe Mon Sep 17 00:00:00 2001 From: vsv Date: Sat, 28 Apr 2018 10:10:49 +0300 Subject: [PATCH] Issue 2110: Do not provide selection for whole compsolid --- src/ModuleBase/ModuleBase_ResultPrs.cpp | 57 ++++++++++++------------- 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/src/ModuleBase/ModuleBase_ResultPrs.cpp b/src/ModuleBase/ModuleBase_ResultPrs.cpp index 906834285..fcd859c7c 100755 --- a/src/ModuleBase/ModuleBase_ResultPrs.cpp +++ b/src/ModuleBase/ModuleBase_ResultPrs.cpp @@ -291,35 +291,34 @@ void ModuleBase_ResultPrs::ComputeSelection(const Handle(SelectMgr_Selection)& a return; } - if (theMode == AIS_Shape::SelectionMode(TopAbs_COMPSOLID)) { - // Limit selection area only by actual object (Shape) - ResultCompSolidPtr aCompSolid = ModelAPI_Tools::compSolidOwner(myResult); - if (aCompSolid.get()) { - std::shared_ptr aShapePtr = ModelAPI_Tools::shape(aCompSolid); - if (aShapePtr.get()) { - TopoDS_Shape aShape = aShapePtr->impl(); - int aPriority = StdSelect_BRepSelectionTool::GetStandardPriority(aShape, TopAbs_COMPSOLID); - /// It is important to have priority for the shape of comp solid result less than priority - /// for the presentation shape which is a sub-result. - /// Reason is to select the sub-objects before: #1592 - aPriority = aPriority - 1; - double aDeflection = Prs3d::GetDeflection(aShape, myDrawer); - - Handle(ModuleBase_BRepOwner) aOwner = new ModuleBase_BRepOwner(aShape, aPriority); - StdSelect_BRepSelectionTool::ComputeSensitive(aShape, aOwner, aSelection, - aDeflection, myDrawer->HLRAngle(), 9, 500); - - for (aSelection->Init(); aSelection->More(); aSelection->Next()) { - Handle(SelectMgr_EntityOwner) anOwner = - Handle(SelectMgr_EntityOwner) - ::DownCast(aSelection->Sensitive()->BaseSensitive()->OwnerId()); - anOwner->Set(this); - } - return; - } - } - //AIS_Shape::ComputeSelection(aSelection, 0); - } + // bug 2110: if (theMode == AIS_Shape::SelectionMode(TopAbs_COMPSOLID)) { + // // Limit selection area only by actual object (Shape) + // ResultCompSolidPtr aCompSolid = ModelAPI_Tools::compSolidOwner(myResult); + // if (aCompSolid.get()) { + // std::shared_ptr aShapePtr = ModelAPI_Tools::shape(aCompSolid); + // if (aShapePtr.get()) { + // TopoDS_Shape aShape = aShapePtr->impl(); + // int aPriority = StdSelect_BRepSelectionTool::GetStandardPriority(aShape, TopAbs_COMPSOLID); + // /// It is important to have priority for the shape of comp solid result less than priority + // /// for the presentation shape which is a sub-result. + // /// Reason is to select the sub-objects before: #1592 + // aPriority = aPriority - 1; + // double aDeflection = Prs3d::GetDeflection(aShape, myDrawer); + + // Handle(ModuleBase_BRepOwner) aOwner = new ModuleBase_BRepOwner(aShape, aPriority); + // StdSelect_BRepSelectionTool::ComputeSensitive(aShape, aOwner, aSelection, + // aDeflection, myDrawer->HLRAngle(), 9, 500); + + // for (aSelection->Init(); aSelection->More(); aSelection->Next()) { + // Handle(SelectMgr_EntityOwner) anOwner = + // Handle(SelectMgr_EntityOwner) + // ::DownCast(aSelection->Sensitive()->BaseSensitive()->OwnerId()); + // anOwner->Set(this); + // } + // return; + // } + // } + //} AIS_Shape::ComputeSelection(aSelection, theMode); if (myAdditionalSelectionPriority > 0) { -- 2.39.2