View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0026083 | Open CASCADE | OCCT:Coding | public | 2015-04-16 09:00 | 2021-08-23 22:59 |
Reporter | Assigned To | bugmaster | |||
Priority | normal | Severity | minor | ||
Status | closed | Resolution | fixed | ||
Product Version | 6.9.0 | ||||
Target Version | 7.6.0 | Fixed in Version | 7.6.0 | ||
Summary | 0026083: Coding Rules - Poor design of Graphic3d_GraduatedTrihedron | ||||
Description | Implementation of Graphic3d_GraduatedTrihedron class is poor: - Graphic3d_GraduatedTrihedron.hxx contains definition of the class Graphic3d_AxisAspect which should be either made separate class (if it is useful outside of GraduatedTrihedron) or made nested class (or even simple structure) - It uses public fields (pointers!) for callback function and Visual3d_View which normally should be (a) private and get/set by appropriate methods and (b) objects (e.g. Handle for view) rather than plain pointers | ||||
Steps To Reproduce | Not required | ||||
Tags | No tags attached. | ||||
Test case number | Not required | ||||
|
Branch CR26083 has been created by CheskoArt. SHA-1: 0649c22f81e152239a55bc3b1347139f24c44c2c Detailed log of new commits: Author: CheskoArt Date: Wed Aug 4 14:37:46 2021 +0300 0026083: Poor design of Graphic3d_GraduatedTrihedron - Made class Graphic3d_AxisAspect publicly nested in Graphic3d_GraduatedTrihedron. - Removed public PtrView field from trihedron and obtained it from OpenGL_Workspace while rendering. - Made CubicAxesCallback protected and provided corresponding getter/setter. - Renamed AxisAspect() to AxisAspectAt(). |
|
+ MinMaxValuesCallback CubicAxesCallback() const { return myCubicAxesCallback; } I think there is no need exposing a getter to this class field, as it is used only internally. Only setter is needed. |
|
OpenGl_GraduatedTrihedron makes use of this callback, so it's used not only internally.@@ -566,9 +566,9 @@ void OpenGl_GraduatedTrihedron::Render (const Handle(OpenGl_Workspace)& theWorks OpenGl_Vec3 anOldMin = myMin; OpenGl_Vec3 anOldMax = myMax; - if (myData.CubicAxesCallback) + if (myData.CubicAxesCallback() != NULL) { - myData.CubicAxesCallback (myData.PtrView); + myData.CubicAxesCallback() (theWorkspace->View()); |
|
> OpenGl_GraduatedTrihedron makes use of this callback, > so it's used not only internally. In this case, please redefine Graphic3d_GraduatedTrihedron::CubicAxesCallback() as a method taking arguments and calling a slot internally. |
|
Branch CR26083 has been updated forcibly by CheskoArt. SHA-1: ff0975e6f3b6b99858fa84f60098b5a1e8f925f7 |
|
Changed signature of Graphic3d_GraduatedTrihedron::CubicAxesCallback() to accept callback's parameter |
|
Branch CR26083 has been updated forcibly by CheskoArt. SHA-1: 20d91ef39fb3da93666ceec0dc41a81955c08b5e |
|
Branch CR26083 has been updated forcibly by CheskoArt. SHA-1: 0e5794db296dafd6e642d5c442cf196fa6db9e1b |
|
Branch CR26083 has been updated forcibly by CheskoArt. SHA-1: 3a26eb529ca0d5e6d2ecf9794da5813eb91db3c6 |
|
Ready for review |
|
Patch should be rebased against the actual master before sending for testing/review. |
|
Branch CR26083 has been updated forcibly by CheskoArt. SHA-1: 1b5eb2be231815cf76d379f441ada467ac6e44f7 |
|
Updated branch. Ready for review. |
|
Combination - OCCT branch : IR-2021-08-13 master SHA - 7b5f784419eb9fd9a1d3dc69eff89d3e720d6e97 a87b7ddc8cb44606b91e3f37113847c3f5f50fdc Products branch : IR-2021-08-13 SHA - 8dc957c07e49e8db2f1330ec126160fe1c7eb89d 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: 17368.20000000041 / 17370.70000000038 [-0.01%] Products Total CPU difference: 11492.330000000085 / 11466.840000000084 [+0.22%] Windows-64-VC14: OCCT Total CPU difference: 19143.8125 / 19180.875 [-0.19%] Products Total CPU difference: 12803.65625 / 12837.4375 [-0.26%] Image differences : No differences that require special attention Memory differences : No differences that require special attention |
|
Branch CR26083 has been deleted by kgv. SHA-1: 1b5eb2be231815cf76d379f441ada467ac6e44f7 |
occt: master 1b5eb2be 2021-08-04 11:37:46 achesnok Details Diff |
0026083: Coding Rules - Poor design of Graphic3d_GraduatedTrihedron - Made class Graphic3d_AxisAspect publicly nested in Graphic3d_GraduatedTrihedron. - Removed public PtrView field from trihedron and obtained it from OpenGL_Workspace while rendering. - Made CubicAxesCallback protected and provided corresponding getter/setter. - Renamed AxisAspect() to AxisAspectAt(). |
Affected Issues 0026083 |
|
mod - src/Graphic3d/Graphic3d_GraduatedTrihedron.hxx | Diff File | ||
mod - src/OpenGl/OpenGl_GraduatedTrihedron.cxx | Diff File | ||
mod - src/OpenGl/OpenGl_GraduatedTrihedron.hxx | Diff File | ||
mod - src/OpenGl/OpenGl_View.cxx | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2015-04-16 09:00 |
|
New Issue | |
2015-04-16 09:00 |
|
Assigned To | => kgv |
2015-04-16 09:13 | kgv | Relationship added | related to 0025611 |
2016-11-01 06:41 |
|
Target Version | 7.1.0 => 7.2.0 |
2017-07-20 11:38 | kgv | Target Version | 7.2.0 => 7.4.0 |
2019-07-10 19:27 |
|
Target Version | 7.4.0 => 7.5.0 |
2020-08-28 14:45 | kgv | Target Version | 7.5.0 => 7.6.0 |
2021-08-02 11:40 |
|
Assigned To | kgv => CheskoArt |
2021-08-04 14:33 |
|
Status | new => assigned |
2021-08-04 14:53 | git | Note Added: 0102978 | |
2021-08-04 18:36 | kgv | Summary | Poor design of Graphic3d_GraduatedTrihedron => Coding Rules - Poor design of Graphic3d_GraduatedTrihedron |
2021-08-04 21:06 | kgv | Note Added: 0102990 | |
2021-08-05 12:42 |
|
Note Added: 0102994 | |
2021-08-05 13:42 | kgv | Note Added: 0102997 | |
2021-08-06 12:31 | git | Note Added: 0103023 | |
2021-08-06 12:43 |
|
Note Added: 0103024 | |
2021-08-06 13:05 | git | Note Added: 0103025 | |
2021-08-06 13:20 | git | Note Added: 0103026 | |
2021-08-06 18:48 | git | Note Added: 0103045 | |
2021-08-06 18:49 |
|
Note Added: 0103046 | |
2021-08-06 18:49 |
|
Assigned To | CheskoArt => kgv |
2021-08-06 18:49 |
|
Status | assigned => resolved |
2021-08-06 18:49 |
|
Steps to Reproduce Updated | |
2021-08-07 14:05 | kgv | Note Added: 0103088 | |
2021-08-07 14:05 | kgv | Assigned To | kgv => CheskoArt |
2021-08-07 14:05 | kgv | Status | resolved => assigned |
2021-08-09 19:16 | git | Note Added: 0103109 | |
2021-08-09 19:19 |
|
Note Added: 0103110 | |
2021-08-09 19:20 |
|
Assigned To | CheskoArt => kgv |
2021-08-09 19:20 |
|
Status | assigned => resolved |
2021-08-09 21:31 | kgv | Assigned To | kgv => bugmaster |
2021-08-09 21:31 | kgv | Status | resolved => reviewed |
2021-08-14 13:22 | bugmaster | Note Added: 0103198 | |
2021-08-14 13:22 | bugmaster | Status | reviewed => tested |
2021-08-14 13:25 | bugmaster | Test case number | => Not required |
2021-08-14 13:31 | Changeset attached | => occt master 1b5eb2be | |
2021-08-14 13:31 | bugmaster | Status | tested => verified |
2021-08-14 13:31 | bugmaster | Resolution | open => fixed |
2021-08-23 22:59 | git | Note Added: 0103352 |