View Issue Details

IDProjectCategoryView StatusLast Update
0027957Open CASCADEOCCT:Visualizationpublic2021-06-23 10:27
Reporterkgv Assigned Toapn  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version6.9.0 
Target Version7.1.0Fixed in Version7.1.0 
Summary0027957: Visualization, AIS_InteractiveContext - protect from displaying the same AIS_InteractiveObject within multiple contexts
DescriptionOriginal implementation provides some means for displaying the same AIS_InteractiveObject in several AIS_InteractiveContext at once - e.g. PrsMgr_PresentationManager explicitly checks if presentation was created by the same manager.

This feature might sound useful in some scenarios, however underlying implementation still implies several limitations like inability to define different presentation aspects, inability to share presentation structures when it is possible (to avoid memory duplication) and potentially broken logic that can be written based on AIS_InteractiveContext stored in the object after first display.

Furthermore, this feature has been broken after redesigned Selection manager - the object detection does not work anymore within extra AIS_InteractiveContext contexts. The local reason is that SelectMgr_SelectionManager considers existing SelectMgr_Selection within the object as managed by only one SelectMgr_SelectionManager, and as result, selection entities are not registered within another SelectMgr_SelectionManager instances.

It is suggested not to fix limitations of SelectMgr_SelectionManager, but instead add the protection against such use cases by throwing an exception on attempt to display the object in more than a one context.
Steps To Reproduce
pload MODELING
pload VISUALIZATION
box b 1 2 3
vinit drv1/v1/v1
vdisplay b
vfit
vinit drv2/v1/v1
vdisplay b
vfit

Bug: the object is not selectable on the view - this is regression after 0024623.
TagsNo tags attached.
Test case numberNot needed

Relationships

related to 0024623 closedbugmaster Open CASCADE Visualization - improve selection mechanism 
related to 0024141 assignedvpozdyayev Open CASCADE Draw Harness, ViewerTest - AIS_InteractiveContext should be explicitly cleared before removal 
parent of 0032456 newvpozdyayev Open CASCADE Draw Harness, ViewerTest - map of interactive objects GetMapOfAIS() should be bound to active AIS_InteractiveContext 
related to 0025341 closedapn Open CASCADE Visualization - disallow displaying object as part of connected one and as a free one at the same time 
Not all the children of this issue are yet resolved or closed.

Activities

git

2016-10-13 15:29

administrator   ~0058667

Branch CR27957 has been created by kgv.

SHA-1: cb1e351f5789507c16159ef39c7bf3595f799419


Detailed log of new commits:

Author: kgv
Date: Thu Oct 13 15:24:23 2016 +0300

    0027957: Visualization, AIS_InteractiveContext - protect from displaying the same AIS_InteractiveObject within multiple contexts
    
    AIS_InteractiveContext methods adding object to the context now throws Standard_ProgramError exception
    if object has been already displayed in another context.
    AIS_InteractiveContext::Remove() now NULLifies context assigned to the object.
    
    AIS_InteractiveContext now inherits from Standard_Transient instead of deprecated MMgt_TShared
    and defines C++ destructor instead of method Delete().
    
    AIS_InteractiveObject - undocumented property State() has been removed.
    Undocumented property Users() has been moved to AIS_IdenticRelation.
    
    Draw Harness command vclose now clear AIS_InteractiveContext content
    before nullifying it to ensure that objects have been properly removed.
    
    AIS_MultipleConnectedInteractive now overrides method ::SetContext
    to assign context for children objects.

kgv

2016-10-13 15:30

developer   ~0058668

Patch is ready for review.
Test case is not needed.

san

2016-10-13 19:39

developer   ~0058690

Branch CR27957 reviewed without remarks, ready for testing.

git

2016-10-14 14:24

administrator   ~0058722

Branch CR27957 has been updated forcibly by mkv.

SHA-1: b01aeae62948f94b324f5f38aae2bfaa4d849a8e

mkv

2016-10-17 12:54

tester   ~0058779

Dear BugMaster,
Branch CR27957 was rebased on current master of occt git-repository.
SHA-1: b01aeae62948f94b324f5f38aae2bfaa4d849a8e

mkv

2016-10-17 12:55

tester   ~0058780

Dear BugMaster,
Branch CR27957 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested on Release mode.
SHA-1: b01aeae62948f94b324f5f38aae2bfaa4d849a8e

Number of compiler warnings:

occt component :
Linux: 0 (0 on master)
Windows: 0 (0 on master)
MacOS : 0 (0 on master)

products component :
Linux: 63 (63 on master)
Windows: 0 (0 on master)
MacOS : 1112

