View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0031547 | Open CASCADE | OCCT:Visualization | public | 2020-05-04 20:43 | 2021-01-23 14:14 |
Reporter | nds | Assigned To | bugmaster | ||
Priority | normal | Severity | integration request | ||
Status | closed | Resolution | fixed | ||
Product Version | 7.1.0 | ||||
Target Version | 7.6.0 | Fixed in Version | 7.6.0 | ||
Summary | 0031547: Visualization - V3d_View creates V3d_Trihedron instance | ||||
Description | In 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 Reproduce | Not required | ||||
Tags | No tags attached. | ||||
Test case number | Not required | ||||
|
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. |
|
Wouldn't V3d_View::TriedronErase() crash with your patch? |
|
Please also try extending the patch to V3d_Viewer::myRGrid and V3d_Viewer::myCGrid, which could be also created on demand (see command vgrid). |
|
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 |
|
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 |
|
The patch makes grid practically always created, see AIS_ViewController:if (theView->Viewer()->Grid()->IsActive() && theView->Viewer()->GridEcho()) Please consider correcting AIS_ViewController. |
|
-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. |
|
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 |
|
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 |
|
Could you please rename V3d_Viewer::IsActive() to V3d_Viewer::IsGridActive() in scope of the patch (with keeping V3d_Viewer::IsActive() as deprecated alias)? |
|
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 |
|
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() |
|
+ 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. |
|
The same for V3d_View::Trihedron(bool theToCreate) |
|
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 |
|
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 |
|
Please raise the patch - OCCT branch: CR31547_5. |
|
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 |
occt: master 5634c81a 2020-12-31 06:37:51
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. |
Affected Issues 0031547 |
|
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 |
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 |
|
Note Added: 0098205 | |
2021-01-19 14:53 |
|
Assigned To | mkrylova => kgv |
2021-01-19 14:53 |
|
Status | assigned => resolved |
2021-01-19 14:53 |
|
Steps to Reproduce Updated | |
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 | |
2021-01-19 17:00 |
|
Note Added: 0098221 | |
2021-01-19 17:01 |
|
Note Added: 0098222 | |
2021-01-19 17:01 |
|
Assigned To | mkrylova => kgv |
2021-01-19 17:01 |
|
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 |
|
Note Added: 0098258 | |
2021-01-20 18:11 |
|
Note Added: 0098259 | |
2021-01-20 18:11 |
|
Assigned To | mkrylova => kgv |
2021-01-20 18:11 |
|
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 |
|
Note Added: 0098295 | |
2021-01-21 12:15 |
|
Note Added: 0098296 | |
2021-01-21 12:15 |
|
Assigned To | mkrylova => kgv |
2021-01-21 12:15 |
|
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 | |
2021-01-22 08:18 | kgv | Note Added: 0098326 | |
2021-01-22 12:34 |
|
Note Added: 0098331 | |
2021-01-22 12:36 |
|
Note Added: 0098332 | |
2021-01-22 12:36 |
|
Assigned To | mkrylova => kgv |
2021-01-22 12:36 |
|
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 |