View Issue Details

IDProjectCategoryView StatusLast Update
0028638CommunityOCCT:Visualizationpublic2021-03-20 14:10
ReporterVico Liang Assigned Tobugmaster  
PrioritynormalSeverityfeature 
Status closedResolutionno change required 
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))
    {
      continue;
    }
    ...
TagsNo tags attached.
Test case number

Relationships

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

Activities

kgv

2017-04-06 15:56

developer   ~0064990

Last edited: 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

2017-04-06 17:04

developer   ~0064998

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

2017-04-06 17:20

developer   ~0064999

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

2017-04-06 17:33

developer   ~0065003

Dear Vico,

do you have a theoretical consideration, or real use case when picking performance become a real issue for your application?

Vico Liang

2017-04-07 06:31

developer   ~0065007

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.

kgv

2021-03-02 15:31

developer   ~0099288

Lets close the issue - could be reopened / created new one if there will be scenario where such option will boost performance.

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
2017-04-06 17:04 Vico Liang Note Added: 0064998
2017-04-06 17:20 Vico Liang Note Added: 0064999
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
2021-03-02 15:31 kgv Note Added: 0099288
2021-03-02 15:31 kgv Assigned To kgv => bugmaster
2021-03-02 15:31 kgv Status new => feedback
2021-03-02 15:31 kgv Resolution open => no change required
2021-03-20 14:10 bugmaster Status feedback => closed