MantisBT - Open CASCADE
View Issue Details
0030784Open CASCADE[OCCT] OCCT:Visualizationpublic2019-06-17 13:122020-09-13 11:48
nds 
bugmaster 
normalminor 
verifiedfixed 
 
[OCCT] 7.5.0 
Not required
0030784: Visualization - check if selectable of owner in internal container in AIS_InteractiveContext before using
In some methods of interactive context global status of interactive object is obtained from myObjects without a check if the object is registered inside.
No tags attached.
Issue History
2019-06-17 13:12ndsNew Issue
2019-06-17 13:12ndsAssigned To => kgv
2019-06-17 13:27gitNote Added: 0085088
2019-06-17 13:28ndsAssigned Tokgv => nds
2019-06-17 13:33kgvNote Added: 0085089
2019-08-02 15:35gitNote Added: 0085991
2019-09-19 09:42ndsTarget Version7.4.0 => 7.5.0
2020-09-04 19:06gitNote Added: 0094022
2020-09-05 09:19ndsDescription Updatedbug_revision_view_page.php?rev_id=23331#r23331
2020-09-06 06:48gitNote Added: 0094155
2020-09-06 11:29ndsNote Added: 0094163
2020-09-06 11:29ndsAssigned Tonds => kgv
2020-09-06 11:29ndsStatusnew => resolved
2020-09-06 11:40kgvNote Added: 0094164
2020-09-06 11:40kgvAssigned Tokgv => nds
2020-09-06 11:40kgvStatusresolved => assigned
2020-09-06 11:41kgvNote Edited: 0094164bug_revision_view_page.php?bugnote_id=94164#r23337
2020-09-07 22:58gitNote Added: 0094219
2020-09-07 22:58gitNote Added: 0094220
2020-09-07 23:35gitNote Added: 0094226
2020-09-08 08:21ndsNote Added: 0094229
2020-09-08 08:21ndsAssigned Tonds => kgv
2020-09-08 08:21ndsStatusassigned => resolved
2020-09-08 10:41kgvNote Added: 0094233
2020-09-08 10:42kgvAssigned Tokgv => bugmaster
2020-09-08 10:42kgvStatusresolved => reviewed
2020-09-08 10:51gitNote Added: 0094235
2020-09-08 10:52ndsNote Added: 0094236
2020-09-09 19:38ndsNote Added: 0094317
2020-09-13 11:04bugmasterNote Added: 0094535
2020-09-13 11:04bugmasterStatusreviewed => tested
2020-09-13 11:12bugmasterTest case number => Not required
2020-09-13 11:24bugmasterChangeset attached => occt master b19cde43
2020-09-13 11:24bugmasterStatustested => verified
2020-09-13 11:24bugmasterResolutionopen => fixed
2020-09-13 11:46gitNote Added: 0094590
2020-09-13 11:46gitNote Added: 0094594
2020-09-13 11:48gitNote Added: 0094627
2020-09-13 11:48gitNote Added: 0094633

Notes
(0085088)
git   
2019-06-17 13:27   
Branch CR30784 has been created by nds.

SHA-1: a52908d650245f4930cf42fafe545e15c10f3aa6


Detailed log of new commits:

Author: nds
Date: Tue May 14 14:31:43 2019 +0300

    0030784: Visualization - check if selectable of owner in internal container in AIS_InteractiveContext before using
    
    # todo - add similar check for other places where needed
(0085089)
kgv   
2019-06-17 13:33   
     const Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (theOwner->Selectable());

+    if (!myObjects.IsBound(anObj))
+      return;
     const Standard_Boolean isGlobal = anObj->GlobalSelOwner() == theOwner;
     Handle(AIS_GlobalStatus)& aStatus = myObjects.ChangeFind (anObj);

NCollection_DataMap::ChangeSeek()
(0085991)
git   
2019-08-02 15:35   
Branch CR30784_1 has been created by nds.

SHA-1: e696956fd74e0b310ba4fa4f0e341741e43e1089


Detailed log of new commits:

Author: nds
Date: Tue May 14 14:31:43 2019 +0300

    0030784: Visualization - check if selectable of owner in internal container in AIS_InteractiveContext before using
    
    # todo - add similar check for other places where needed
    
    (cherry picked from commit a52908d650245f4930cf42fafe545e15c10f3aa6)
(0094022)
git   
2020-09-04 19:06   
Branch CR30784_2 has been created by nds.

SHA-1: 696a9488960cc4ce4892a45190cf179f04829ac9


Detailed log of new commits:

Author: nds
Date: Fri Sep 4 19:08:29 2020 +0300

    0030784: Visualization - check if selectable of owner in internal container in AIS_InteractiveContext before using
