How to get objects under the given scene coordinates.

Hi,
To find shapes under a rectangle area OCC provides "SelectRectangle" function from AISInteractiveContext which accepts pixel(view) coordinates.
Is there any function to use scene coordinates to get shapes instead of pixel coordinates ? also Is it possible to only find the objects instead of selecting the objects under the given area?

Graphic3d_Vec2i thePntMin(pixMinX, pixMinY);
Graphic3d_Vec2i thePntMax(pixMaxX, pixMaxY);
AIS_StatusOfPick pick = aisContext->SelectRectangle (thePntMin,thePntMax, currentView3d);
// Iterate through the selected owners
for (aisContext->InitSelected(); aisContext->MoreSelected();
aisContext->NextSelected())
{

}

gkv311 n's picture

To avoid selection of the objects - you may try using SelectMgr_ViewerSelector::Pick() directly, instead of AIS_InteractiveContext::Select(), which is returned by AIS_InteractiveContext::MainSelector().

As for picking volume in 3d coordinates - these selection routines were designed for working with active camera, and that's why they deal with pixels, although internally they define volume in 3d space. It would be nice extending this API like Pick() method taking gp_Ax1 introduced in OCCT 7.6.0, but for the moment this cannot be done in a straightforward way.

Of course, you should be also able to implement necessary logic at application side at expense of building an extra BVH tree (depending on your context).