MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0031547Open CASCADE[OCCT] OCCT:Visualizationpublic2020-05-04 20:432021-01-23 14:14
Reporternds 
Assigned Tobugmaster 
PrioritynormalSeverityintegration request 
StatusverifiedResolutionfixed 
PlatformOSOS Version
Product Version[OCCT] 7.1.0 
Target Version[OCCT] 7.6.0*Fixed in Version 
Summary0031547: Visualization - V3d_View creates V3d_Trihedron instance
DescriptionIn V3d_View constructor, we create an instance of V3d_Trihedron.

Reasons for avoiding this:
1. Each view gets an application memory for this object, though it might not be used until TriedronDisplay() is called.
2. There is an alternative presentation: AIS_Trihedron (more parameters to handle).

The proposal is to create V3d_Trihedron in V3d_View just by the first attempt to display it.
Steps To ReproduceNot required
TagsNo tags attached.
Test case numberNot required
Attached Files

- Relationships
child of 0024291closedapn Visualization - move Z-buffer trihedron presentation from TKOpenGl to TKV3d 

-  Notes
(0098205)
mkrylova (developer)
2021-01-19 14:52

Branch CR31547 has been created by mkrylova.
 
0031547: Visualization - V3d_View creates V3d_Trihedron instance

- moved creating of V3d_Trihedron from constructor to first attempt of displaying or calling it.
(0098209)
kgv (developer)
2021-01-19 15:01

Wouldn't V3d_View::TriedronErase() crash with your patch?
(0098219)
kgv (developer)
2021-01-19 15:06
edited on: 2021-01-19 15:07

Please also try extending the patch to V3d_Viewer::myRGrid and V3d_Viewer::myCGrid, which could be also created on demand (see command vgrid).

(0098221)
mkrylova (developer)
2021-01-19 17:00

Branch CR31547 has been updated by mkrylova
 # kgv remarks
- added a check in V3d_View::TriedronErase()
- extended to V3d_Viewer::myRGrid and V3d_Viewer::myCGrid
(0098222)
mkrylova (developer)
2021-01-19 17:01

Branch CR31547_1 has been created by mkrylova.
 
0031547: Visualization - V3d_View creates V3d_Trihedron instance

- moved creating of V3d_View::myTrihedron from constructor to first attempt of displaying or calling it
- moved creating of V3d_Viewer::myRGrid and V3d_Viewer::myCGrid to first attempt of displaying or calling them
(0098223)
kgv (developer)
2021-01-19 17:09

The patch makes grid practically always created, see AIS_ViewController:
  if (theView->Viewer()->Grid()->IsActive()
   && theView->Viewer()->GridEcho())


Please consider correcting AIS_ViewController.
(0098224)
kgv (developer)
2021-01-19 17:11

