From: vsv Date: Sat, 28 Apr 2018 07:10:49 +0000 (+0300) Subject: Issue 2110: Do not provide selection for whole compsolid X-Git-Tag: V8_5_0rc2~8^2~14 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4a1eba4f4f276ed7b93e43c4dd0dc13c33b0dffe;hp=a99b44f2a23d23faba4610092ac7929eeed6b06c;p=modules%2Fshaper.git Issue 2110: Do not provide selection for whole compsolid --- 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) {