Archived issue #0030124
Visualization, AIS_InteractiveObject - clean up confusing Presentation invalidation logic
Description
AIS_InteractiveObject has several properties related to presentation invalidation:
- RecomputeEveryPrs()/ListOfRecomputeModes()/MustRecomputePrs()/SetRecomputeOk()
- ToBeUpdated()/SetToUpdate()
The usage of first set of methods looks like a nonsense - they are used as temporary flags within modified object while it is modified by methods like AIS_InteractiveContext::SetWidth() so that invalidated modes are recomputed by AIS_InteractiveContext::redisplayPrsRecModes(). At the same time, RecomputeEveryPrs() flag is messed up with the list of invalidated modes. The list of invalidated modes is stored as AIS_InteractiveObject class field regardless of existence of these modes.
The second set looks more clear, since they invalidate already computed presentations and handled by AIS_InteractiveContext::redisplayPrsModes() as well as by PrsMgr_PresentationManager.
It looks unreasonable having 2 duplicated mechanisms for invalidating presentations, so that one (first) should be removed and replaced by another.
Command vdisplay might require changes so that to rely on invalidation flag.
- RecomputeEveryPrs()/ListOfRecomputeModes()/MustRecomputePrs()/SetRecomputeOk()
- ToBeUpdated()/SetToUpdate()
The usage of first set of methods looks like a nonsense - they are used as temporary flags within modified object while it is modified by methods like AIS_InteractiveContext::SetWidth() so that invalidated modes are recomputed by AIS_InteractiveContext::redisplayPrsRecModes(). At the same time, RecomputeEveryPrs() flag is messed up with the list of invalidated modes. The list of invalidated modes is stored as AIS_InteractiveObject class field regardless of existence of these modes.
The second set looks more clear, since they invalidate already computed presentations and handled by AIS_InteractiveContext::redisplayPrsModes() as well as by PrsMgr_PresentationManager.
It looks unreasonable having 2 duplicated mechanisms for invalidating presentations, so that one (first) should be removed and replaced by another.
Command vdisplay might require changes so that to rely on invalidation flag.
Steps to reproduce
Not required
Public activity
32 archived notes
Participants are labeled by their role within this record.
I have been struggling with presentation invalidation. Has it something to do with this issue?
https://www.opencascade.com/content/lazy-presentation-update
https://www.opencascade.com/content/lazy-presentation-update
> I have been struggling with presentation invalidation.
> Has it something to do with this issue?
Sorry, but I have almost zero knowledge about TPrsStd to comment.
This bug is related to applications working directly with AIS objects
and having an issue how properly mark presentation invalidated to force Recompute later on, since there are several similar methods.
TPrsStd is part of Application Framework, not Visualization;
although it deals with AIS objects.
> Has it something to do with this issue?
Sorry, but I have almost zero knowledge about TPrsStd to comment.
This bug is related to applications working directly with AIS objects
and having an issue how properly mark presentation invalidated to force Recompute later on, since there are several similar methods.
TPrsStd is part of Application Framework, not Visualization;
although it deals with AIS objects.
Okay, thank you.
Branch [archived branch] has been created by Participant.
[revision removed]
Detailed log of new commits:
Author: mnv
Date: Fri Sep 28 13:06:23 2018 +0300
0030124: Visualization, AIS_InteractiveObject - clean up confusing Presentation invalidation logic
Removed excess mechanism for invalidating presentations.
Updated vdisplay command logic for redisplaying presentations.
[revision removed]
Detailed log of new commits:
Author: mnv
Date: Fri Sep 28 13:06:23 2018 +0300
0030124: Visualization, AIS_InteractiveObject - clean up confusing Presentation invalidation logic
Removed excess mechanism for invalidating presentations.
Updated vdisplay command logic for redisplaying presentations.
+ TColStd_ListOfInteger aModes; + theIObj->ToBeUpdated (aModes); + for (TColStd_ListIteratorOfListOfInteger aModeIter (aModes); aModeIter.More(); aModeIter.Next())
I think it would be better replacing this logic by direct iteration through Object presentations
(probably by improving / extending PrsMgr_PresentableObject::Update() methods).
Branch [archived branch] has been updated forcibly by Participant.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Participant.
[revision removed]
[revision removed]
Patch is ready for review.
TColStd_ListOfInteger aPrsModes; theIObj->ToBeUpdated (aPrsModes);
Please update the code to avoid creation of temporary list of presentation modes to update.
Branch [archived branch] has been created by Participant.
[revision removed]
Detailed log of new commits:
Author: mnv
Date: Fri Sep 28 13:06:23 2018 +0300
0030124: Visualization, AIS_InteractiveObject - clean up confusing Presentation invalidation logic
Removed excess mechanism for invalidating presentations.
[revision removed]
Detailed log of new commits:
Author: mnv
Date: Fri Sep 28 13:06:23 2018 +0300
0030124: Visualization, AIS_InteractiveObject - clean up confusing Presentation invalidation logic
Removed excess mechanism for invalidating presentations.
Branch [archived branch] has been updated forcibly by Participant.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Participant.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Participant.
[revision removed]
[revision removed]
Patch is ready for review.
http://jenkins-test-12.nnov.opencascade.com/view/CR30124-master-MNV/view/ALL/
http://jenkins-test-12.nnov.opencascade.com/view/CR30124-master-MNV/view/ALL/
@@ -1006,12 +1006,7 @@ void AIS_InteractiveContext::Update (const Handle(AIS_InteractiveObject)& theIOb
return;
}
- TColStd_ListOfInteger aPrsModes;
- theIObj->ToBeUpdated (aPrsModes);
- for (TColStd_ListIteratorOfListOfInteger aPrsModesIt (aPrsModes); aPrsModesIt.More(); aPrsModesIt.Next())
- {
- theIObj->Update (aPrsModesIt.Value(), Standard_False);
- }
+ theIObj->Update();
...
+void PrsMgr_PresentableObject::Update (const Standard_Boolean theAllModes,
+ const Standard_Boolean theClearOther)
...
+ if (theAllModes)
+ {
+ aPrsMgr->Update (this, aModedPrs.Mode());
+ }
+ else
+ {
+ if (aPrsMgr->IsDisplayed (this, aModedPrs.Mode())
+ || aPrsMgr->IsHighlighted (this, aModedPrs.Mode()))
+ {
+ aPrsMgr->Update (this, aModedPrs.Mode());
+ }
+ else
+ {
+ SetToUpdate (aModedPrs.Mode());
+ }
It doesn't look intended to work at all - with ClearOther set to FALSE,
MustBeUpdated is ignored at all, and all active presentations
are re-computed unconditionally while inactive presentations
are invalidated unconditionally.
Branch [archived branch] has been created by Participant.
[revision removed]
Detailed log of new commits:
Author: mnv
Date: Fri Sep 28 13:06:23 2018 +0300
0030124: Visualization, AIS_InteractiveObject - clean up confusing Presentation invalidation logic
Removed excess mechanism for invalidating presentations.
[revision removed]
Detailed log of new commits:
Author: mnv
Date: Fri Sep 28 13:06:23 2018 +0300
0030124: Visualization, AIS_InteractiveObject - clean up confusing Presentation invalidation logic
Removed excess mechanism for invalidating presentations.
Branch [archived branch] has been updated forcibly by Participant.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Participant.
[revision removed]
[revision removed]
Branch [archived branch] has been created by Participant.
[revision removed]
Detailed log of new commits:
Author: mnv
Date: Fri Sep 28 13:06:23 2018 +0300
0030124: Visualization, AIS_InteractiveObject - clean up confusing Presentation invalidation logic
Removed excess mechanism for invalidating presentations.
[revision removed]
Detailed log of new commits:
Author: mnv
Date: Fri Sep 28 13:06:23 2018 +0300
0030124: Visualization, AIS_InteractiveObject - clean up confusing Presentation invalidation logic
Removed excess mechanism for invalidating presentations.
Branch [archived branch] has been updated forcibly by Participant.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Participant.
[revision removed]
[revision removed]
Branch [archived branch] has been created by Author.
[revision removed]
Detailed log of new commits:
Author: mnv
Date: Thu Mar 7 20:45:58 2019 +0300
0030124: Visualization, AIS_InteractiveObject - clean up confusing Presentation invalidation logic
Removed excess mechanism for invalidating presentations AIS_InteractiveObject::myRecomputeEveryPrs.
PrsMgr_PresentableObject::Update() has been deprecated and replaced by PrsMgr_PresentableObject::UpdatePresentations()
recomputing only explicitly invalidated presentations.
[revision removed]
Detailed log of new commits:
Author: mnv
Date: Thu Mar 7 20:45:58 2019 +0300
0030124: Visualization, AIS_InteractiveObject - clean up confusing Presentation invalidation logic
Removed excess mechanism for invalidating presentations AIS_InteractiveObject::myRecomputeEveryPrs.
PrsMgr_PresentableObject::Update() has been deprecated and replaced by PrsMgr_PresentableObject::UpdatePresentations()
recomputing only explicitly invalidated presentations.
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Please raise the patch.
http://jenkins-test-12.nnov.opencascade.com:8080/view/CR30124_4-CR30124_4-KGV/
http://jenkins-test-12.nnov.opencascade.com:8080/view/CR30124_4-CR30124_4-KGV/
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: 16568.019999999964 / 16562.049999999996 [+0.04%]
Products
Total CPU difference: 9114.850000000039 / 9082.700000000026 [+0.35%]
Windows-64-VC14:
OCCT
Total CPU difference: 17967.078125 / 17955.015625 [+0.07%]
Products
Total CPU difference: 10455.78125 / 10469.015625 [-0.13%]
Image differences :
No differences that require special attention
Memory differences :
No differences that require special attention
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: 16568.019999999964 / 16562.049999999996 [+0.04%]
Products
Total CPU difference: 9114.850000000039 / 9082.700000000026 [+0.35%]
Windows-64-VC14:
OCCT
Total CPU difference: 17967.078125 / 17955.015625 [+0.07%]
Products
Total CPU difference: 10455.78125 / 10469.015625 [-0.13%]
Image differences :
No differences that require special attention
Memory differences :
No differences that require special attention
Branch [archived branch] has been updated by Author.
[revision removed]
Detailed log of new commits:
Author: Author
Date: Wed Mar 13 07:58:18 2019 +0300
# gcc compiler fix
[revision removed]
Detailed log of new commits:
Author: Author
Date: Wed Mar 13 07:58:18 2019 +0300
# gcc compiler fix
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been deleted by Participant.
[revision removed]
[revision removed]
Branch [archived branch] has been deleted by Participant.
[revision removed]
[revision removed]
Branch [archived branch] has been deleted by Participant.
[revision removed]
[revision removed]
Branch [archived branch] has been deleted by Participant.
[revision removed]
[revision removed]
Branch [archived branch] has been deleted by Participant.
[revision removed]
[revision removed]
Related records