1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0026147: Visualization - restore the ability to pick only fully included objects in rectangular selection

2 modes of rectangular selection are available: inclusion-only and overlap-allowing;
The modes can be switched using method AllowOverlapDetection from StdSelect_ViewerSelector3d;
BVH for sensitive entities now builds if there is more than max number of leafs in collection;
Added option -allowoverlap to command vselect;
Interactive rectangular selection in Draw is now available in 2 modes:
- if the user starts selection from upper corners, only fully included objects will be selected;
- if the user starts selection from lower corners, both partially and fully overlapped objects will be selected.
This commit is contained in:
vpa
2015-05-07 18:53:21 +03:00
committed by abv
parent 35c4a17c46
commit 2157d6ac63
44 changed files with 728 additions and 547 deletions

View File

@@ -314,8 +314,7 @@ Standard_Boolean Select3D_SensitiveGroup::overlapsElement (SelectBasics_Selectin
theMatchDepth = RealLast();
const Standard_Integer aSensitiveIdx = myBVHPrimIndexes.Value (theElemIdx);
SelectBasics_PickResult aResult;
Standard_Boolean isMatching = myEntities.Value (aSensitiveIdx)->Matches (theMgr, aResult);
if (isMatching)
if (myEntities.Value (aSensitiveIdx)->Matches (theMgr, aResult))
{
theMatchDepth = aResult.Depth();
return Standard_True;
@@ -324,6 +323,17 @@ Standard_Boolean Select3D_SensitiveGroup::overlapsElement (SelectBasics_Selectin
return Standard_False;
}
// =======================================================================
// function : elementIsInside
// purpose :
// =======================================================================
Standard_Boolean Select3D_SensitiveGroup::elementIsInside (SelectBasics_SelectingVolumeManager& theMgr,
const Standard_Integer theElemIdx)
{
Standard_Real aDummy;
return overlapsElement(theMgr, theElemIdx, aDummy);
}
// =======================================================================
// function : distanceToCOG
// purpose : Calculates distance from the 3d projection of used-picked