Archived issue #0023670
Support for multiple 3D views
Description
This issue has been inspired by #0023663, #23654 and #23655.
It is necessary to improve DRAW to support creation of several 3D views and removing a 3D view programmatically.
1. At C++ level (ViewerTest package):
- Convenient API to create and close a V3d_View instance should be provided. Some way to identify a view instance should be foreseen (probably, a view handle is enough).
- By default, new instances of V3d_Viewer and AIS_InteractiveContext should be also created. Optionally, it should be possible to create a new view for existing V3d_Viewer/AIS_InteractiveContext.
- There should be one active view at any moment. All ViewerTest commands and all interactive view operations should work with the active view. A 3D view can be activated manually, by activating corresponding window, or programmatically. Convenient API to activate another existing V3d_View instance should be provided.
2. At commands level:
- vinit command should create a new 3D view instance each time it is executed. It should accept an optional argument telling it if the existing V3d_Viewer/AIS_InteractiveContext should be reused for the new view (see p.1 above). This command should return the view identifier in some form.
- vclose command that closes a given 3D view instance or the active one should be provided.
- vactivate command that activates the given 3D view instance should be provided.
It is necessary to improve DRAW to support creation of several 3D views and removing a 3D view programmatically.
1. At C++ level (ViewerTest package):
- Convenient API to create and close a V3d_View instance should be provided. Some way to identify a view instance should be foreseen (probably, a view handle is enough).
- By default, new instances of V3d_Viewer and AIS_InteractiveContext should be also created. Optionally, it should be possible to create a new view for existing V3d_Viewer/AIS_InteractiveContext.
- There should be one active view at any moment. All ViewerTest commands and all interactive view operations should work with the active view. A 3D view can be activated manually, by activating corresponding window, or programmatically. Convenient API to activate another existing V3d_View instance should be provided.
2. At commands level:
- vinit command should create a new 3D view instance each time it is executed. It should accept an optional argument telling it if the existing V3d_Viewer/AIS_InteractiveContext should be reused for the new view (see p.1 above). This command should return the view identifier in some form.
- vclose command that closes a given 3D view instance or the active one should be provided.
- vactivate command that activates the given 3D view instance should be provided.
Public activity
19 archived notes
Participants are labeled by their role within this record.
The Git branch CR23670 is ready to be reviewed.
Dear san, please review.
Dear san, please review.
The Git branch CR32670 is ready to be reviewed.
vinit draw command was modified. Now DRAW supports creation of multiple views, and command vinit support syntax:
1) vinit
Name for view is created to be unique
2) vinit view_name
view_name - can be DriverName/ViewerName/ViewName, or ViewerName/ViewName to use current driver if it exists, or ViewName to use current viewer and current driver if they exist
3) vinit name=view_name l=leftPx t=topPx w=widthPx h=heightPx
to set name, position and sizes of window
If the position of window is not set by user, created views will be disposed on the display without overlapping
4) for Unix systems also it is possible to set display name in the form <HostName:DisplayNumber.ScreenNumber>:
vinit name=view_name display=display_name l=leftPx t=topPx w=widthPx h=heightPx
Added commands:
1) All draw commands work with active view, so to work with definite view, it should be activated first. It can be done interactively by mouse click or with help of command:
vactivate view_name
2) View closing can be done interactively by mouse click on close button or with help of draw command:
vclose view_name
3) For getting information about all views draw command vviewlist can be called.
Dear san, please review.
vinit draw command was modified. Now DRAW supports creation of multiple views, and command vinit support syntax:
1) vinit
Name for view is created to be unique
2) vinit view_name
view_name - can be DriverName/ViewerName/ViewName, or ViewerName/ViewName to use current driver if it exists, or ViewName to use current viewer and current driver if they exist
3) vinit name=view_name l=leftPx t=topPx w=widthPx h=heightPx
to set name, position and sizes of window
If the position of window is not set by user, created views will be disposed on the display without overlapping
4) for Unix systems also it is possible to set display name in the form <HostName:DisplayNumber.ScreenNumber>:
vinit name=view_name display=display_name l=leftPx t=topPx w=widthPx h=heightPx
Added commands:
1) All draw commands work with active view, so to work with definite view, it should be activated first. It can be done interactively by mouse click or with help of command:
vactivate view_name
2) View closing can be done interactively by mouse click on close button or with help of draw command:
vclose view_name
3) For getting information about all views draw command vviewlist can be called.
Dear san, please review.
Dear aba,
interactive selection is broken now if only 1 view is created (tested on Windows platform).
interactive selection is broken now if only 1 view is created (tested on Windows platform).
Interactive selection for the one opened view was fixed.
Dear san, please review.
Dear san, please review.
Branch CR23670 reviewed with the following remarks:
- ViewerTest_ViewerCommands.cxx, line 1001: looks meaningless, probably a part of removed code so should be also removed.
- ViewerTest_ViewerCommands.cxx, VClose function: removing ALL views should be also implemented using RemoveView() function, instead of massive code duplication.
- ViewerTest_ViewerCommands.cxx, VViewList() function: it looks reasonable to output the list of views to Draw_Interpretor instance rather than to std::cout, like this it becomes possible to store the list of views in a variable and to compare it with another list e.g. after closing some views.
- tests/bugs/vis/bug23670_2: checkcolor is meaningless in this context. Instead, you can e.g. improve vviewlist command (see the previous remark) and compare the view lists before and after vclose command.
- tests/bugs/vis/bug23670_1: please, use checkcolor with care, and note that it is much more robust to check the color of a pixel somewhere in the middle of a shaded shape rather than the color of a pixel on a wireframe. Setting shading mode for displayed shapes is recommended.
- ViewerTest_ViewerCommands.cxx, line 1001: looks meaningless, probably a part of removed code so should be also removed.
- ViewerTest_ViewerCommands.cxx, VClose function: removing ALL views should be also implemented using RemoveView() function, instead of massive code duplication.
- ViewerTest_ViewerCommands.cxx, VViewList() function: it looks reasonable to output the list of views to Draw_Interpretor instance rather than to std::cout, like this it becomes possible to store the list of views in a variable and to compare it with another list e.g. after closing some views.
- tests/bugs/vis/bug23670_2: checkcolor is meaningless in this context. Instead, you can e.g. improve vviewlist command (see the previous remark) and compare the view lists before and after vclose command.
- tests/bugs/vis/bug23670_1: please, use checkcolor with care, and note that it is much more robust to check the color of a pixel somewhere in the middle of a shaded shape rather than the color of a pixel on a wireframe. Setting shading mode for displayed shapes is recommended.
VClose, VViewList functions and test cases were corrected according to remarks.
Dear san, please review.
Dear san, please review.
Branch CR23670 reviewed without remarks, ready for testing.
Dear Commenter 1,
Branch CR23670 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
[revision removed]
Number of compiler warnings:
occt component :
Linux: 2 (2 on master)
Windows: 11 (11 on master)
products component :
Linux: 0 (0 on master)
Windows: 64 (64 on master)
Regressions:
bugs vis(004) bug23670_1 - on Linux
http://occt-tests/CR23670-master-occt/Debian60-64/bugs/vis/bug23670_1.html
sat read_parallel(005) E4 - on Linux and on Windows (Products test case). May be it is non stable?
Improvements:
No improvements
Testing cases:
bugs vis(004) bug23670_1 - BAD
bugs vis(004) bug23670_2 - OK
Testing on Linux:
Total MEMORY difference: 366708032 / 365955156
Total CPU difference: 43899.300000001254 / 43866.130000001045
Testing on Windows:
Total MEMORY difference: 420565336 / 421157660
Total CPU difference: 40251.34375 / 32293.21875
There are following differences in images found by testdiff.
http://occt-tests/CR23670-master-occt/Debian60-64/diff-Debian60-64.html
http://occt-tests/CR23670-master-occt/Windows-32-VC9/diff-Windows-32-VC9.html
IMAGE bugs vis bug288_6: bug288_6.png differs
IMAGE bugs vis bug19_2: bug19_2.png differs
IMAGE bugs vis bug112_1: bug112_1.png differs
IMAGE bugs vis buc60661: buc60661.png differs
IMAGE bugs vis buc60701: buc60701.png differs
IMAGE bugs vis bug22835: bug22835.png differs
IMAGE bugs vis bug112: bug112_1.png differs
IMAGE bugs demo bug23409: bug23409.png differs
IMAGE bugs modalg_1 buc60905: buc60905.png differs
IMAGE bugs modalg_2 bug292: bug292.png differs
IMAGE bugs modalg_2 bug264_0: bug264_0.png differs
IMAGE bugs modalg_2 bug264_1: bug264_1.png differs
IMAGE bugs modalg_2 bug264_1: bug264_10.png differs
IMAGE bugs modalg_2 bug264_1: bug264_11.png differs
IMAGE bugs modalg_2 bug264_2: bug264_2.png differs
IMAGE bugs modalg_2 bug264_3: bug264_3.png differs
IMAGE bugs modalg_2 bug264_4: bug264_4.png differs
IMAGE bugs modalg_2 bug264_5: bug264_5.png differs
IMAGE bugs modalg_2 bug264_6: bug264_6.png differs
IMAGE bugs modalg_2 bug264_7: bug264_7.png differs
IMAGE bugs modalg_2 bug264_8: bug264_8.png differs
IMAGE bugs modalg_2 bug264_9: bug264_9.png differs
IMAGE bugs modalg_2 bug21909: bug21909.png differs
IMAGE bugs modalg_2 bug21: bug21909.png differs
IMAGE bugs modalg_2 bug264_10: bug264_10.png differs
IMAGE bugs modalg_2 bug264_11: bug264_11.png differs
IMAGE bugs modalg_4 bug62: bug625.png differs
IMAGE bugs modalg_4 bug625: bug625.png differs
IMAGE bugs moddata_2 bug6412: bug6412.png differs
IMAGE bugs moddata_2 bug6412: bug6412_1.png differs
IMAGE bugs moddata_2 bug256: bug2569_1.png differs
IMAGE bugs moddata_2 bug428: bug428.png differs
IMAGE bugs moddata_2 bug22746_1: bug22746_1.png differs
IMAGE bugs moddata_2 bug22746_2: bug22746_2.png differs
IMAGE bugs moddata_2 bug22746_3: bug22746_3.png differs
IMAGE bugs moddata_2 bug2569_1: bug2569_1.png differs
IMAGE bugs moddata_2 bug25: bug2569_1.png differs
IMAGE bugs moddata_2 bug42: bug428.png differs
IMAGE bugs moddata_2 bug4: bug428.png differs
IMAGE bugs moddata_2 bug6412_1: bug6412_1.png differs
Also, the clarity of the images is bad.
Branch CR23670 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
[revision removed]
Number of compiler warnings:
occt component :
Linux: 2 (2 on master)
Windows: 11 (11 on master)
products component :
Linux: 0 (0 on master)
Windows: 64 (64 on master)
Regressions:
bugs vis(004) bug23670_1 - on Linux
http://occt-tests/CR23670-master-occt/Debian60-64/bugs/vis/bug23670_1.html
sat read_parallel(005) E4 - on Linux and on Windows (Products test case). May be it is non stable?
Improvements:
No improvements
Testing cases:
bugs vis(004) bug23670_1 - BAD
bugs vis(004) bug23670_2 - OK
Testing on Linux:
Total MEMORY difference: 366708032 / 365955156
Total CPU difference: 43899.300000001254 / 43866.130000001045
Testing on Windows:
Total MEMORY difference: 420565336 / 421157660
Total CPU difference: 40251.34375 / 32293.21875
There are following differences in images found by testdiff.
http://occt-tests/CR23670-master-occt/Debian60-64/diff-Debian60-64.html
http://occt-tests/CR23670-master-occt/Windows-32-VC9/diff-Windows-32-VC9.html
IMAGE bugs vis bug288_6: bug288_6.png differs
IMAGE bugs vis bug19_2: bug19_2.png differs
IMAGE bugs vis bug112_1: bug112_1.png differs
IMAGE bugs vis buc60661: buc60661.png differs
IMAGE bugs vis buc60701: buc60701.png differs
IMAGE bugs vis bug22835: bug22835.png differs
IMAGE bugs vis bug112: bug112_1.png differs
IMAGE bugs demo bug23409: bug23409.png differs
IMAGE bugs modalg_1 buc60905: buc60905.png differs
IMAGE bugs modalg_2 bug292: bug292.png differs
IMAGE bugs modalg_2 bug264_0: bug264_0.png differs
IMAGE bugs modalg_2 bug264_1: bug264_1.png differs
IMAGE bugs modalg_2 bug264_1: bug264_10.png differs
IMAGE bugs modalg_2 bug264_1: bug264_11.png differs
IMAGE bugs modalg_2 bug264_2: bug264_2.png differs
IMAGE bugs modalg_2 bug264_3: bug264_3.png differs
IMAGE bugs modalg_2 bug264_4: bug264_4.png differs
IMAGE bugs modalg_2 bug264_5: bug264_5.png differs
IMAGE bugs modalg_2 bug264_6: bug264_6.png differs
IMAGE bugs modalg_2 bug264_7: bug264_7.png differs
IMAGE bugs modalg_2 bug264_8: bug264_8.png differs
IMAGE bugs modalg_2 bug264_9: bug264_9.png differs
IMAGE bugs modalg_2 bug21909: bug21909.png differs
IMAGE bugs modalg_2 bug21: bug21909.png differs
IMAGE bugs modalg_2 bug264_10: bug264_10.png differs
IMAGE bugs modalg_2 bug264_11: bug264_11.png differs
IMAGE bugs modalg_4 bug62: bug625.png differs
IMAGE bugs modalg_4 bug625: bug625.png differs
IMAGE bugs moddata_2 bug6412: bug6412.png differs
IMAGE bugs moddata_2 bug6412: bug6412_1.png differs
IMAGE bugs moddata_2 bug256: bug2569_1.png differs
IMAGE bugs moddata_2 bug428: bug428.png differs
IMAGE bugs moddata_2 bug22746_1: bug22746_1.png differs
IMAGE bugs moddata_2 bug22746_2: bug22746_2.png differs
IMAGE bugs moddata_2 bug22746_3: bug22746_3.png differs
IMAGE bugs moddata_2 bug2569_1: bug2569_1.png differs
IMAGE bugs moddata_2 bug25: bug2569_1.png differs
IMAGE bugs moddata_2 bug42: bug428.png differs
IMAGE bugs moddata_2 bug4: bug428.png differs
IMAGE bugs moddata_2 bug6412_1: bug6412_1.png differs
Also, the clarity of the images is bad.
ViewerTest::ViewerInit() method was corrected.
Dear san, please review.
Dear san, please review.
CR23670 was updated.
1) vviewlist command was modificated. Now it allows to get output as tree like:
Driver1:
Viewer1:
View1
or like list of full view names like:
Driver1/Viewer1/View Dwr/Vwr/myView
2) bugs/end script was edited to dump results from all opened views.
1) vviewlist command was modificated. Now it allows to get output as tree like:
Driver1:
Viewer1:
View1
or like list of full view names like:
Driver1/Viewer1/View Dwr/Vwr/myView
2) bugs/end script was edited to dump results from all opened views.
Branch CR23670 reviewed without remarks, ready for testing.
Dear Commenter 1,
Branch CR23670 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
[revision removed]
Number of compiler warnings:
occt component :
Linux: 2 (2 on master)
Windows: 11 (11 on master)
products component :
Linux: 0 (0 on master)
Windows: 64 (64 on master)
Regressions:
http://occt-tests/CR23670-master-occt/Debian60-64/summary.html
http://occt-tests/CR23670-master-occt/Windows-32-VC9/summary.html
bugs vis(004) bug280_2, bug280_3, bug349, bug349_1, bug6652
Improvements:
No improvements
Testing cases:
bugs vis(004) bug23670_1 - OK
bugs vis(004) bug23670_2 - OK
Testing on Linux:
Total MEMORY difference: 363924308 / 365459412
Total CPU difference: 44687.42000000066 / 45778.66000000136
Testing on Windows:
Total MEMORY difference: 417040112 / 419307964
Total CPU difference: 36616.0625 / 29779.953125
There are following differences in images found by testdiff.
http://occt-tests/CR23670-master-occt/Windows-32-VC9/diff-Windows-32-VC9.html
IMAGE bugs vis bug288_6: bug288_6.png differs
IMAGE bugs vis bug19_2: bug19_2.png differs
Branch CR23670 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
[revision removed]
Number of compiler warnings:
occt component :
Linux: 2 (2 on master)
Windows: 11 (11 on master)
products component :
Linux: 0 (0 on master)
Windows: 64 (64 on master)
Regressions:
http://occt-tests/CR23670-master-occt/Debian60-64/summary.html
http://occt-tests/CR23670-master-occt/Windows-32-VC9/summary.html
bugs vis(004) bug280_2, bug280_3, bug349, bug349_1, bug6652
Improvements:
No improvements
Testing cases:
bugs vis(004) bug23670_1 - OK
bugs vis(004) bug23670_2 - OK
Testing on Linux:
Total MEMORY difference: 363924308 / 365459412
Total CPU difference: 44687.42000000066 / 45778.66000000136
Testing on Windows:
Total MEMORY difference: 417040112 / 419307964
Total CPU difference: 36616.0625 / 29779.953125
There are following differences in images found by testdiff.
http://occt-tests/CR23670-master-occt/Windows-32-VC9/diff-Windows-32-VC9.html
IMAGE bugs vis bug288_6: bug288_6.png differs
IMAGE bugs vis bug19_2: bug19_2.png differs
> 2) bugs/end script was edited to dump results from all opened views.
bugs/end is not the only place where vinit is called second time to take snapshots.
bugs/end is not the only place where vinit is called second time to take snapshots.
The git branch CR23670 was updated:
1) bugs/end script was edited to dump results from all opened views
2) duplicated vinit was deleted from bug625
3) QABugs::OCC280() was edited to work with multiviews.
As workaround methods ViewerInit::InitViewName(), ViewerTest::RemoveViewName,ViewerTest::GetCurrentViewName were added to create non-orthographic views in QABugs functions.
Dear san, please review.
1) bugs/end script was edited to dump results from all opened views
2) duplicated vinit was deleted from bug625
3) QABugs::OCC280() was edited to work with multiviews.
As workaround methods ViewerInit::InitViewName(), ViewerTest::RemoveViewName,ViewerTest::GetCurrentViewName were added to create non-orthographic views in QABugs functions.
Dear san, please review.
Branch CR23670 reviewed without remarks, ready for testing.
Dear Commenter 1,
Branch CR23670 was compiled on Linux platform.
There are following compilation error:
http://jenkins-test-02.nnov.opencascade.com:8080/user/mnt/my-views/view/CR23670/job/mnt-CR23670-master_build_occt_linux/1/parsed_console/?
../../../../src/ViewerTest/ViewerTest_ViewerCommands.cxx: In function ‘int ViewerMainLoop(Standard_Integer, const char**)’:
../../../../src/ViewerTest/ViewerTest_ViewerCommands.cxx:2073: error: ‘RemoveView’ was not declared in this scope
make[2]: *** [ViewerTest_ViewerCommands.lo] Error 1
Branch CR23670 was compiled on Linux platform.
There are following compilation error:
http://jenkins-test-02.nnov.opencascade.com:8080/user/mnt/my-views/view/CR23670/job/mnt-CR23670-master_build_occt_linux/1/parsed_console/?
../../../../src/ViewerTest/ViewerTest_ViewerCommands.cxx: In function ‘int ViewerMainLoop(Standard_Integer, const char**)’:
../../../../src/ViewerTest/ViewerTest_ViewerCommands.cxx:2073: error: ‘RemoveView’ was not declared in this scope
make[2]: *** [ViewerTest_ViewerCommands.lo] Error 1
Compile error in the Linux part was corrected.
Dear san, please review.
Dear san, please review.
Branch CR23670 reviewed without remarks, ready for testing.
Dear Commenter 1,
Branch CR23670 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
[revision removed]
Number of compiler warnings:
occt component :
Linux: 2 (2 on master)
Windows: 7 (7 on master)
products component :
Linux: 0 (0 on master)
Windows: 63 (63 on master)
Regressions:
No regressions
Improvements:
No improvements
Testing cases:
bugs vis(004) bug23670_1, bug23670_2 - OK.
Testing on Linux:
Total MEMORY difference: 364684480 / 366092124
Total CPU difference: 52483.16999999947 / 43685.680000001455
Testing on Windows:
Total MEMORY difference: 419478552 / 422984572
Total CPU difference: 40942.828125 / 31251.296875
There are not differences in images found by testdiff.
Branch CR23670 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
[revision removed]
Number of compiler warnings:
occt component :
Linux: 2 (2 on master)
Windows: 7 (7 on master)
products component :
Linux: 0 (0 on master)
Windows: 63 (63 on master)
Regressions:
No regressions
Improvements:
No improvements
Testing cases:
bugs vis(004) bug23670_1, bug23670_2 - OK.
Testing on Linux:
Total MEMORY difference: 364684480 / 366092124
Total CPU difference: 52483.16999999947 / 43685.680000001455
Testing on Windows:
Total MEMORY difference: 419478552 / 422984572
Total CPU difference: 40942.828125 / 31251.296875
There are not differences in images found by testdiff.
Related records
- #0023663 · related to · closedRemoving 2D viewer library
- #0023707 · related to · closedNew Draw command for testing of HLR algorithm
- #0023709 · related to · closedRedesign of hlrtest command
- #0023605 · related to · closedDRAW crashes on closing the test 3D view under Linux
- #0024295 · related to · closedvclose behavior is inconsistent
- #0024430 · related to · closedvviewlist draw command does not added name of viewer created by XShow draw command
- #0024688 · related to · closedDraw Harness - vdump command makes snapshot only for the first view