Archived issue #0032450
Modeling Algorithms - change BRepLib_CheckCurveOnSurface & GeomLib_CheckCurveOnSurface interfaces to adaptors
Description
It is more correct to use adaptors instead of geometry in BRepLib_CheckCurveOnSurface & GeomLib_CheckCurveOnSurface classes’ interfaces. It should be borne in mind that the adaptors classes aren’t thread safe.
A patch file with implementation of this task (without thread safety) from CR29059-6 branch is attached.
A patch file with implementation of this task (without thread safety) from CR29059-6 branch is attached.
Steps to reproduce
not exist
Public activity
28 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: Tue Jul 13 17:17:51 2021 +0300
0032450: Modeling Algorithms - change BRepLib_CheckCurveOnSurface & GeomLib_CheckCurveOnSurface interfaces to adapters
[revision removed]
Detailed log of new commits:
Author: Author
Date: Tue Jul 13 17:17:51 2021 +0300
0032450: Modeling Algorithms - change BRepLib_CheckCurveOnSurface & GeomLib_CheckCurveOnSurface interfaces to adapters
Branch [archived branch] has been created by Author.
[revision removed]
Detailed log of new commits:
Author: Author
Date: Tue Jul 13 17:17:51 2021 +0300
0032450: Modeling Algorithms - change BRepLib_CheckCurveOnSurface & GeomLib_CheckCurveOnSurface interfaces to adapters
[revision removed]
Detailed log of new commits:
Author: Author
Date: Tue Jul 13 17:17:51 2021 +0300
0032450: Modeling Algorithms - change BRepLib_CheckCurveOnSurface & GeomLib_CheckCurveOnSurface interfaces to adapters
Michael, please make a preliminary review of the code in the CR32450_1 branch. There are no test results in the branch because the server is currently off
src/GeomLib/GeomLib_CheckCurveOnSurface.hxx
These definitions are not used and can be omitted.
thePCurve -> theCurveOnSurface
Move this definition out of global scope, inside the class or in the cpp file.
src/GeomLib/GeomLib_CheckCurveOnSurface.cxx
It is better to leave here adaptors by reference to value.
Do not throw away these checks, as you need to check the ends of myCurve and theCurveOnSurface.
Why not to use OSD_ThreadPool::Launcher in both cases? You create HArray1OfHCurve in any way. It is better to avoid such code duplication.
In this place isMultiThread is always true.
The usage of handle here is not justified. Replace with:
And make GeomLib_CheckCurveOnSurface_Local accepting arrays by reference instead of handles.
src/BRepLib/BRepLib_CheckCurveOnSurface.hxx
Change default value to false.
src/BRepLib/BRepLib_CheckCurveOnSurface.cxx
Useless include.
Please add info about changed API in upgrade guide.
class GeomAdaptor_Curve; class Adaptor2d_Curve2d; class Geom_Surface; class Geom2d_Curve;
These definitions are not used and can be omitted.
//! and 2d curve <thePCurve>
thePCurve -> theCurveOnSurface
typedef NCollection_Shared<NCollection_Array1<Handle(Adaptor3d_Curve)> > HArray1OfHCurve;
Move this definition out of global scope, inside the class or in the cpp file.
src/GeomLib/GeomLib_CheckCurveOnSurface.cxx
- const Adaptor3d_Curve& myCurve1; - const Adaptor3d_Curve& myCurve2; + const Handle(Adaptor3d_Curve)& myCurve1; + const Handle(Adaptor3d_Curve)& myCurve2;
It is better to leave here adaptors by reference to value.
- if(((myCurve->FirstParameter() - myFirst) > myTolRange) ||
- ((myCurve->LastParameter() - myLast) < -myTolRange) ||
- ((thePCurve->FirstParameter() - myFirst) > myTolRange) ||
- ((thePCurve->LastParameter() - myLast) < -myTolRange))
- {
- myErrorStatus = 2;
- return;
- }
Do not throw away these checks, as you need to check the ends of myCurve and theCurveOnSurface.
if (isMultiThread)
Why not to use OSD_ThreadPool::Launcher in both cases? You create HArray1OfHCurve in any way. It is better to avoid such code duplication.
const int aNbThreads = isMultiThread ? Min(anIntervals.Size(), aThreadPool->NbDefaultThreadsToLaunch()) : 1;
In this place isMultiThread is always true.
Handle(HArray1OfHCurve) aCurveArray = new HArray1OfHCurve(0, aNbThreads - 1);
The usage of handle here is not justified. Replace with:
Array1OfHCurve aCurveArray (0, aNbThreads - 1);
And make GeomLib_CheckCurveOnSurface_Local accepting arrays by reference instead of handles.
src/BRepLib/BRepLib_CheckCurveOnSurface.hxx
Standard_EXPORT void Perform(const Standard_Boolean isMultiThread = Standard_True);
Change default value to false.
src/BRepLib/BRepLib_CheckCurveOnSurface.cxx
#include <GeomAdaptor_Surface.hxx>
Useless include.
Please add info about changed API in upgrade guide.
Branch [archived branch] has been created by Author.
[revision removed]
Detailed log of new commits:
Author: Author
Date: Tue Jul 13 17:17:51 2021 +0300
0032450: Modeling Algorithms - change BRepLib_CheckCurveOnSurface & GeomLib_CheckCurveOnSurface interfaces to adapters
[revision removed]
Detailed log of new commits:
Author: Author
Date: Tue Jul 13 17:17:51 2021 +0300
0032450: Modeling Algorithms - change BRepLib_CheckCurveOnSurface & GeomLib_CheckCurveOnSurface interfaces to adapters
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
remarks fixed in branch CR32450_2
+Now the classes accept adaptors instead objects as incoming paramrters. ... +The folowing functions in *GeomLib_CheckCurveOnSurface* have been modified:
paramrters->parameters
folowing->following
incoming->input
It would be helpful configuring a spellchecker within your text editor.
Please make a note in upgrade guide that the parameter isMultiThread changed its default value from true to false.
src/GeomLib/GeomLib_CheckCurveOnSurface.hxx
Correct the comment: thePCurve -> theCurveOnSurface
src/GeomLib/GeomLib_CheckCurveOnSurface.cxx
It is no need to introduce the new variable anAdaptorCurve.
src/GeomLib/GeomLib_CheckCurveOnSurface.hxx
//! and 2d curve <thePCurve>
Correct the comment: thePCurve -> theCurveOnSurface
src/GeomLib/GeomLib_CheckCurveOnSurface.cxx
const Handle(Adaptor3d_Curve)& anAdaptorCurve = theCurveOnSurface;
aCurveOnSurfaceArray.SetValue(anI, aNbThreads > 1 ? theCurveOnSurface->ShallowCopy() : anAdaptorCurve);
It is no need to introduce the new variable anAdaptorCurve.
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
fixed
For integration:
occt - CR32450_2
products - none
occt - CR32450_2
products - none
The problems of compilation on Linux platform that block testing CR0-WEEK-35
Rebase branch to CR0-WEEK-35 and check compilation
http://jenkins-test-08.nnov.opencascade.com/view/CR0-WEEK-35/view/OCCT%20compile/job/CR0-WEEK-35-OCCT-Debian80-64-opt-compile/3/parsed_console/
Rebase branch to CR0-WEEK-35 and check compilation
http://jenkins-test-08.nnov.opencascade.com/view/CR0-WEEK-35/view/OCCT%20compile/job/CR0-WEEK-35-OCCT-Debian80-64-opt-compile/3/parsed_console/
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Linux compilation problem fixed
Branch [archived branch] has been updated forcibly by Participant.
[revision removed]
[revision removed]
For integration:
occt - CR32450_2
products - none
occt - CR32450_2
products - none
Combination -
OCCT branch : [archived branch]
master SHA - [revision removed]
[revision removed]
Products branch : [archived branch] SHA - [revision removed]
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: 17358.54000000042 / 17496.500000000422 [-0.79%]
Products
Total CPU difference: 11397.800000000112 / 11567.680000000111 [-1.47%]
Windows-64-VC14:
OCCT
Total CPU difference: 19328.109375 / 19307.609375 [+0.11%]
Products
Total CPU difference: 12733.328125 / 12920.953125 [-1.45%]
Image differences :
No differences that require special attention
Memory differences :
No differences that require special attention
OCCT branch : [archived branch]
master SHA - [revision removed]
[revision removed]
Products branch : [archived branch] SHA - [revision removed]
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: 17358.54000000042 / 17496.500000000422 [-0.79%]
Products
Total CPU difference: 11397.800000000112 / 11567.680000000111 [-1.47%]
Windows-64-VC14:
OCCT
Total CPU difference: 19328.109375 / 19307.609375 [+0.11%]
Products
Total CPU difference: 12733.328125 / 12920.953125 [-1.45%]
Image differences :
No differences that require special attention
Memory differences :
No differences that require special attention
Branch [archived branch] has been deleted by Participant.
[revision removed]
[revision removed]
Branch [archived branch] has been deleted by Participant.
[revision removed]
[revision removed]
Branch [archived branch] has been deleted by Participant.
[revision removed]
[revision removed]
Related records
- #0029059 · related to · closedModeling Algorithms - It is necessary to have a unique way of checking of the validity of the edge and its 2D curves
- #0032449 · related to · closedModeling Algorithms - make curves adaptors classes thread safe
- #0032485 · related to · closedModeling Algorithms - Add Clone() function for adapters