DiscussionsIssue archiveOCCT:Visualization

Archived issue #0030695

Visualization - selection by box should use clipping planes set for viewer

Open CASCADEOCCT:Visualizationclosed13 public notes

Search issues

Description

In case when clipping planes are set on viewer, selection by rectangle returns hidden objects as selected.

Steps to reproduce

pload ALL
vinit View1

box b 10 10 10
vdisplay b

box b1 -5 0 0 2 2 2
vdisplay b1

box b2 13 0 0 2 2 2
vdisplay b2

box b3 16 0 0 2 2 2
vdisplay b3

vsetdispmode 1

vtop
vfit
vzoom 0.5
vselect 40 100 370 300
vnbselected

vclipplane create pln
vclipplane set pln view Driver1/Viewer1/View1
vclipplane change pln equation -1 0 0 5

vselect 40 100 370 300
vnbselected

vselect 40 100 370 300 -allowoverlap 1
vnbselected

Public activity

13 archived notes

Participants are labeled by their role within this record.

01Commenter 2
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Fri May 24 16:06:20 2019 +0300

    0030695: Visualization - selection by box should use clipping planes set for viewer - moving check on touching the clipping plane in selection only.
    
    (cherry picked from [revision removed])
    (cherry picked from [revision removed])
    
    # Conflicts:
    # src/SelectMgr/SelectMgr_ViewerSelector.cxx
    (cherry picked from [revision removed])
    
    # Conflicts:
    # src/SelectMgr/SelectMgr_ViewerSelector.cxx
02Commenter 2
Branch [archived branch] has been updated by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Tue Aug 6 06:51:57 2019 +0300

    0030695: Visualization - selection by box should use clipping planes set for viewer - moving check on touching the clipping plane in selection only.
    
    # compilation correction, clear code for review

03Commenter 2
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Fri May 24 16:06:20 2019 +0300

    0030695: Visualization - selection by box should use clipping planes set for viewer - moving check on touching the clipping plane in selection only.
04Author
Dear Kirill,

please, review.
http://jenkins-test-12.nnov.opencascade.com/view/CR30695-master-NDS/

[signature removed]Natalia
05Commenter 2
Branch [archived branch] has been updated by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Tue Aug 6 11:18:53 2019 +0300

    0030695: Visualization - selection by box should use clipping planes set for viewer - moving check on touching the clipping plane in selection only.
    
    #removes warnings

06Commenter 3
+  // in case of Box/Polyline selection - keep only Owners having all Entities detected
+  if (!theMgr.ViewClipping().IsNull() &&
+      theMgr.GetActiveSelectionType() == SelectBasics_SelectingVolumeManager::Box)
+  {
+    Graphic3d_BndBox3d aBBox (aSensitivesTree->MinPoint (0), aSensitivesTree->MaxPoint (0));
+    // If box selection is active, and the whole sensitive tree is out of the clip planes
+    // selection is empty for this object
+    const Handle(Graphic3d_SequenceOfHClipPlane)& aViewPlanes = theMgr.ViewClipping();
...
+  }
+ 
   if (!theObject->ClipPlanes().IsNull()
     && theObject->ClipPlanes()->ToOverrideGlobal())

It doesn't make sense discarding object by View clipping planes BEFORE ToOverrideGlobal() flag is handled.
Please also remove the first comment - it is confusing there, because this block is intended for optimization to discard selection of entire object by clipping planes.
In addition, why only SelectBasics_SelectingVolumeManager::Box is handled, while comment considers also SelectBasics_SelectingVolumeManager::Polyline?


-          const Handle(Select3D_SensitiveEntity)& anEnt = aSensitive->BaseSensitive();
+            const Handle(SelectBasics_SensitiveEntity)& anEnt = aSensitive->BaseSensitive();

Unrelated.

+vselect 40 100 370 300
+vnbselected
+
+vselect 40 100 370 300 -allowoverlap 1
+vnbselected

Test case uses vnbselected without actually checking result.
07Commenter 2
Branch [archived branch] has been updated by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Wed Aug 7 09:35:06 2019 +0300

    0030695: Visualization - selection by box should use clipping planes set for viewer - moving check on touching the clipping plane in selection only.
    
    #remarks correction

08Commenter 2
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Wed Aug 7 09:42:33 2019 +0300

    0030695: Visualization - selection by box should use clipping planes set for viewer - moving check on touching the clipping plane in selection only.
09Author
Dear Kirill,

corrected, please review.
Job: http://jenkins-test-12.nnov.opencascade.com/view/CR30695-master-NDS/

[signature removed]Natalia
10Commenter 1
Combination -
OCCT branch : [archived branch]
master SHA - [revision removed]
[revision removed]
Products branch : [archived branch] SHA - [revision removed]
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian80-64:
OCCT
Total CPU difference: 16231.23000000001 / 16237.229999999976 [-0.04%]
Products
Total CPU difference: 10520.260000000031 / 10493.010000000033 [+0.26%]
Windows-64-VC14:
OCCT
Total CPU difference: 17662.71875 / 17592.765625 [+0.40%]
Products
Total CPU difference: 12076.0625 / 12065.453125 [+0.09%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
11Commenter 2
Branch [archived branch] has been deleted by Participant.

[revision removed]
12Commenter 2
Branch [archived branch] has been deleted by Participant.

[revision removed]
13Commenter 2
Branch [archived branch] has been deleted by Participant.

[revision removed]