1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-19 13:40:49 +03:00

0032978: Visualization - AIS_ViewController::PickPoint() includes objects invisible in current View

SelectMgr_ViewerSelector::TraverseSensitives() now takes into account object's view affinity.
AIS_InteractiveContext::moveTo() - dropped code SelectMgr_AndOrFilter::SetDisabledObjects()
as filtering is now done by selector itself.

ViewAffinity property has been moved to PrsMgr_PresentableObject for simplicity.
Removed redundant map Graphic3d_CView::HiddenObjects().
This commit is contained in:
kgv
2022-05-21 17:18:43 +03:00
parent 84d39c06fa
commit 86d6c284c2
14 changed files with 97 additions and 59 deletions

View File

@@ -626,7 +626,7 @@ void SelectMgr_ViewerSelector::traverseObject (const Handle(SelectMgr_Selectable
// purpose : Traverses BVH containing all added selectable objects and
// finds candidates for further search of overlap
//=======================================================================
void SelectMgr_ViewerSelector::TraverseSensitives()
void SelectMgr_ViewerSelector::TraverseSensitives (const Standard_Integer theViewId)
{
SelectMgr_BVHThreadPool::Sentry aSentry (myBVHThreadPool);
@@ -750,14 +750,16 @@ void SelectMgr_ViewerSelector::TraverseSensitives()
}
else
{
Standard_Integer aStartIdx = aBVHTree->BegPrimitive (aNode);
Standard_Integer anEndIdx = aBVHTree->EndPrimitive (aNode);
const Standard_Integer aStartIdx = aBVHTree->BegPrimitive (aNode);
const Standard_Integer anEndIdx = aBVHTree->EndPrimitive (aNode);
for (Standard_Integer anIdx = aStartIdx; anIdx <= anEndIdx; ++anIdx)
{
const Handle(SelectMgr_SelectableObject)& aSelectableObject =
mySelectableObjects.GetObjectById (aBVHSubset, anIdx);
traverseObject (aSelectableObject, aMgr, aCamera, aProjectionMat, aWorldViewMat, aWinSize);
const Handle(SelectMgr_SelectableObject)& aSelObj = mySelectableObjects.GetObjectById (aBVHSubset, anIdx);
const Handle(Graphic3d_ViewAffinity)& aViewAffinity = aSelObj->ViewAffinity();
if (theViewId == -1 || aViewAffinity->IsVisible (theViewId))
{
traverseObject (aSelObj, aMgr, aCamera, aProjectionMat, aWorldViewMat, aWinSize);
}
}
if (aHead < 0)
{
@@ -1175,7 +1177,7 @@ void SelectMgr_ViewerSelector::Pick (const Standard_Integer theXPix,
mySelectingVolumeMgr.BuildSelectingVolume();
mySelectingVolumeMgr.SetViewClipping (theView->ClipPlanes(), Handle(Graphic3d_SequenceOfHClipPlane)(), NULL);
TraverseSensitives();
TraverseSensitives (theView->View()->Identification());
}
//=======================================================================
@@ -1204,7 +1206,7 @@ void SelectMgr_ViewerSelector::Pick (const Standard_Integer theXPMin,
mySelectingVolumeMgr.BuildSelectingVolume();
mySelectingVolumeMgr.SetViewClipping (theView->ClipPlanes(), Handle(Graphic3d_SequenceOfHClipPlane)(), NULL);
TraverseSensitives();
TraverseSensitives (theView->View()->Identification());
}
//=======================================================================
@@ -1224,7 +1226,7 @@ void SelectMgr_ViewerSelector::Pick (const TColgp_Array1OfPnt2d& thePolyline,
mySelectingVolumeMgr.BuildSelectingVolume();
mySelectingVolumeMgr.SetViewClipping (theView->ClipPlanes(), Handle(Graphic3d_SequenceOfHClipPlane)(), NULL);
TraverseSensitives();
TraverseSensitives (theView->View()->Identification());
}
//=======================================================================
@@ -1240,7 +1242,7 @@ void SelectMgr_ViewerSelector::Pick (const gp_Ax1& theAxis,
mySelectingVolumeMgr.BuildSelectingVolume();
mySelectingVolumeMgr.SetViewClipping (theView->ClipPlanes(), Handle(Graphic3d_SequenceOfHClipPlane)(), NULL);
TraverseSensitives();
TraverseSensitives (theView->View()->Identification());
}
//=======================================================================

View File

@@ -325,7 +325,7 @@ protected:
//! Traverses BVH containing all added selectable objects and
//! finds candidates for further search of overlap
Standard_EXPORT void TraverseSensitives();
Standard_EXPORT void TraverseSensitives (const Standard_Integer theViewId = -1);
//! Internal function that checks if there is possible overlap between some entity of selectable object theObject and
//! current selecting volume.