Archived issue #0028088
Visualization, AIS_InteractiveContext - drop default value for Update Viewer parameter
Description
AIS_InteractiveContext defines many methods taking parameter to update viewer or not. The problem is that this parameter has default value which is TRUE.
Existing syntax simplifies first usage of OCCT - e.g. application developer sees all changes immediately in 3D Viewer exactly at the line where AIS_InteractiveContext method is called.
However, this approach is inefficient and error-prone, because real application usually performs several changes in AIS_InteractiveContext at once, and performing additional Viewer updates in between significantly impacts overall performance.
The usual approach is to set the UpdateViewer parameter to FALSE for every called method AIS_InteractiveContext, and calling Viewer update explicitly once after all modifications have been done. This approach works well, however the problem is that default value in all methods is TRUE and it is easy to miss argument at application code leading to implicit redundant Viewer updates which are not well-seen to developer, but still impact performance.
It is proposed to alter existing API and remove default value to UpdateViewer flag from all AIS_InteractiveContext methods, so that user should always specify desired effect.
Existing syntax simplifies first usage of OCCT - e.g. application developer sees all changes immediately in 3D Viewer exactly at the line where AIS_InteractiveContext method is called.
However, this approach is inefficient and error-prone, because real application usually performs several changes in AIS_InteractiveContext at once, and performing additional Viewer updates in between significantly impacts overall performance.
The usual approach is to set the UpdateViewer parameter to FALSE for every called method AIS_InteractiveContext, and calling Viewer update explicitly once after all modifications have been done. This approach works well, however the problem is that default value in all methods is TRUE and it is easy to miss argument at application code leading to implicit redundant Viewer updates which are not well-seen to developer, but still impact performance.
It is proposed to alter existing API and remove default value to UpdateViewer flag from all AIS_InteractiveContext methods, so that user should always specify desired effect.
Steps to reproduce
N/A
Public activity
26 archived notes
Participants are labeled by their role within this record.
Branch [archived branch] has been created by Participant.
[revision removed]
Detailed log of new commits:
Author: isk
Date: Fri Dec 23 11:20:29 2016 +0300
0028088: Visualization, AIS_InteractiveContext - drop default value for Update Viewer parameter
[revision removed]
Detailed log of new commits:
Author: isk
Date: Fri Dec 23 11:20:29 2016 +0300
0028088: Visualization, AIS_InteractiveContext - drop default value for Update Viewer parameter
Some methods of AIS_InteractiveContext have several default parameters:
void ClearPrs (const Handle(AIS_InteractiveObject)& aniobj, const Standard_Integer theMode = 0, const Standard_Boolean theToUpdateViewer = Standard_True);
void Redisplay (const AIS_KindOfInteractive theTypeOfObject, const Standard_Integer theSignature = -1, const Standard_Boolean theToUpdateViewer = Standard_True);
void SetTransparency (const Handle(AIS_InteractiveObject)& theIObj, const Standard_Real theValue = 0.6, const Standard_Boolean theToUpdateViewer = Standard_True);
void SetPolygonOffsets (const Handle(AIS_InteractiveObject)& theIObj, const Standard_Integer theMode, const Standard_ShortReal theFactor = 1.0, const Standard_ShortReal theUnits = 0.0, const Standard_Boolean theToUpdateViewer = Standard_True);
void SetSelectedAspect (const Handle(Prs3d_BasicAspect)& theAspect, const Standard_Boolean theGlobalChange = Standard_True, const Standard_Boolean theToUpdateViewer = Standard_True);
void CloseLocalContext (const Standard_Integer theIndex = -1, const Standard_Boolean theToUpdateViewer = Standard_True);
void FitSelected (const Handle(V3d_View)& theView, const Standard_Real theMargin = 0.01, const Standard_Boolean theToUpdate = Standard_True);
It is not clear what with them to do.
void ClearPrs (const Handle(AIS_InteractiveObject)& aniobj, const Standard_Integer theMode = 0, const Standard_Boolean theToUpdateViewer = Standard_True);
void Redisplay (const AIS_KindOfInteractive theTypeOfObject, const Standard_Integer theSignature = -1, const Standard_Boolean theToUpdateViewer = Standard_True);
void SetTransparency (const Handle(AIS_InteractiveObject)& theIObj, const Standard_Real theValue = 0.6, const Standard_Boolean theToUpdateViewer = Standard_True);
void SetPolygonOffsets (const Handle(AIS_InteractiveObject)& theIObj, const Standard_Integer theMode, const Standard_ShortReal theFactor = 1.0, const Standard_ShortReal theUnits = 0.0, const Standard_Boolean theToUpdateViewer = Standard_True);
void SetSelectedAspect (const Handle(Prs3d_BasicAspect)& theAspect, const Standard_Boolean theGlobalChange = Standard_True, const Standard_Boolean theToUpdateViewer = Standard_True);
void CloseLocalContext (const Standard_Integer theIndex = -1, const Standard_Boolean theToUpdateViewer = Standard_True);
void FitSelected (const Handle(V3d_View)& theView, const Standard_Real theMargin = 0.01, const Standard_Boolean theToUpdate = Standard_True);
It is not clear what with them to do.
ClearPrs(), Redisplay(), SetTransparency(), SetPolygonOffsets() - all default values can be removed.
SetSelectedAspect() - remove unused second argument and default value for theToUpdateViewer.
CloseLocalContext() - deprecated method, can be left as is.
FitSelected() - define one more method without theMargin argument. In the current definition - remove default values from both arguments.
SetSelectedAspect() - remove unused second argument and default value for theToUpdateViewer.
CloseLocalContext() - deprecated method, can be left as is.
FitSelected() - define one more method without theMargin argument. In the current definition - remove default values from both arguments.
Branch [archived branch] has been created by Participant.
[revision removed]
Detailed log of new commits:
Author: isk
Date: Tue Dec 27 13:24:08 2016 +0300
0028088: Visualization, AIS_InteractiveContext - drop default value for Update Viewer parameter
[revision removed]
Detailed log of new commits:
Author: isk
Date: Tue Dec 27 13:24:08 2016 +0300
0028088: Visualization, AIS_InteractiveContext - drop default value for Update Viewer parameter
Please add notes to upgrade guide and update sample for C# wrapper.
Please remove also the following line within AIS_Manipulator::Attach():
aContext->CurrentViewer()->RedrawImmediate();
Branch [archived branch] has been updated by Participant.
[revision removed]
Detailed log of new commits:
Author: isk
Date: Wed Dec 28 14:25:38 2016 +0300
Add notes to upgrade guide and update AIS_Manipulator::Attach().
[revision removed]
Detailed log of new commits:
Author: isk
Date: Wed Dec 28 14:25:38 2016 +0300
Add notes to upgrade guide and update AIS_Manipulator::Attach().
Branch [archived branch] has been created by Participant.
[revision removed]
Detailed log of new commits:
Author: isk
Date: Tue Dec 27 13:24:08 2016 +0300
0028088: Visualization, AIS_InteractiveContext - drop default value for Update Viewer parameter
[revision removed]
Detailed log of new commits:
Author: isk
Date: Tue Dec 27 13:24:08 2016 +0300
0028088: Visualization, AIS_InteractiveContext - drop default value for Update Viewer parameter
Please test the patch.
Branch [archived branch] has been updated forcibly by Participant.
[revision removed]
[revision removed]
Dear Ilya,
Please, rebase CR28088_2 (from occt git-repositories) and CR28088_1 (from products git-repositories) on the current masters. Thank you in advance.
Please, rebase CR28088_2 (from occt git-repositories) and CR28088_1 (from products git-repositories) on the current masters. Thank you in advance.
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Rebased.
Dear Commenter 1,
During building of branches CR28088_2 ([revision removed]) from occt git-repository and CR28088_1 ([revision removed]) from products git-repository compilation errors have been detected.
On Linux:
http://jenkins-test-05.nnov.opencascade.com/view/CR28088_2-CR28088_1/job/CR28088_2-CR28088_1-OCCT-Debian70-64-opt-compile/1/parsed_console/
On MacOS:
http://jenkins-test-05.nnov.opencascade.com/view/CR28088_2-CR28088_1/job/CR28088_2-CR28088_1-OCCT-MacOS-opt-compile/1/parsed_console/
Moreover, compilation errors have been detected during building
Products MFC-samples on Windows:
http://jenkins-test-05.nnov.opencascade.com/view/CR28088_2-CR28088_1/job/CR28088_2-CR28088_1-Products-Windows-64-VC10-mfc-samples/1/parsed_console/
Products Qt-samples on Windows:
http://jenkins-test-05.nnov.opencascade.com/view/CR28088_2-CR28088_1/job/CR28088_2-CR28088_1-Products-Windows-64-VC10-qt-samples-windows/1/parsed_console/
During building of branches CR28088_2 ([revision removed]) from occt git-repository and CR28088_1 ([revision removed]) from products git-repository compilation errors have been detected.
On Linux:
http://jenkins-test-05.nnov.opencascade.com/view/CR28088_2-CR28088_1/job/CR28088_2-CR28088_1-OCCT-Debian70-64-opt-compile/1/parsed_console/
On MacOS:
http://jenkins-test-05.nnov.opencascade.com/view/CR28088_2-CR28088_1/job/CR28088_2-CR28088_1-OCCT-MacOS-opt-compile/1/parsed_console/
Moreover, compilation errors have been detected during building
Products MFC-samples on Windows:
http://jenkins-test-05.nnov.opencascade.com/view/CR28088_2-CR28088_1/job/CR28088_2-CR28088_1-Products-Windows-64-VC10-mfc-samples/1/parsed_console/
Products Qt-samples on Windows:
http://jenkins-test-05.nnov.opencascade.com/view/CR28088_2-CR28088_1/job/CR28088_2-CR28088_1-Products-Windows-64-VC10-qt-samples-windows/1/parsed_console/
Dear Kirill,
Branches CR28088_2 (from occt git-repositoriy) and CR28088_1 (from products git-repository) have been rejected due to:
- compilation errors
Branches CR28088_2 (from occt git-repositoriy) and CR28088_1 (from products git-repository) have been rejected due to:
- compilation errors
Branch [archived branch] has been updated by Author.
[revision removed]
Detailed log of new commits:
Author: Author
Date: Tue Jan 10 13:45:17 2017 +0300
fix compilation errors
[revision removed]
Detailed log of new commits:
Author: Author
Date: Tue Jan 10 13:45:17 2017 +0300
fix compilation errors
Branch [archived branch] has been created by Author.
[revision removed]
Detailed log of new commits:
Author: isk
Date: Tue Dec 27 13:24:08 2016 +0300
0028088: Visualization, AIS_InteractiveContext - drop default value for Update Viewer parameter
[revision removed]
Detailed log of new commits:
Author: isk
Date: Tue Dec 27 13:24:08 2016 +0300
0028088: Visualization, AIS_InteractiveContext - drop default value for Update Viewer parameter
Please check updated patch in branch CR28088_3.
Dear Commenter 1,
Branch CR28088_3 from occt git-repository (and CR28088_3 from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested.
[revision removed]
[revision removed]
Number of compiler warnings:
occt component:
Linux: 0 (0 on master)
Windows: 0 (0 on master)
MasOS: 0 (0 on master)
products component:
Linux: 63
Windows: 0
MacOS: 1143
Compilation errors have been detected during building of Products MFC-samples on Windows:
http://jenkins-test-05.nnov.opencascade.com/view/CR28088_3-CR28088_3/job/CR28088_3-CR28088_3-Products-Windows-64-VC10-mfc-samples/1/parsed_console/
Regressions/Differences:
Not detected
Testing cases:
Not needed
Testing on Linux:
occt component:
Total MEMORY difference: 93319680 / 92886504 [+0.47%]
Total CPU difference: 21383.38000000012 / 21505.9100000003 [-0.57%]
products component:
Total MEMORY difference: 30362708 / 30395462 [-0.11%]
Total CPU difference: 5347.099999999976 / 5312.789999999971 [+0.65%]
Testing on Windows:
occt component:
Total MEMORY difference: 58639028 / 58649007 [-0.02%]
Total CPU difference: 19320.879850998477 / 19749.742200098677 [-2.17%]
products component:
Total MEMORY difference: 21150835 / 21118126 [+0.15%]
Total CPU difference: 5170.419143499968 / 5256.094892699988 [-1.63%]
Branch CR28088_3 from occt git-repository (and CR28088_3 from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested.
[revision removed]
[revision removed]
Number of compiler warnings:
occt component:
Linux: 0 (0 on master)
Windows: 0 (0 on master)
MasOS: 0 (0 on master)
products component:
Linux: 63
Windows: 0
MacOS: 1143
Compilation errors have been detected during building of Products MFC-samples on Windows:
http://jenkins-test-05.nnov.opencascade.com/view/CR28088_3-CR28088_3/job/CR28088_3-CR28088_3-Products-Windows-64-VC10-mfc-samples/1/parsed_console/
Regressions/Differences:
Not detected
Testing cases:
Not needed
Testing on Linux:
occt component:
Total MEMORY difference: 93319680 / 92886504 [+0.47%]
Total CPU difference: 21383.38000000012 / 21505.9100000003 [-0.57%]
products component:
Total MEMORY difference: 30362708 / 30395462 [-0.11%]
Total CPU difference: 5347.099999999976 / 5312.789999999971 [+0.65%]
Testing on Windows:
occt component:
Total MEMORY difference: 58639028 / 58649007 [-0.02%]
Total CPU difference: 19320.879850998477 / 19749.742200098677 [-2.17%]
products component:
Total MEMORY difference: 21150835 / 21118126 [+0.15%]
Total CPU difference: 5170.419143499968 / 5256.094892699988 [-1.63%]
Dear Kirill,
Branches CR28088_3 (from occt and products git-repositories) have been rejected due to:
- compilation errors
Branches CR28088_3 (from occt and products git-repositories) have been rejected due to:
- compilation errors
Please check building Product samples within updated patch.
Regression testing is not needed.
Regression testing is not needed.
Dear Commenter 1,
Branch CR28088_3 from occt git-repository (and CR28088_3 from products git-repository) was compiled on Linux, MacOS and Windows platforms.
[revision removed]
[revision removed]
Number of compiler warnings:
occt component:
Linux: 0 (0 on master)
Windows: 0 (0 on master)
MasOS: 0 (0 on master)
products component:
Linux: 63
Windows: 0
MacOS: 1136
Branch CR28088_3 from occt git-repository (and CR28088_3 from products git-repository) was compiled on Linux, MacOS and Windows platforms.
[revision removed]
[revision removed]
Number of compiler warnings:
occt component:
Linux: 0 (0 on master)
Windows: 0 (0 on master)
MasOS: 0 (0 on master)
products component:
Linux: 63
Windows: 0
MacOS: 1136
Branch [archived branch] has been deleted by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been deleted by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been deleted by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been deleted by Author.
[revision removed]
[revision removed]
Related records
- #0024609 · related to · closedRevise consistency of immediate update mode in V3d_View
- #0028305 · parent of · closedVisualization, AIS_Manipulator - Attach method should receive an "update viewer" flag
- #0028820 · parent of · closedSamples - fix compilation of JAVA sample for Android
- #0028895 · parent of · closedVisualization, V3d_View::SetComputedMode() - HLR calculation is performed multiple times when 'hlr on' has been called
- #0029214 · parent of · closedApplication Framework - TPrsStd_AISPresentation::AISUpdate() should not implicitly redraw 3D Viewer
- #0029285 · parent of · closedVisualization, V3d_View::UpdateLights() - eliminate implicit redraw
- #0029140 · parent of · closedSamples - Viewer is not updated in MFC Modeling and Viewer3D samples
- #0028405 · related to · closedVisualization, V3d_Viewer - changes to Grid immediately updates view
- #0028407 · related to · closedVisualization - remove ::UpdateMode() from Graphic3d_StructureManager