View Issue Details

IDProjectCategoryView StatusLast Update
0023649Open CASCADEOCCT:Visualizationpublic2014-11-11 12:57
ReporterabaAssigned Tobugmaster  
PriorityhighSeverityminor 
Status closedResolutionfixed 
Product Version6.5.4 
Target Version6.8.0Fixed in Version6.8.0 
Summary0023649: Visualization, AIS_LocalContext - make highlighting of already selected objects consistent with and without Shift modifier
DescriptionThere is different behavior of highlighting after shift selection:
1) The first selected sub-shapes (either single-click or by rectangle) will not be highlighted when mouse cursor moves on it/them.
2) After shift selection another selected sub-shapes will be highlight-able.

Reference from source code (AIS_LocalContext_1.cxx):
#define BUC60569 // GG_051199
Enable to select the local context in any case and especially in multi selection mode.
Note that right now when an hilighted owner is selected this owner is unhilighted,this permits to see the selection!

Principle : an owner can have 3 state:
 1 : The owner is selected and no more highlightable
 0 : The owner is NOT selected
-1 : The owner is selected but stay highlightable (NEW)
Additional information
and documentation updates
Dynamic highlighting of already selected objects now controlled by AIS_InteractiveContext::ToHilightSelected() flag within within AIS_LocalContext as well and does not affected by Shift modifier (this behavior might be implemented on application level using ::SetHilightSelected() method).

Added new DrawHarness command vhighlightselected to control AIS_InteractiveContext::ToHilightSelected() flag.
TagsNo tags attached.
Test case numberbugs vis bug23649_1, bugs vis bug23649_2, bugs vis bug23649_3, bugs vis bug23649_4

Relationships

related to 0023539 closedaba QASelect and QAShiftSelect commands 
related to 0024623 closedbugmaster Visualization - improve selection mechanism 

Activities

san

2012-12-19 13:56

developer   ~0022768

Last edited: 2012-12-19 13:57

The proposed solution:

1. Keep only 0 (not selected) and 1 (selected) states for SelectMgr_EntityOwner, eliminate -1 state ("selected but still highlightable").
2. By default, detected objects (in both neutral point and local context) should always be highlighted, no matter if they are selected or not.
3. Consider possibility to introduce SelectMgr_StateFilter selection filter class that should pass the entity owners with a given state. Add this filter to the interactive context in ViewerTest package to illustrate how only non-selected objects can be highlighted. This filter should be enabled by default in DRAW test 3D view and disabled when the user moves the mouse with <Shift> key pressed. Also vmoveto command should be extended taking this into account.
4. Provide detailed explanation of the highlighting improvement in Git commit message to give a hint to the users how to adjust the highlighting behavior in their applications if necessary.

kgv

2014-07-29 21:03

developer   ~0030477

> Consider possibility to introduce SelectMgr_StateFilter
> selection filter class that should pass the entity owners with a given state.
Concerning additional filter, it has been considered redundant.
Simple flag to support two modes (highlight always, and highlight only not selected) would be sufficient for most applications.

Special cases should be implemented by general selection filter. E.g., if application implements Add selection mode - selection filter should discard all already selected entities; if application implements Remove selection mode - selection filter should allow only selected entities.

This is already possible (and actually used in at least one project).
But states (as numbers -1 0 1) are not documented in public API and their usage outside AIS_InteractiveContext/AIS_LocalContext might be considered not safe.

git

2014-07-30 12:03

administrator   ~0030487

Branch CR23649 has been created by aba.

SHA-1: 0fc34e9387d77c23ffb1bacc22812484a568949f

aba

2014-07-30 15:03

developer   ~0030494

Last edited: 2014-07-31 10:54

The git branch CR23649 is ready for review:

1) SelectMgr_EntityOwner::State() method was replaced with SelectMgr_EntityOwner::IsSelected() and SelectMgr_EntityOwner::MakeSelected()
to determine if corresponding entity is selected.

2) AIS_InteractiveContext::ToHilightSelected() and AIS_InteractiveContext::SetToHilightSelected() is to be used to enable highlighting of selected objects.

3) By default selected objects are not highlighted (old behavior).

4) ViewerTest_ViewerCommands: vhighlightselected command was added to enable/disable 'highlight selected objects' mode.

5) AIS_LocalContext, AIS_InteractiveContext : style changes in Select and ShiftSelect methods.

6) test cases /bugs/vis bug23649_1 and /bugs/vis bug23649_2 were added.


Dear kgv,

please review.

kgv

2014-07-30 21:39

developer   ~0030499

Dear Anastasia,

please add the similar test cases for hilighting in non-local selection mode.

