Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0028638Community[OCCT] OCCT:Visualizationpublic2017-04-06 15:462019-04-09 13:35
ReporterVico Liang 
Assigned Tokgv 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0028638: Improve pick performance by applying filter before geometry checking
DescriptionThe below function MoveTo apply filter after the pick operation. The result is no problem but it can be done in more efficient way if the filter is done inside myMainSel.

AIS_StatusOfDetection AIS_InteractiveContext::MoveTo (const Standard_Integer theXPix,
                                                      const Standard_Integer theYPix,
                                                      const Handle(V3d_View)& theView,
                                                      const Standard_Boolean theToRedrawOnUpdate)
  myFilters->SetDisabledObjects (theView->View()->HiddenObjects());
  myMainSel->Pick (theXPix, theYPix, theView);

  // filling of myAISDetectedSeq sequence storing information about detected AIS objects
  // (the objects must be AIS_Shapes)
  const Standard_Integer aDetectedNb = myMainSel->NbPicked();
  Standard_Integer aNewDetected = 0;
  for (Standard_Integer aDetIter = 1; aDetIter <= aDetectedNb; ++aDetIter)
    Handle(SelectMgr_EntityOwner) anOwner = myMainSel->Picked (aDetIter);
    if (anOwner.IsNull()
     || !myFilters->IsOk (anOwner))
TagsNo tags attached.
Test case number
Attached Files

- Relationships
related to 0030641closedbugmaster Open CASCADE Visualization - possibility to select in predefined ZLayers only 

-  Notes
kgv (developer)
2017-04-06 15:56
edited on: 2017-04-06 15:56

> The result is no problem but it can be done in more efficient way
> if the filter is done inside myMainSel.
What do you mean "inside myMainSel", at which step???
Within BVH tree traversal?

Note that within real application selection filters might be computationally intensive.

Vico Liang (developer)
2017-04-06 17:04

1. The first level filter can be applied to SelectMgr_SelectableObject, this level can be done before object BVH tree traversal.
2. The second level filter can be applied to SelectMgr_EntityOwner, this level can be done before geometry checking.

From my point of view, the application filter may not be computationally intensive than geomtry checking. in most real cases, the application filter should be much faster than geometry checking.
Vico Liang (developer)
2017-04-06 17:20

Dear kgv,
You might be right, application filter might be implemented computationlly intensive than geometry checking, The performance will degrade in this case. Is it possible to compare the performance with OCCT internal filters such as StdSelect_EdgeFilter and StdSelect_FaceFilter?
kgv (developer)
2017-04-06 17:33

Dear Vico,

do you have a theoretical consideration, or real use case when picking performance become a real issue for your application?
Vico Liang (developer)
2017-04-07 06:31

Dear kgv,

I don't encounter any picking performance issue so far. When navigating the picking implementation code, the logic is not so common from my experience. Normmally, the filter is applied before geometry intersection checking, since geometry computation is computational intensive, we can exclude objects by filter quickly. anyway, it depends on the geometry intersection algorithm and strategy, in OCCT, there are two level BVH trees, the geometry checking should be much faster i think, so this should be ok to applying filter after geometry intersection checking. If applicatoin filter is implemented much faster than geometry intersection checking, applying filter before geometry checking will improve picking performance. User should be responsible for his code if he implemented a computational intensive filter.

- Issue History
Date Modified Username Field Change
2017-04-06 15:46 Vico Liang New Issue
2017-04-06 15:46 Vico Liang Assigned To => kgv
2017-04-06 15:56 kgv Note Added: 0064990
2017-04-06 15:56 kgv Note Edited: 0064990 View Revisions
2017-04-06 17:04 Vico Liang Note Added: 0064998
2017-04-06 17:20 Vico Liang Note Added: 0064999
2017-04-06 17:26 Vico Liang Note Added: 0065000
2017-04-06 17:28 Vico Liang Note Deleted: 0065000
2017-04-06 17:33 kgv Note Added: 0065003
2017-04-07 06:31 Vico Liang Note Added: 0065007
2017-07-20 11:30 kgv Severity minor => feature
2017-07-20 11:30 kgv Target Version 7.2.0 =>
2019-04-09 13:35 kgv Relationship added related to 0030641

Copyright © 2000 - 2021 MantisBT Team
Powered by Mantis Bugtracker