DiscussionsIssue archiveOCCT:Modeling Algorithms

Archived issue #0032450

Modeling Algorithms - change BRepLib_CheckCurveOnSurface & GeomLib_CheckCurveOnSurface interfaces to adaptors

Open CASCADEOCCT:Modeling Algorithmsclosed28 public notes

Search issues

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.

Steps to reproduce

not exist

Public activity

28 archived notes

Participants are labeled by their role within this record.

01Commenter 2
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
02Commenter 2
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
03Commenter 5
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
04Commenter 6
src/GeomLib/GeomLib_CheckCurveOnSurface.hxx
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.
05Commenter 2
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
06Commenter 2
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
07Commenter 2
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
08Commenter 2
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
09Commenter 2
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
10Commenter 2
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
11Commenter 2
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
12Commenter 17
remarks fixed in branch CR32450_2
13Commenter 3
+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.
14Commenter 19
15Commenter 20
Please make a note in upgrade guide that the parameter isMultiThread changed its default value from true to false.

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.
16Commenter 2
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
17Commenter 22
fixed
18Commenter 23
For integration:
occt - CR32450_2
products - none
19Commenter 24
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/
20Commenter 2
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
21Commenter 2
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
22Commenter 27
Linux compilation problem fixed
23Commenter 2
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
24Commenter 29
For integration:
occt - CR32450_2
products - none
25Commenter 30
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
26Commenter 2
Branch [archived branch] has been deleted by Participant.

[revision removed]
27Commenter 2
Branch [archived branch] has been deleted by Participant.

[revision removed]
28Commenter 2
Branch [archived branch] has been deleted by Participant.

[revision removed]

Related records