Archived issue #0023959
Getting rid of generic classes in Visualization
Description
As one of steps related to WOK removal, it is necessary to revise generic CDL classes and turn them into non-CDL C++ classes.
If a class is used only once, it should become a regular C++ class. If a class is re-used in several places, the option to make it a C++ template should be considered.
It is proposed to start from the visualization packages (TKV3d toolkit - actually only Prs3d package is concerned, it contains 16 generic classes as of today).
If a class is used only once, it should become a regular C++ class. If a class is re-used in several places, the option to make it a C++ template should be considered.
It is proposed to start from the visualization packages (TKV3d toolkit - actually only Prs3d package is concerned, it contains 16 generic classes as of today).
Public activity
16 archived notes
Participants are labeled by their role within this record.
The git branch CR23959 is ready to be reviewed.
Generic classes replaced with template classes:
1) Prs3d_WFShape,
2) Prs3d_Point
Classes in StdPrs replaced with simple classes (as they implement generic classes from Prs3d):
1) StdPrs_WFRestrictedFace (implements Prs3d_WFRestrictedFace generic class)
2) StdPrs_HLRShape (implements Prs3d_HLRShape generic class)
3) DsgPrs_DatumPrs (implements Prs3d_Datum genetic class)
Classes deleted as empty and unused:
1) Prs3d_SectionShapeTool
2) Prs3d_PointTool
3) Prs3d_LineTool
4) Prs3d_HLRShapeTool
5) Prs3d_VectorTool
6) Prs3d_DatumTool
7) Prs3d_RestrictionTool
Classes removed as unused:
1) Prs3d_CurvePresentation
2) Prs3d_Vector
3) Prs3d_Line
Classes removed as unused (this functionality exists in StdPrs already):
1) Prs3d_WFDeflectionRestrictedFace
Dear san, please review.
Generic classes replaced with template classes:
1) Prs3d_WFShape,
2) Prs3d_Point
Classes in StdPrs replaced with simple classes (as they implement generic classes from Prs3d):
1) StdPrs_WFRestrictedFace (implements Prs3d_WFRestrictedFace generic class)
2) StdPrs_HLRShape (implements Prs3d_HLRShape generic class)
3) DsgPrs_DatumPrs (implements Prs3d_Datum genetic class)
Classes deleted as empty and unused:
1) Prs3d_SectionShapeTool
2) Prs3d_PointTool
3) Prs3d_LineTool
4) Prs3d_HLRShapeTool
5) Prs3d_VectorTool
6) Prs3d_DatumTool
7) Prs3d_RestrictionTool
Classes removed as unused:
1) Prs3d_CurvePresentation
2) Prs3d_Vector
3) Prs3d_Line
Classes removed as unused (this functionality exists in StdPrs already):
1) Prs3d_WFDeflectionRestrictedFace
Dear san, please review.
Branch CR23959 reviewed with the following remark:
- src/StdPrs/StdPrs_WFDeflectionShape.hxx, src/StdPrs/StdPrs_WFShape.hxx, src/StdPrs/StdPrs_Point.hxx, src/StdPrs/StdPrs_Vertex.hxx: typedef is preferred over #define, it provides type information to the compiler so the latter can produce more meaningful messages.
- src/StdPrs/StdPrs_WFDeflectionShape.hxx, src/StdPrs/StdPrs_WFShape.hxx, src/StdPrs/StdPrs_Point.hxx, src/StdPrs/StdPrs_Vertex.hxx: typedef is preferred over #define, it provides type information to the compiler so the latter can produce more meaningful messages.
In files:
src/StdPrs/StdPrs_WFDeflectionShape.hxx,
src/StdPrs/StdPrs_WFShape.hxx,
src/StdPrs/StdPrs_Point.hxx,
src/StdPrs/StdPrs_Vertex.hxx
define directive was changed to typedef.
Dear san, please review.
src/StdPrs/StdPrs_WFDeflectionShape.hxx,
src/StdPrs/StdPrs_WFShape.hxx,
src/StdPrs/StdPrs_Point.hxx,
src/StdPrs/StdPrs_Vertex.hxx
define directive was changed to typedef.
Dear san, please review.
Branch CR23959 reviewed without remarks, ready for testing.
Dear Commenter 1,
Branch CR23959 was compiled on Linux platform.
There are following extraction errors:
http://jenkins-test-02.nnov.opencascade.com:8080/user/mnt/my-views/view/CR23959/job/mnt-CR23959-master_prepare_occt_linux/1/parsed_console/?
Branch CR23959 was compiled on Linux platform.
There are following extraction errors:
http://jenkins-test-02.nnov.opencascade.com:8080/user/mnt/my-views/view/CR23959/job/mnt-CR23959-master_prepare_occt_linux/1/parsed_console/?
Dear Commenter 1,
Branch CR23959 was recompiled on Linux platform.
Extraction step is good now.
Branch CR23959 will be compiled and tested now.
Branch CR23959 was recompiled on Linux platform.
Extraction step is good now.
Branch CR23959 will be compiled and tested now.
Dear Commenter 1,
Branch CR23959 was compiled on Linux platform.
There are following compilation errors:
http://jenkins-test-02.nnov.opencascade.com:8080/user/mnt/my-views/view/CR23959/job/mnt-CR23959-master_build_occt_linux/1/parsed_console/?
Branch CR23959 was compiled on Linux platform.
There are following compilation errors:
http://jenkins-test-02.nnov.opencascade.com:8080/user/mnt/my-views/view/CR23959/job/mnt-CR23959-master_build_occt_linux/1/parsed_console/?
Compilation errors were corrected.
The git branch CR23959 was updated.
Dear san, please review.
The git branch CR23959 was updated.
Dear san, please review.
Branch CR23959 reviewed without remarks, ready for testing.
Dear Commenter 1,
Branch CR23959 (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:
http://occt-tests/CR23959-master-occt/Windows-32-VC9/bugs/vis/bug23747_1.html
bugs vis(004) bug23747_1 - BAD.
Improvements:
No improvements
Testing cases:
Not needed
Testing on Linux:
Total MEMORY difference: 366497096 / 366248232
Total CPU difference: 45936.57000000106 / 41752.48000000117
Testing on Windows:
Total MEMORY difference: 415872024 / 417160992
Total CPU difference: 43948.4375 / 41088.75
There are not differences in images found by testdiff.
Branch CR23959 (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:
http://occt-tests/CR23959-master-occt/Windows-32-VC9/bugs/vis/bug23747_1.html
bugs vis(004) bug23747_1 - BAD.
Improvements:
No improvements
Testing cases:
Not needed
Testing on Linux:
Total MEMORY difference: 366497096 / 366248232
Total CPU difference: 45936.57000000106 / 41752.48000000117
Testing on Windows:
Total MEMORY difference: 415872024 / 417160992
Total CPU difference: 43948.4375 / 41088.75
There are not differences in images found by testdiff.
Dear Commenter 1,
Test case bugs/vis(004)/bug23747_1 is not stable, it is OK "by hands".
Branch CR23959 is tested.
Test case bugs/vis(004)/bug23747_1 is not stable, it is OK "by hands".
Branch CR23959 is tested.
Dear Commenter 1,
Branch CR23959 was updated.
In DsgPrs_DatumPrs incorrect marker drawing in the origin of trihedron was fixed.
Could you please test it once more?
Branch CR23959 was updated.
In DsgPrs_DatumPrs incorrect marker drawing in the origin of trihedron was fixed.
Could you please test it once more?
Dear Commenter 1,
Branch CR23959 was compiled on Linux platform.
There are following compilation error:
In file included from ../../../../src/DsgPrs/DsgPrs_DatumPrs.cxx:18:
../../../../inc/DsgPrs_DatumPrs.hxx:32: error: ISO C++ forbids declaration of ‘gp_Ax2’ with no type
../../../../inc/DsgPrs_DatumPrs.hxx:32: error: expected ‘,’ or ‘...’ before ‘&’ token
../../../../src/DsgPrs/DsgPrs_DatumPrs.cxx:31: error: prototype for ‘void DsgPrs_DatumPrs::Add(const Handle_Prs3d_Presentation&, const gp_Ax2&, const Handle_Prs3d_Drawer&)’ does not match any in class ‘DsgPrs_DatumPrs’
../../../../inc/DsgPrs_DatumPrs.hxx:30: error: candidate is: static void DsgPrs_DatumPrs::Add(const Handle_Prs3d_Presentation&, int)
make[2]: *** [DsgPrs_DatumPrs.lo] Error 1
Branch CR23959 was compiled on Linux platform.
There are following compilation error:
In file included from ../../../../src/DsgPrs/DsgPrs_DatumPrs.cxx:18:
../../../../inc/DsgPrs_DatumPrs.hxx:32: error: ISO C++ forbids declaration of ‘gp_Ax2’ with no type
../../../../inc/DsgPrs_DatumPrs.hxx:32: error: expected ‘,’ or ‘...’ before ‘&’ token
../../../../src/DsgPrs/DsgPrs_DatumPrs.cxx:31: error: prototype for ‘void DsgPrs_DatumPrs::Add(const Handle_Prs3d_Presentation&, const gp_Ax2&, const Handle_Prs3d_Drawer&)’ does not match any in class ‘DsgPrs_DatumPrs’
../../../../inc/DsgPrs_DatumPrs.hxx:30: error: candidate is: static void DsgPrs_DatumPrs::Add(const Handle_Prs3d_Presentation&, int)
make[2]: *** [DsgPrs_DatumPrs.lo] Error 1
Compilation errors were corrected. The git branch was updated.
Dear san, please review.
Dear san, please review.
Branch CR23959 reviewed without remarks, ready for testing.
Dear Commenter 1,
Branch CR23959 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
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:
Not needed
Testing on Linux:
Total MEMORY difference: 366580304 / 364462604
Total CPU difference: 43905.89000000086 / 41174.07000000086
Testing on Windows:
Total MEMORY difference: 414606788 / 413497168
Total CPU difference: 36272.75 / 34944.171875
There are not differences in images found by testdiff.
Branch CR23959 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
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:
Not needed
Testing on Linux:
Total MEMORY difference: 366580304 / 364462604
Total CPU difference: 43905.89000000086 / 41174.07000000086
Testing on Windows:
Total MEMORY difference: 414606788 / 413497168
Total CPU difference: 36272.75 / 34944.171875
There are not differences in images found by testdiff.
Related records