-Standard_Boolean V3d_Viewer::IsActive() const
+Standard_Boolean V3d_Viewer::IsActive()
 {
   return Grid()->IsActive();
...
-Aspect_GridDrawMode V3d_Viewer::GridDrawMode() const
+Aspect_GridDrawMode V3d_Viewer::GridDrawMode()
 {
   return Grid()->DrawMode();

It will be better returning stub here (check default values from grid constructor) instead of creating a Grid object.
(0098258)
mkrylova (developer)
2021-01-20 18:11

Branch CR31547_1 has been updated by mkrylova

 # kgv remarks:
- returned const stub in IsActive and DrawMode
- corrected AIS_ViewController and V3d_View to not make grid
(0098259)
mkrylova (developer)
2021-01-20 18:11

Branch CR31547_2 has been created by mkrylova.
 
0031547: Visualization - V3d_View creates V3d_Trihedron instance

- moved creating of V3d_View::myTrihedron from constructor to first attempt of displaying or calling it
- moved creating of V3d_Viewer::myRGrid and V3d_Viewer::myCGrid to first attempt of displaying or calling them
(0098260)
kgv (developer)
2021-01-20 18:17

Could you please rename V3d_Viewer::IsActive() to V3d_Viewer::IsGridActive() in scope of the patch (with keeping V3d_Viewer::IsActive() as deprecated alias)?
(0098295)
mkrylova (developer)
2021-01-21 12:14

Branch CR31547_2 has been updated by mkrylova

 # kgv remarks:
- renamed V3d_Viewer::IsActive() to V3d_Viewer::IsGridActive()
- kept V3d_Viewer::IsActive() as deprecated alias
(0098296)
mkrylova (developer)
2021-01-21 12:15

Branch CR31547_3 has been created by mkrylova.
 
0031547: Visualization - V3d_View creates V3d_Trihedron instance

- moved creating of V3d_View::myTrihedron from constructor to first attempt of displaying or calling it
- moved creating of V3d_Viewer::myRGrid and V3d_Viewer::myCGrid to first attempt of displaying or calling them
- renamed V3d_Viewer::IsActive() to V3d_Viewer::IsGridActive()
(0098318)
kgv (developer)
2021-01-21 17:43
edited on: 2021-01-21 17:43

+    if (!(myRGrid.IsNull() && myCGrid.IsNull()))
+    {
+      anActiveViewIter.Value()->SetGrid (myPrivilegedPlane, Grid());
+    }
...
+Handle(Aspect_Grid) V3d_Viewer::Grid()
+    case Aspect_GT_Circular:
+    {
+      if (myCGrid.IsNull())
+      {
+        myCGrid = new V3d_CircularGrid(this, Quantity_Color(Quantity_NOC_GRAY50), Quantity_Color(Quantity_NOC_GRAY70));

+      }
+      return Handle(Aspect_Grid) (myCGrid);
+    }
+    case Aspect_GT_Rectangular: 
+    {
+      if (myRGrid.IsNull())
+      {
+        myRGrid = new V3d_RectangularGrid(this, Quantity_Color(Quantity_NOC_GRAY50), Quantity_Color(Quantity_NOC_GRAY70));

+      }
+      return Handle(Aspect_Grid) (myRGrid);
+    }

The logic looks confusing.
I propose defining
> Handle(Aspect_Grid) V3d_Viewer::Grid (bool toCreate = true) {}
instead and call it with FALSE in places where it is desired to check for grid existance.

(0098326)
kgv (developer)
2021-01-22 08:18

The same for V3d_View::Trihedron(bool theToCreate)
(0098331)
mkrylova (developer)
2021-01-22 12:34

Branch CR31547_3 has been updated by mkrylova

 # kgv remarks:
- redefined V3d_View::Trihedron and V3d_Viewer::Grid by adding new argument toCreate for opportunity to check the existence of the objects without their recreating
(0098332)
mkrylova (developer)
2021-01-22 12:36

Branch CR31547_4 has been created by mkrylova.
 
0031547: Visualization - V3d_View creates V3d_Trihedron instance

- moved creating of V3d_View::myTrihedron from constructor to first attempt of displaying or calling it
- moved creating of V3d_Viewer::myRGrid and V3d_Viewer::myCGrid to to first attempt of displaying or calling them
- renamed V3d_Viewer::IsActive() to V3d_Viewer::IsGridActive()
- redefined V3d_View::Trihedron and V3d_Viewer::Grid by adding new argument toCreate for opportunity to check the existence of the objects without their recreating
(0098337)
kgv (developer)
2021-01-22 16:09

Please raise the patch
- OCCT branch: CR31547_5.
(0098377)
bugmaster (administrator)
2021-01-23 12:51

Combination -
OCCT branch : IR-2021-01-22
master SHA - 8948e18df815e356c59a750bd2711cb4a7914cec
a206de37fbfa0bf71bd534ae47192bbec23b8522
Products branch : IR-2021-01-22 SHA - 7cb485e51cb439852e1e1e0726af89f51d6d6db0
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: 17720.020000000055 / 17721.200000000135 [-0.01%]
Products
Total CPU difference: 12428.380000000123 / 12412.630000000105 [+0.13%]
Windows-64-VC14:
OCCT
Total CPU difference: 19367.234375 / 19300.265625 [+0.35%]
Products
Total CPU difference: 13821.875 / 13740.03125 [+0.60%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention

- Related Changesets
occt: master 5634c81a
Timestamp: 2020-12-31 06:37:51
Author: mkrylova
Committer: bugmaster
Details ] Diff ]
0031547: Visualization - V3d_View creates V3d_Trihedron instance

- moved creating of V3d_View::myTrihedron from constructor to first attempt of displaying or calling it;
- moved creating of V3d_Viewer::myRGrid and V3d_Viewer::myCGrid to to first attempt of displaying or calling them;
- renamed V3d_Viewer::IsActive() to V3d_Viewer::IsGridActive();
- redefined V3d_View::Trihedron() and V3d_Viewer::Grid() by adding new argument toCreate
for opportunity to check the existence of the objects without their recreating.
mod - samples/mfc/standard/01_Geometry/src/GeometryDoc.cpp Diff ] File ]
mod - samples/mfc/standard/Common/OCC_2dView.cpp Diff ] File ]
mod - src/AIS/AIS_ViewController.cxx Diff ] File ]
mod - src/QABugs/QABugs_6.cxx Diff ] File ]
mod - src/V3d/V3d_View.cxx Diff ] File ]
mod - src/V3d/V3d_View.hxx Diff ] File ]
mod - src/V3d/V3d_Viewer.cxx Diff ] File ]
mod - src/V3d/V3d_Viewer.hxx Diff ] File ]
mod - src/V3d/V3d_Viewer_4.cxx Diff ] File ]
mod - src/V3d/V3d_View_4.cxx Diff ] File ]
mod - src/ViewerTest/ViewerTest_ViewerCommands.cxx Diff ] File ]

