DiscussionsIssue archiveOCCT:Visualization

Archived issue #0030784

Visualization - check if selectable of owner in internal container in AIS_InteractiveContext before using

Open CASCADEOCCT:Visualizationclosed20 public notes

Search issues

Description

In some methods of interactive context global status of interactive object is obtained from myObjects without a check if the object is registered inside.

Public activity

20 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: 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
02Commenter 3
     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()
03Commenter 2
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: Author
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 [revision removed])
04Commenter 2
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

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

    0030784: Visualization - check if selectable of owner in internal container in AIS_InteractiveContext before using
05Commenter 2
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
06Author
Dear Kirill,

could you please review patch.

Thank you a lot, Natalia
07Commenter 3
+      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);
> }

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

[revision removed]


Detailed log of new commits:

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

    remarks correction

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

[revision removed]


Detailed log of new commits:

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

    0030784: Visualization - check if selectable of owner in internal container in AIS_InteractiveContext before using
10Commenter 2
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
11Author
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
12Commenter 3
+    if (!aStatusPtr)
+      continue;

Please add brackets.
13Commenter 2
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
14Author
corrected, thank you.
15Author
OCCT: CR30784_3,
PRODUCTS: NOT
16Commenter 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: 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
17Commenter 2
Branch [archived branch] has been deleted by Participant.

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

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

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

[revision removed]