>> 2) AIS_InteractiveContext::ToSelectHilighted() and AIS_InteractiveContext::SetToHilightSelected() is to be used to enable highlighting of selected objects.
There is no ToSelectHilighted() method in AIS_InteractiveContext.

git

2014-08-01 15:42

administrator   ~0030523

Branch CR23649 has been updated forcibly by aba.

SHA-1: 927f32abacf9a89b3be0773cd3f67bf969adf7c7

aba

2014-08-01 15:43

developer   ~0030524

The branch CR23649 was updated.

Dear kgv,

please review.

git

2014-08-01 15:58

administrator   ~0030525

Branch CR23649 has been updated forcibly by aba.

SHA-1: f42ceff988c3c565e32eba75e22d8c043a1613c5

git

2014-08-01 16:05

administrator   ~0030526

Branch CR23649 has been updated by aba.

SHA-1: ef15d610029c6f2910e1a344a3149d255dbdf935

kgv

2014-08-01 16:41

developer   ~0030531

Please test the patch.

git

2014-08-01 17:16

administrator   ~0030534

Branch CR23649 has been updated forcibly by apv.

SHA-1: 6ec038e5fc28cea4e5c07f86c31b10c12d8a556c

apv

2014-08-05 11:42

tester   ~0030568

Dear BugMaster,

Branch CR23649 (and products from GIT master) was compiled on Linux, MacOS and Windows platforms and tested.
SHA-1: 6ec038e5fc28cea4e5c07f86c31b10c12d8a556c

Number of compiler warnings:
occt component:
   Linux: 15 (15 on master)
   Windows: 0 (0 on master)
   MacOS: 196 (196 on master)
products component :
   Linux: 11 (11 on master)
   Windows: 1 (1 on master)

Regressions/Differences:
http://occt-tests/CR23649-master-occt/Debian60-64/summary.html
http://occt-tests/CR23649-master-occt/Windows-32-VC10/summary.html
bugs vis bug597_3
bugs vis bug597_6

Testing cases:
Absent

Testing on Linux:
Total MEMORY difference: 351918376 / 351718880
Total CPU difference: 45176.320000000225 / 46258.30000000032

Testing on Windows:
Total MEMORY difference: 239185724 / 239641860
Total CPU difference: 28839.984375 / 30707.734375

There are differences in images found by testdiff:
http://occt-tests/CR23649-master-occt/Debian60-64/diff-Debian60-64.html
http://occt-tests/CR23649-master-occt/Windows-32-VC10/diff-Windows-32-VC10.html

git

2014-08-07 16:06

administrator   ~0030622

Branch CR23649 has been updated by aba.

SHA-1: 6ce4a30e242f0844cca4dac733bb57b054048e75


      from 6ec038e Remarks
       new 6ce4a30 Updated test cases


Detailed log of new commits:

commit 6ce4a30e242f0844cca4dac733bb57b054048e75
Author: aba
Date: Thu Aug 7 16:05:53 2014 +0400

    Updated test cases

kgv

2014-08-07 16:41

developer   ~0030623

Please integrate.

aba

2014-08-07 16:45

developer   ~0030624

Dear Bugmaster,

test cases bugs/vis/bug597_3 and bugs/vis/bug597_6 were updated to support old behavior.

Could you please run tests once more?

Additionally, the behavior of highlighting has been changed: by default shift-selected sub-shapes are not highlighted.
Could you please update images of test cases from v3d tests (on which differences were found)?

abv

2014-08-08 08:48

manager   ~0030628

Please reconsider this:

> Additionally, the behavior of highlighting has been changed: by default shift-selected sub-shapes are not highlighted.
> Could you please update images of test cases from v3d tests (on which differences were found)?

It would be more consistent to have all selectable objects always dynamically highlighted. The purpose of highlighting is to inform the user which entity will be hit if mouse button is clicked at that position. The behavior of selection (will this object be selected or not as the result) is defined by application, it is not a job of the viewer class to decide on that and change highlighting behavior basing on such guesses.

git

2014-08-11 15:22

administrator   ~0030653

Branch CR23649 has been updated forcibly by aba.

SHA-1: 84e4fd7e267d46930cc4c24895e9cee91fc5aa84

aba

2014-08-11 16:11

developer   ~0030658

The git branch CR23649 was updated:

- default behavior was changed: all selected objects are highlighted by default.
This behavior can be changed with AIS_InteractiveContext::SetToHilightSelected() method or with draw command vhighlightselected.
- test case /bugs/vis/bug597_2 was updated.

Dear kgv,

please review.

kgv

2014-08-12 11:21

developer   ~0030671

Please test.