- Issue History
Date Modified Username Field Change
2020-05-04 20:43 nds New Issue
2020-05-04 20:43 nds Assigned To => nds
2020-05-06 13:19 kgv Relationship added child of 0024291
2020-05-06 13:19 kgv Product Version => 7.1.0
2020-09-21 09:55 nds Target Version 7.5.0 => 7.6.0*
2020-12-14 12:49 kgv Assigned To nds => mkrylova
2020-12-14 12:49 kgv Severity minor => integration request
2020-12-14 12:49 kgv Status new => assigned
2021-01-19 14:52 mkrylova Note Added: 0098205
2021-01-19 14:53 mkrylova Assigned To mkrylova => kgv
2021-01-19 14:53 mkrylova Status assigned => resolved
2021-01-19 14:53 mkrylova Steps to Reproduce Updated View Revisions
2021-01-19 15:01 kgv Note Added: 0098209
2021-01-19 15:01 kgv Assigned To kgv => mkrylova
2021-01-19 15:01 kgv Status resolved => assigned
2021-01-19 15:06 kgv Note Added: 0098219
2021-01-19 15:07 kgv Note Edited: 0098219 View Revisions
2021-01-19 17:00 mkrylova Note Added: 0098221
2021-01-19 17:01 mkrylova Note Added: 0098222
2021-01-19 17:01 mkrylova Assigned To mkrylova => kgv
2021-01-19 17:01 mkrylova Status assigned => resolved
2021-01-19 17:09 kgv Note Added: 0098223
2021-01-19 17:09 kgv Assigned To kgv => mkrylova
2021-01-19 17:09 kgv Status resolved => assigned
2021-01-19 17:11 kgv Note Added: 0098224
2021-01-20 18:11 mkrylova Note Added: 0098258
2021-01-20 18:11 mkrylova Note Added: 0098259
2021-01-20 18:11 mkrylova Assigned To mkrylova => kgv
2021-01-20 18:11 mkrylova Status assigned => resolved
2021-01-20 18:17 kgv Note Added: 0098260
2021-01-20 20:39 kgv Assigned To kgv => mkrylova
2021-01-20 20:39 kgv Status resolved => assigned
2021-01-21 12:14 mkrylova Note Added: 0098295
2021-01-21 12:15 mkrylova Note Added: 0098296
2021-01-21 12:15 mkrylova Assigned To mkrylova => kgv
2021-01-21 12:15 mkrylova Status assigned => resolved
2021-01-21 17:43 kgv Note Added: 0098318
2021-01-21 17:43 kgv Assigned To kgv => mkrylova
2021-01-21 17:43 kgv Status resolved => assigned
2021-01-21 17:43 kgv Note Edited: 0098318 View Revisions
2021-01-22 08:18 kgv Note Added: 0098326
2021-01-22 12:34 mkrylova Note Added: 0098331
2021-01-22 12:36 mkrylova Note Added: 0098332
2021-01-22 12:36 mkrylova Assigned To mkrylova => kgv
2021-01-22 12:36 mkrylova Status assigned => resolved
2021-01-22 16:09 kgv Note Added: 0098337
2021-01-22 16:09 kgv Assigned To kgv => bugmaster
2021-01-22 16:09 kgv Status resolved => reviewed
2021-01-23 12:51 bugmaster Note Added: 0098377
2021-01-23 12:51 bugmaster Status reviewed => tested
2021-01-23 13:10 bugmaster Test case number => Not required
2021-01-23 14:14 bugmaster Changeset attached => occt master 5634c81a
2021-01-23 14:14 bugmaster Status tested => verified
2021-01-23 14:14 bugmaster Resolution open => fixed


Copyright © 2000 - 2021 MantisBT Team
Powered by Mantis Bugtracker