Archived issue #0025508
Visualization - redesign of 2d layers in TKV3d
Description
Current implementation of 2d layers has some disadvantages. In order to improve it, firstly, a new specification has to be developed. It should contain description of current 2d layers usage, their disadvantages, useful features that should be implemented during redesign, possible ways to solve described problems.
Steps to reproduce
test bugs vis bug25136 //color scale in overlay
vrect r //2d rectangle in underlay
vrect r //2d rectangle in underlay
Additional information
Current implementation of 2d layers consists of Visual3d_Layer, V3d_LayerMgr, Visual3d_layerItem. There are 2 types of layers: Overlayer and Underlayer. It is possible to draw following elements in these layers: verticies, polylines, rectangles and text (new implementation should be able to draw them too).
There are next cons in current implementation:
-Layer items redraw on each call (no buffering)
-No interaction and selection
-Cant control OpenGl resources
It would be nice to have next features:
*Ability to hide and display the whole layer
*Ability to select and interact with layer items
*Ability to have multi-level layers
One of possible ways to solve cons is to implement 2d layers as AIS objects:
+Selection and interaction
+Buffering
+Display priority
+Driven by AIS Context
I suggest to make this in the following way:
1) New class AIS_2dLayer which inherits from AIS_InteractiveObject.
2) AIS_2dLayer will be able to draw some standard objects (e.g. color scale).
3) New class AIS_2dLayerObject which inherits from AIS_InteractiveObject.
4) AIS_2dLayer keeps a list of AIS_2dLayerObject.
5) AIS_2dLayerObject has high-level drawing methods (e.g. DrawRectangle, DrawTriangle).
6) AIS_2dLayerObject uses Graphic3d_PrimitiveArray for buffering and drawing.
7) New methods for AIS_InteractiveContext which work with given AIS_2dLayer and iterate on his list of AIS_2dLayerObject (e.g. DisplayLayer(AIS_2dLayer)).
There are next cons in current implementation:
-Layer items redraw on each call (no buffering)
-No interaction and selection
-Cant control OpenGl resources
It would be nice to have next features:
*Ability to hide and display the whole layer
*Ability to select and interact with layer items
*Ability to have multi-level layers
One of possible ways to solve cons is to implement 2d layers as AIS objects:
+Selection and interaction
+Buffering
+Display priority
+Driven by AIS Context
I suggest to make this in the following way:
1) New class AIS_2dLayer which inherits from AIS_InteractiveObject.
2) AIS_2dLayer will be able to draw some standard objects (e.g. color scale).
3) New class AIS_2dLayerObject which inherits from AIS_InteractiveObject.
4) AIS_2dLayer keeps a list of AIS_2dLayerObject.
5) AIS_2dLayerObject has high-level drawing methods (e.g. DrawRectangle, DrawTriangle).
6) AIS_2dLayerObject uses Graphic3d_PrimitiveArray for buffering and drawing.
7) New methods for AIS_InteractiveContext which work with given AIS_2dLayer and iterate on his list of AIS_2dLayerObject (e.g. DisplayLayer(AIS_2dLayer)).
Public activity
18 archived notes
Participants are labeled by their role within this record.
Branch [archived branch] has been created by Author.
[revision removed]
Detailed log of new commits:
Author: Author
Date: Wed Dec 3 12:47:30 2014 +0300
0025508: Redesign of 2d layers in TKV3d
-Added example of drawing AIS object in 2d.
In order to see it:
1)Run Draw
2)call "pload ALL"
3)call "vinit"
4)call "vrect r"
[revision removed]
Detailed log of new commits:
Author: Author
Date: Wed Dec 3 12:47:30 2014 +0300
0025508: Redesign of 2d layers in TKV3d
-Added example of drawing AIS object in 2d.
In order to see it:
1)Run Draw
2)call "pload ALL"
3)call "vinit"
4)call "vrect r"
Branch [archived branch] has been created by Author.
[revision removed]
Detailed log of new commits:
Author: Author
Date: Fri Dec 19 16:51:40 2014 +0300
2d layers implemented. New classes AIS_Layer2d and AIS_2dLayerObject were added. Example 2d class - AIS_Rectangle - inherits from AIS_2dLayerObject.
Draw command vdrawtext was modified to draw text in 2d.
Author: Author
Date: Wed Dec 3 12:47:30 2014 +0300
0025508: Redesign of 2d layers in TKV3d
-Added example of drawing AIS object in 2d.
In order to see it:
1)Run Draw
2)call "pload ALL"
3)call "vinit"
4)call "vrect r"
[revision removed]
Detailed log of new commits:
Author: Author
Date: Fri Dec 19 16:51:40 2014 +0300
2d layers implemented. New classes AIS_Layer2d and AIS_2dLayerObject were added. Example 2d class - AIS_Rectangle - inherits from AIS_2dLayerObject.
Draw command vdrawtext was modified to draw text in 2d.
Author: Author
Date: Wed Dec 3 12:47:30 2014 +0300
0025508: Redesign of 2d layers in TKV3d
-Added example of drawing AIS object in 2d.
In order to see it:
1)Run Draw
2)call "pload ALL"
3)call "vinit"
4)call "vrect r"
Branch [archived branch] has been updated by Author.
[revision removed]
Detailed log of new commits:
Author: Author
Date: Mon Dec 22 19:46:23 2014 +0300
First version of AIS_ColorScale implemented.
[revision removed]
Detailed log of new commits:
Author: Author
Date: Mon Dec 22 19:46:23 2014 +0300
First version of AIS_ColorScale implemented.
Branch [archived branch] has been updated by Author.
[revision removed]
Detailed log of new commits:
Author: Author
Date: Fri Dec 26 14:01:05 2014 +0300
Color scale is implemented on AIS. Draw command vcolorscale now works with AIS_ColorScale.
[revision removed]
Detailed log of new commits:
Author: Author
Date: Fri Dec 26 14:01:05 2014 +0300
Color scale is implemented on AIS. Draw command vcolorscale now works with AIS_ColorScale.
Branch [archived branch] has been updated by Author.
[revision removed]
Detailed log of new commits:
Author: Author
Date: Mon Dec 29 17:19:35 2014 +0300
Added documentation on AIS_Layer2d and AIS_2dObjects. Compiler warnings fixed.
[revision removed]
Detailed log of new commits:
Author: Author
Date: Mon Dec 29 17:19:35 2014 +0300
Added documentation on AIS_Layer2d and AIS_2dObjects. Compiler warnings fixed.
Please re-base your developments on top of #0024394
Branch [archived branch] has been created by Author.
[revision removed]
Detailed log of new commits:
Author: Author
Date: Tue Jan 20 12:24:30 2015 +0300
Branch rebased on CR24394_6. Compiler warnings fixed.
Author: Author
Date: Mon Dec 29 17:19:35 2014 +0300
Added documentation on AIS_Layer2d and AIS_2dObjects. Compiler warnings fixed.
Author: Author
Date: Fri Dec 26 14:01:05 2014 +0300
Color scale is implemented on AIS. Draw command vcolorscale now works with AIS_ColorScale.
Author: Author
Date: Mon Dec 22 19:46:23 2014 +0300
First version of AIS_ColorScale implemented.
Author: Author
Date: Fri Dec 19 16:51:40 2014 +0300
2d layers implemented. New classes AIS_Layer2d and AIS_2dLayerObject were added. Example 2d class - AIS_Rectangle - inherits from AIS_2dLayerObject.
Draw command vdrawtext was modified to draw text in 2d.
Author: Author
Date: Wed Dec 3 12:47:30 2014 +0300
0025508: Redesign of 2d layers in TKV3d
-Added example of drawing AIS object in 2d.
In order to see it:
1)Run Draw
2)call "pload ALL"
3)call "vinit"
4)call "vrect r"
[revision removed]
Detailed log of new commits:
Author: Author
Date: Tue Jan 20 12:24:30 2015 +0300
Branch rebased on CR24394_6. Compiler warnings fixed.
Author: Author
Date: Mon Dec 29 17:19:35 2014 +0300
Added documentation on AIS_Layer2d and AIS_2dObjects. Compiler warnings fixed.
Author: Author
Date: Fri Dec 26 14:01:05 2014 +0300
Color scale is implemented on AIS. Draw command vcolorscale now works with AIS_ColorScale.
Author: Author
Date: Mon Dec 22 19:46:23 2014 +0300
First version of AIS_ColorScale implemented.
Author: Author
Date: Fri Dec 19 16:51:40 2014 +0300
2d layers implemented. New classes AIS_Layer2d and AIS_2dLayerObject were added. Example 2d class - AIS_Rectangle - inherits from AIS_2dLayerObject.
Draw command vdrawtext was modified to draw text in 2d.
Author: Author
Date: Wed Dec 3 12:47:30 2014 +0300
0025508: Redesign of 2d layers in TKV3d
-Added example of drawing AIS object in 2d.
In order to see it:
1)Run Draw
2)call "pload ALL"
3)call "vinit"
4)call "vrect r"
Branch [archived branch] has been updated by Author.
[revision removed]
Detailed log of new commits:
Author: Author
Date: Mon Jan 26 15:10:50 2015 +0300
Is2d flag is added to ZlayerSettings. Graphic3d_ZLayerId_BotOSD with id -5 is added to draw underlay.
Displaying objects in 2d now works through zlayers.
[revision removed]
Detailed log of new commits:
Author: Author
Date: Mon Jan 26 15:10:50 2015 +0300
Is2d flag is added to ZlayerSettings. Graphic3d_ZLayerId_BotOSD with id -5 is added to draw underlay.
Displaying objects in 2d now works through zlayers.
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been created by Author.
[revision removed]
Detailed log of new commits:
Author: Author
Date: Fri Jan 30 10:10:54 2015 +0300
0025508: Redesign of 2d layers in TKV3d
Displaying objects in 2d now works through zlayers. Is2d flag is added to ZlayerSettings.
Graphic3d_ZLayerId_BotOSD with id -5 is added to draw underlay. Class AIS_Rectangle and draw command "vrectangle" are added for example.
AIS_Colorscale implemented, vcolorscale command updated.
[revision removed]
Detailed log of new commits:
Author: Author
Date: Fri Jan 30 10:10:54 2015 +0300
0025508: Redesign of 2d layers in TKV3d
Displaying objects in 2d now works through zlayers. Is2d flag is added to ZlayerSettings.
Graphic3d_ZLayerId_BotOSD with id -5 is added to draw underlay. Class AIS_Rectangle and draw command "vrectangle" are added for example.
AIS_Colorscale implemented, vcolorscale command updated.
Branch [archived branch] has been created by Author.
[revision removed]
Detailed log of new commits:
Author: Author
Date: Mon Feb 2 13:46:32 2015 +0300
AIS_ColorScale is rebased on fixed version(CR25136_2). Matrix settings for 2d are moved into OpenGl_Layer from OpenGl_LayerList, OCC method OpenGl_Utils::Ortho2D is used to set a proper matrix. Cosmetic fixes are made.
Author: Author
Date: Fri Jan 30 10:10:54 2015 +0300
0025508: Redesign of 2d layers in TKV3d
Displaying objects in 2d now works through zlayers. Is2d flag is added to ZlayerSettings.
Graphic3d_ZLayerId_BotOSD with id -5 is added to draw underlay. Class AIS_Rectangle and draw command "vrectangle" are added for example.
AIS_Colorscale implemented, vcolorscale command updated.
[revision removed]
Detailed log of new commits:
Author: Author
Date: Mon Feb 2 13:46:32 2015 +0300
AIS_ColorScale is rebased on fixed version(CR25136_2). Matrix settings for 2d are moved into OpenGl_Layer from OpenGl_LayerList, OCC method OpenGl_Utils::Ortho2D is used to set a proper matrix. Cosmetic fixes are made.
Author: Author
Date: Fri Jan 30 10:10:54 2015 +0300
0025508: Redesign of 2d layers in TKV3d
Displaying objects in 2d now works through zlayers. Is2d flag is added to ZlayerSettings.
Graphic3d_ZLayerId_BotOSD with id -5 is added to draw underlay. Class AIS_Rectangle and draw command "vrectangle" are added for example.
AIS_Colorscale implemented, vcolorscale command updated.
Dear Kirill,
Please review branch CR25508_5.
Please review branch CR25508_5.
Branch [archived branch] has been deleted by Commenter 3.
[revision removed]
[revision removed]
Branch [archived branch] has been deleted by Commenter 3.
[revision removed]
[revision removed]
Branch [archived branch] has been deleted by Commenter 3.
[revision removed]
[revision removed]
Branch [archived branch] has been deleted by Commenter 3.
[revision removed]
[revision removed]
Branch [archived branch] has been deleted by Commenter 3.
[revision removed]
[revision removed]
Dear Commenter 1,
please switch this issue to verified since key features have been implemented (in scope of child issues).
please switch this issue to verified since key features have been implemented (in scope of child issues).
Related records
- #0025783 · parent of · closedVisualization - allow Z-layer to draw 2D objects and to make it alternative to Overlay and Underlay
- #0025338 · parent of · closedMFC standard samples: 3D selection rectangle blinking.
- #0026921 · parent of · closedVisualization - handle Graphic3d_TMF_2d objects within selection
- #0025785 · related to · closedVisualization - introduce AIS_ColorScale presentation for Color Scale
- #0025789 · related to · closedVisualization - get rid of obsolete 2d layers implementation