apv

2014-08-13 15:23

tester   ~0030720

Dear BugMaster,

Branch CR23649 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
SHA-1: 84e4fd7e267d46930cc4c24895e9cee91fc5aa84

Number of compiler warnings:
occt component:
   Linux: 15 (15 on master)
   Windows: 0 (0 on master)
products component :
   Linux: 11 (11 on master)
   Windows: 1 (1 on master)

Regressions/Differences:
Not detected

Testing cases:
bugs vis bug23649_1 - OK
http://occt-tests/CR23649-master-occt/Windows-32-VC10/bugs/vis/bug23649_1.html
http://occt-tests/CR23649-master-occt/Debian60-64/bugs/vis/bug23649_1.html
bugs vis bug23649_2 - OK
http://occt-tests/CR23649-master-occt/Windows-32-VC10/bugs/vis/bug23649_2.html
http://occt-tests/CR23649-master-occt/Debian60-64/bugs/vis/bug23649_2.html
bugs vis bug23649_3 - OK
http://occt-tests/CR23649-master-occt/Windows-32-VC10/bugs/vis/bug23649_3.html
http://occt-tests/CR23649-master-occt/Debian60-64/bugs/vis/bug23649_3.html
bugs vis bug23649_4 - OK
http://occt-tests/CR23649-master-occt/Windows-32-VC10/bugs/vis/bug23649_4.html
http://occt-tests/CR23649-master-occt/Debian60-64/bugs/vis/bug23649_4.html

Testing on Linux:
Total MEMORY difference: 351872596 / 351869736
Total CPU difference: 45232.360000000284 / 43716.430000000044

Testing on Windows:
Total MEMORY difference: 239353720 / 239709320
Total CPU difference: 29007.125 / 28459.0625

There are differences in images found by testdiff:
http://occt-tests/CR23649-master-occt/Debian60-64/diff-Debian60-64.html
http://occt-tests/CR23649-master-occt/Windows-32-VC10/diff-Windows-32-VC10.html

git

2014-08-18 11:07

administrator   ~0030813

Branch CR23649 has been deleted by inv.

SHA-1: 84e4fd7e267d46930cc4c24895e9cee91fc5aa84

Related Changesets

occt: master c398b00e

2014-08-14 08:20:09

aba


Committer: bugmaster Details Diff
0023649: Visualization, AIS_LocalContext - make highlighting of already selected objects consistent with and without Shift modifier

1) Add SelectMgr_EntityOwner::IsSelected() and SelectMgr_EntityOwner::SetSelected() methods to determine if corresponding entity is selected.
They replace functionality of SelectMgr_EntityOwner::State() methods that are deprecated now.
2) AIS_InteractiveContext::ToHilightSelected() and AIS_InteractiveContext::SetToHilightSelected() is to be used to enable highlighting of selected objects.
3) By default selected objects are highlighted (new behavior)
4) Add ViewerTest_ViewerCommands: vhighlightselected command to enable/disable 'highlight selected objects' mode.
5) AIS_LocalContext, AIS_InteractiveContext : style changes in Select and ShiftSelect methods.
6) Add test cases /bugs/vis bug23649_1 and /bugs/vis bug23649_2 to test highlighting of selected objects in local context.
7) Add test cases /bugs/vis bug23649_3 and /bugs/vis bug23649_4 to test highlighting of selected objects in neutral point.

Updated test case
Affected Issues
0023649
mod - src/AIS/AIS_InteractiveContext.cxx Diff File
mod - src/AIS/AIS_InteractiveContext_1.cxx Diff File
mod - src/AIS/AIS_LocalContext.cdl Diff File
mod - src/AIS/AIS_LocalContext.cxx Diff File
mod - src/AIS/AIS_LocalContext_1.cxx Diff File
mod - src/MeshVS/MeshVS_MeshOwner.cxx Diff File
mod - src/SelectMgr/SelectMgr_EntityOwner.cdl Diff File
mod - src/SelectMgr/SelectMgr_EntityOwner.cxx Diff File
mod - src/SelectMgr/SelectMgr_EntityOwner.lxx Diff File
mod - src/ViewerTest/ViewerTest_EventManager.cdl Diff File
mod - src/ViewerTest/ViewerTest_EventManager.cxx Diff File
mod - src/ViewerTest/ViewerTest_ViewerCommands.cxx Diff File
add - tests/bugs/vis/bug23649_1 Diff File
add - tests/bugs/vis/bug23649_2 Diff File
add - tests/bugs/vis/bug23649_3 Diff File
add - tests/bugs/vis/bug23649_4 Diff File
mod - tests/bugs/vis/bug597_2 Diff File