(0094155)
git   
2020-09-06 06:48   
Branch CR30784_2 has been updated forcibly by nds.

SHA-1: b4d5089479411661857948ce30b7ff16ce4f4bea
(0094163)
nds   
2020-09-06 11:29   
Dear Kirill,

could you please review patch.

Thank you a lot, Natalia
(0094164)
kgv   
2020-09-06 11:40   
(edited on: 2020-09-06 11:41)
+      if (aStatusPtr)
+        (*aStatusPtr)->SetHilightStatus (Standard_False);
...
+    if (!aStatusPtr)
+      return;

Please add brackets.

@@ -172,20 +172,16 @@ void AIS_InteractiveContext::unhighlightOwners (const AIS_NListOfEntityOwner& 
th
   {
-    Handle(AIS_GlobalStatus) aStatus;
-    if (!myObjects.Find (anInteractive, aStatus))
-    {
-      continue;
-    }
+    Handle(AIS_GlobalStatus)* aStatusPtr = myObjects.ChangeSeek (anInteractive);

This change contradicts to bug description - it allows handling objects not registered in Interactive Context.
Is there real necessity / valid use cases for this behavior?

+      Handle(AIS_GlobalStatus)* aStatusPtr = myObjects.ChangeSeek (aSelectable);
+      if (aStatusPtr)
+        (*aStatusPtr)->SetHilightStatus (Standard_False);

Tip:
> if (Handle(AIS_GlobalStatus)* aStatusPtr = myObjects.ChangeSeek (aSelectable))
> {
> (*aStatusPtr)->SetHilightStatus (false);
> }

(0094219)
git   
2020-09-07 22:58   
Branch CR30784_2 has been updated by nds.

SHA-1: 6bdb7496a7e5d588396d30fab54d49c1d0589f7b


Detailed log of new commits:

Author: nds
Date: Fri Sep 4 19:08:29 2020 +0300

    remarks correction

(0094220)
git   
2020-09-07 22:58   
Branch CR30784_3 has been created by nds.

SHA-1: c15f4cb8a0457a01df0877a303ec31f3eb4edba0


Detailed log of new commits:

Author: nds
Date: Mon Sep 7 23:00:50 2020 +0300

    0030784: Visualization - check if selectable of owner in internal container in AIS_InteractiveContext before using
(0094226)
git   
2020-09-07 23:35   
Branch CR30784_3 has been updated forcibly by nds.

SHA-1: 271b13db601ae47018958775f8204fa843fb2b03
(0094229)
nds   
2020-09-08 08:21   
Dear Kirill,

corrected, could you please review again.
Jenkins job is: http://jenkins-test-12.nnov.opencascade.com/view/CR30784-master-nds/ [^]

Thank you a lot, Natalia
(0094233)
kgv   
2020-09-08 10:41   
+    if (!aStatusPtr)
+      continue;

Please add brackets.
(0094235)
git   
2020-09-08 10:51   
Branch CR30784_3 has been updated forcibly by nds.

SHA-1: 020ddd43bbaecffb3ac8a675787844108e2b90d4
(0094236)
nds   
2020-09-08 10:52   
corrected, thank you.
(0094317)
nds   
2020-09-09 19:38   
OCCT: CR30784_3,
PRODUCTS: NOT
(0094535)
bugmaster   
2020-09-13 11:04   
Combination -
OCCT branch : IR-2020-09-11
master SHA - d1b25684e9402d995dafec22fb98f83957d5fb76
a206de37fbfa0bf71bd534ae47192bbec23b8522
Products branch : IR-2020-09-11 SHA - a7e55a291cf6642cb4af945a999deeeb5f91272a
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: 17333.360000000142 / 17325.800000000123 [+0.04%]
Products
Total CPU difference: 12056.720000000096 / 12079.64000000011 [-0.19%]
Windows-64-VC14:
OCCT
Total CPU difference: 18817.921875 / 18792.46875 [+0.14%]
Products
Total CPU difference: 13294.09375 / 13274.75 [+0.15%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
(0094590)
git   
2020-09-13 11:46   
Branch CR30784_3 has been deleted by inv.

SHA-1: 020ddd43bbaecffb3ac8a675787844108e2b90d4
(0094594)
git   
2020-09-13 11:46   
Branch CR30784_2 has been deleted by inv.

SHA-1: 6bdb7496a7e5d588396d30fab54d49c1d0589f7b
(0094627)
git   
2020-09-13 11:48   
Branch CR30784_1 has been deleted by inv.

SHA-1: e696956fd74e0b310ba4fa4f0e341741e43e1089
(0094633)
git   
2020-09-13 11:48   
Branch CR30784 has been deleted by inv.

SHA-1: a52908d650245f4930cf42fafe545e15c10f3aa6