Regressions/Differences/Improvements:
http://occt-tests/CR27957-master-OCCT/Debian70-64/summary.html
http://occt-tests/CR27957-master-OCCT/Windows-64-VC10/summary.html
Failed:
  bugs vis bug2883_2, bug23670_1, bug24133_2, bug24133_3, bug24133_4, bug24837_1

Testing cases:
Not needed

Testing on Linux:
occt component :
Total MEMORY difference: 91156010 / 90514040 [+0.71%]
Total CPU difference: 19306.089999999822 / 19463.159999999938 [-0.81%]
products component :
Total MEMORY difference: 30086556 / 30069397 [+0.06%]
Total CPU difference: 5297.899999999984 / 5271.849999999968 [+0.49%]

Testing on Windows:
occt component :
Total MEMORY difference: 57238371 / 57250244 [-0.02%]
Total CPU difference: 19020.031922498685 / 18101.186032498666 [+5.08%]
products component :
Total MEMORY difference: 21302073 / 21265221 [+0.17%]
Total CPU difference: 5094.743058399964 / 5148.189000999964 [-1.04%]

There are no differences in images found by testdiff.

mkv

2016-10-17 12:55

tester   ~0058781

Dear kgv,
Branch CR27957 has been rejected due to:
- regressions/differences/improvements

git

2016-10-17 15:09

administrator   ~0058798

Branch CR27957 has been updated by kgv.

SHA-1: e201426254f82c3d7f006a70d76a5c34ac4afb05


Detailed log of new commits:

Author: kgv
Date: Mon Oct 17 15:07:31 2016 +0300

    fix regressions

git

2016-10-17 15:12

administrator   ~0058799

Branch CR27957_1 has been created by kgv.

SHA-1: 4fd66b90ce5d05fde4b8e194cde63e5c416289c0


Detailed log of new commits:

Author: kgv
Date: Thu Oct 13 15:24:23 2016 +0300

    0027957: Visualization, AIS_InteractiveContext - protect from displaying the same AIS_InteractiveObject within multiple contexts
    
    AIS_InteractiveContext methods adding object to the context now throws Standard_ProgramError exception
    if object has been already displayed in another context.
    AIS_InteractiveContext::Remove() now NULLifies context assigned to the object.
    
    AIS_InteractiveContext now inherits from Standard_Transient instead of deprecated MMgt_TShared
    and defines C++ destructor instead of method Delete().
    
    AIS_InteractiveObject - undocumented property State() has been removed.
    Undocumented property Users() has been moved to AIS_IdenticRelation.
    
    Draw Harness command vclose now clear AIS_InteractiveContext content
    before nullifying it to ensure that objects have been properly removed.
    
    AIS_MultipleConnectedInteractive now overrides method ::SetContext()
    to assign context for children objects.

kgv

2016-10-17 15:12

developer   ~0058800

Regression should be fixed now - please test updated patch in branch CR27957_1.

mkv

2016-10-18 11:55

tester   ~0058852

Dear BugMaster,
Branch CR27957_1 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested on Release mode.
SHA-1: 4fd66b90ce5d05fde4b8e194cde63e5c416289c0

Number of compiler warnings:

occt component :
Linux: 0 (0 on master)
Windows: 0 (0 on master)
MacOS : 0 (0 on master)

products component :
Linux: 63 (63 on master)
Windows: 0 (0 on master)
MacOS : 1149

Regressions/Differences/Improvements:
No regressions/differences

Testing cases:
Not needed

Testing on Linux:
occt component :
Total MEMORY difference: 90905219 / 90569213 [+0.37%]
Total CPU difference: 19333.609999999913 / 19464.749999999938 [-0.67%]
products component :
Total MEMORY difference: 30077073 / 30069397 [+0.03%]
Total CPU difference: 5310.749999999971 / 5271.849999999968 [+0.74%]

Testing on Windows:
occt component :
Total MEMORY difference: 57236318 / 57244523 [-0.01%]
Total CPU difference: 18978.083253598656 / 18100.874030498668 [+4.85%]
products component :
Total MEMORY difference: 21302931 / 21265221 [+0.18%]
Total CPU difference: 5493.450414199963 / 5148.189000999964 [+6.71%]

There are no differences in images found by testdiff.

mkv

2016-10-18 11:56

tester   ~0058853

Dear BugMaster,
Branch CR27957_1 is TESTED.

git

2016-10-28 21:42

administrator   ~0059473

Branch CR27957 has been deleted by kgv.

SHA-1: e201426254f82c3d7f006a70d76a5c34ac4afb05

git

2016-10-28 21:42

administrator   ~0059474

Branch CR27957_1 has been deleted by kgv.

SHA-1: 4fd66b90ce5d05fde4b8e194cde63e5c416289c0

Related Changesets

occt: master 2ec85268