Issue History

Date Modified Username Field Change
2012-12-17 16:52 aba New Issue
2012-12-17 16:52 aba Assigned To => aba
2012-12-17 16:53 aba Relationship added related to 0023539
2012-12-19 13:56 san Note Added: 0022768
2012-12-19 13:57 san Note Edited: 0022768
2012-12-19 14:02 san Status new => assigned
2012-12-19 14:03 san Target Version => 6.6.0
2013-02-26 18:16 san Target Version 6.6.0 => 6.7.0
2013-12-12 11:19 san Target Version 6.7.0 => 6.7.1
2014-02-17 16:12 kgv Relationship added related to 0024623
2014-02-17 16:12 kgv OS VC++ 2005 =>
2014-02-17 16:12 kgv OS Version 32 bit =>
2014-02-17 16:12 kgv Platform Windows =>
2014-02-17 16:12 kgv Target Version 6.7.1 => 7.0.0
2014-03-29 13:24 kgv Description Updated
2014-06-11 14:41 kgv Priority normal => high
2014-06-11 14:41 kgv Target Version 7.0.0 => 6.8.0
2014-07-29 21:03 kgv Note Added: 0030477
2014-07-30 12:03 git Note Added: 0030487
2014-07-30 15:03 aba Note Added: 0030494
2014-07-30 15:03 aba Assigned To aba => kgv
2014-07-30 15:03 aba Status assigned => resolved
2014-07-30 21:39 kgv Note Added: 0030499
2014-07-30 21:39 kgv Assigned To kgv => aba
2014-07-30 21:39 kgv Status resolved => assigned
2014-07-31 10:54 aba Note Edited: 0030494
2014-07-31 18:53 kgv Summary Different behavior of highlighting after shift selection => Visualization, AIS_LocalContext - make highlighting of already selected objects consistent with and without Shift modifier
2014-07-31 18:53 kgv Additional Information Updated
2014-08-01 15:42 git Note Added: 0030523
2014-08-01 15:43 aba Note Added: 0030524
2014-08-01 15:43 aba Assigned To aba => kgv
2014-08-01 15:43 aba Status assigned => resolved
2014-08-01 15:58 git Note Added: 0030525
2014-08-01 16:05 git Note Added: 0030526
2014-08-01 16:41 kgv Note Added: 0030531
2014-08-01 16:41 kgv Assigned To kgv => bugmaster
2014-08-01 16:41 kgv Status resolved => reviewed
2014-08-01 17:16 git Note Added: 0030534
2014-08-05 11:42 apv Note Added: 0030568
2014-08-05 11:44 apv Assigned To bugmaster => aba
2014-08-05 11:44 apv Status reviewed => assigned
2014-08-07 16:06 git Note Added: 0030622
2014-08-07 16:37 aba Status assigned => resolved
2014-08-07 16:41 kgv Note Added: 0030623
2014-08-07 16:41 kgv Assigned To aba => bugmaster
2014-08-07 16:41 kgv Status resolved => reviewed
2014-08-07 16:45 aba Note Added: 0030624
2014-08-08 08:48 abv Note Added: 0030628
2014-08-08 08:48 abv Assigned To bugmaster => aba
2014-08-08 08:48 abv Status reviewed => assigned
2014-08-11 15:22 git Note Added: 0030653
2014-08-11 16:11 aba Note Added: 0030658
2014-08-11 16:11 aba Assigned To aba => kgv
2014-08-11 16:11 aba Status assigned => resolved
2014-08-12 11:21 kgv Note Added: 0030671
2014-08-12 11:21 kgv Assigned To kgv => bugmaster
2014-08-12 11:21 kgv Status resolved => reviewed
2014-08-12 12:31 bugmaster Assigned To bugmaster => apv
2014-08-12 14:04 apv Test case number => bugs vis 25099
2014-08-12 14:15 apv Test case number bugs vis 25099 =>
2014-08-13 11:00 apv Test case number => bugs vis bug23649_1, bugs vis bug23649_2, bugs vis bug23649_3, bugs vis bug23649_4
2014-08-13 15:23 apv Note Added: 0030720
2014-08-13 15:27 apv Assigned To apv => bugmaster
2014-08-13 15:27 apv Status reviewed => tested
2014-08-15 11:25 bugmaster Changeset attached => occt master c398b00e
2014-08-15 11:25 bugmaster Status tested => verified
2014-08-15 11:25 bugmaster Resolution open => fixed
2014-08-18 11:07 git Note Added: 0030813
2014-11-11 12:46 aiv Fixed in Version => 6.8.0
2014-11-11 12:57 aiv Status verified => closed