2016-10-13 12:24:23

kgv


Committer: apn Details Diff
0027957: Visualization, AIS_InteractiveContext - protect from displaying the same AIS_InteractiveObject within multiple contexts

AIS_InteractiveContext methods adding object to the context now throws Standard_ProgramError exception
if object has been already displayed in another context.
AIS_InteractiveContext::Remove() now NULLifies context assigned to the object.

AIS_InteractiveContext now inherits from Standard_Transient instead of deprecated MMgt_TShared
and defines C++ destructor instead of method Delete().

AIS_InteractiveObject - undocumented property State() has been removed.
Undocumented property Users() has been moved to AIS_IdenticRelation.

Draw Harness command vclose now clear AIS_InteractiveContext content
before nullifying it to ensure that objects have been properly removed.

AIS_MultipleConnectedInteractive now overrides method ::SetContext()
to assign context for children objects.
Affected Issues
0027957
mod - src/AIS/AIS_IdenticRelation.hxx Diff File
mod - src/AIS/AIS_InteractiveContext.cxx Diff File
mod - src/AIS/AIS_InteractiveContext.hxx Diff File
mod - src/AIS/AIS_InteractiveContext_1.cxx Diff File
mod - src/AIS/AIS_InteractiveContext_3.cxx Diff File
mod - src/AIS/AIS_InteractiveObject.cxx Diff File
mod - src/AIS/AIS_InteractiveObject.hxx Diff File
mod - src/AIS/AIS_MultipleConnectedInteractive.cxx Diff File
mod - src/AIS/AIS_MultipleConnectedInteractive.hxx Diff File
rm - src/AIS/AIS_PToContext.hxx Diff File
mod - src/AIS/FILES Diff File
mod - src/ViewerTest/ViewerTest_ViewerCommands.cxx Diff File
rm - tests/bugs/vis/bug23670_1 Diff File
mod - tests/bugs/vis/bug24133_2 Diff File
mod - tests/bugs/vis/bug24133_3 Diff File
mod - tests/bugs/vis/bug24133_4 Diff File
rm - tests/bugs/vis/bug2883_2 Diff File

Issue History

Date Modified Username Field Change
2016-10-13 13:40 kgv New Issue
2016-10-13 13:40 kgv Assigned To => kgv
2016-10-13 13:41 kgv Relationship added related to 0024623
2016-10-13 13:42 kgv Steps to Reproduce Updated
2016-10-13 15:29 git Note Added: 0058667
2016-10-13 15:30 kgv Note Added: 0058668
2016-10-13 15:30 kgv Assigned To kgv => san
2016-10-13 15:30 kgv Status new => resolved
2016-10-13 15:36 kgv Relationship added related to 0024141
2016-10-13 16:20 kgv Relationship added related to 0025341
2016-10-13 19:39 san Note Added: 0058690
2016-10-13 19:39 san Assigned To san => bugmaster
2016-10-13 19:39 san Status resolved => reviewed
2016-10-14 13:22 mkv Assigned To bugmaster => mkv
2016-10-14 14:24 git Note Added: 0058722
2016-10-17 12:54 mkv Note Added: 0058779
2016-10-17 12:55 mkv Note Added: 0058780
2016-10-17 12:55 mkv Note Added: 0058781
2016-10-17 12:55 mkv Assigned To mkv => kgv
2016-10-17 12:55 mkv Status reviewed => assigned
2016-10-17 12:55 mkv Test case number => Not needed
2016-10-17 15:09 git Note Added: 0058798
2016-10-17 15:12 git Note Added: 0058799
2016-10-17 15:12 kgv Note Added: 0058800
2016-10-17 15:12 kgv Assigned To kgv => bugmaster
2016-10-17 15:12 kgv Status assigned => resolved
2016-10-17 15:13 kgv Status resolved => reviewed
2016-10-17 15:22 mkv Assigned To bugmaster => mkv
2016-10-18 11:55 mkv Note Added: 0058852
2016-10-18 11:56 mkv Note Added: 0058853
2016-10-18 11:56 mkv Assigned To mkv => bugmaster
2016-10-18 11:56 mkv Status reviewed => tested
2016-10-21 11:25 apn Changeset attached => occt master 2ec85268
2016-10-21 11:25 apn Assigned To bugmaster => apn
2016-10-21 11:25 apn Status tested => verified
2016-10-21 11:25 apn Resolution open => fixed
2016-10-28 21:42 git Note Added: 0059473
2016-10-28 21:42 git Note Added: 0059474
2016-12-09 16:30 aiv Status verified => closed
2016-12-09 16:38 aiv Fixed in Version => 7.1.0
2021-06-23 10:27 kgv Relationship added parent of 0032456