1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +03:00

0032448: Modeling Algorithms - Provide exact validating (as option) using GeomLib_CheckCurveOnSurface

Add '-exact' option to checkshape command to use exact method to validate edges using BRepLib_ValidateEdge class. Default mode is calculating in finite number of points.
This commit is contained in:
akaftasev 2021-10-28 19:23:37 +03:00 committed by inv
parent 6eddc28410
commit 0ffecc2fc7
27 changed files with 324 additions and 62 deletions

View File

@ -2293,3 +2293,22 @@ void Perform(const Handle(Adaptor3d_CurveOnSurface)& theCurveOnSurface,
- *BRepAlgo_Cut*
- *BRepAlgo_Section*
The corresponding classes from the *BRepAlgoAPI* package have to be used instead.
@section upgrade_occt770 Upgrade to OCCT 7.7.0
@subsection upgrade_occt770_parallel_flag_removed Removed parameter theIsParallel from Put/Compute/Perform
theIsParallel parameter has been removed from Put/Compute/Perform from the next classes:
- BRepCheck_Analyzer
- BRepCheck_Edge
- BRepLib_ValidateEdge
- GeomLib_CheckCurveOnSurface
- BRepLib_CheckCurveOnSurface
Now, to set this flag, it is necessary to use method SetParallel()
For example:
~~~~{.cpp}
BRepLib_ValidateEdge aValidateEdge(myHCurve, ACS, SameParameter);
aValidateEdge.SetParallel(toRunParallel);
aValidateEdge.Process();
~~~~

View File

@ -7545,7 +7545,7 @@ xdistc2dc2dss c2d1_1 c2d2_1 s1 s2 0 1 1000
Syntax:
~~~~{.php}
checkshape [-top] shape [result] [-short] [-parallel]
checkshape [-top] shape [result] [-short] [-parallel] [-exact]
~~~~
Where:
@ -7554,6 +7554,7 @@ Where:
* *result* -- optional parameter, defines custom prefix for the output shape names.
* *short* -- a short description of the check.
* *parallel* -- run check in multithread mode.
* *exact* -- run check using exact method.
**checkshape** examines the selected object for topological and geometric coherence. The object should be a three dimensional shape.

View File

@ -346,8 +346,7 @@ private:
//purpose :
//=======================================================================
void BRepCheck_Analyzer::Init (const TopoDS_Shape& theShape,
const Standard_Boolean B,
const Standard_Boolean theIsParallel)
const Standard_Boolean B)
{
if (theShape.IsNull())
{
@ -356,8 +355,8 @@ void BRepCheck_Analyzer::Init (const TopoDS_Shape& theShape,
myShape = theShape;
myMap.Clear();
Put (theShape, B, theIsParallel);
Perform (theIsParallel);
Put (theShape, B);
Perform();
}
//=======================================================================
@ -365,8 +364,7 @@ void BRepCheck_Analyzer::Init (const TopoDS_Shape& theShape,
//purpose :
//=======================================================================
void BRepCheck_Analyzer::Put (const TopoDS_Shape& theShape,
const Standard_Boolean B,
const Standard_Boolean theIsParallel)
const Standard_Boolean B)
{
if (myMap.Contains (theShape))
{
@ -382,6 +380,7 @@ void BRepCheck_Analyzer::Put (const TopoDS_Shape& theShape,
case TopAbs_EDGE:
HR = new BRepCheck_Edge (TopoDS::Edge (theShape));
Handle(BRepCheck_Edge)::DownCast(HR)->GeometricControls (B);
Handle(BRepCheck_Edge)::DownCast(HR)->SetExactMethod(myIsExact);
break;
case TopAbs_WIRE:
HR = new BRepCheck_Wire (TopoDS::Wire (theShape));
@ -406,13 +405,13 @@ void BRepCheck_Analyzer::Put (const TopoDS_Shape& theShape,
if (!HR.IsNull())
{
HR->SetParallel (theIsParallel);
HR->SetParallel (myIsParallel);
}
myMap.Add (theShape, HR);
for (TopoDS_Iterator theIterator (theShape); theIterator.More(); theIterator.Next())
{
Put (theIterator.Value(), B, theIsParallel); // performs minimum on each shape
Put (theIterator.Value(), B); // performs minimum on each shape
}
}
@ -420,7 +419,7 @@ void BRepCheck_Analyzer::Put (const TopoDS_Shape& theShape,
//function : Perform
//purpose :
//=======================================================================
void BRepCheck_Analyzer::Perform (Standard_Boolean theIsParallel)
void BRepCheck_Analyzer::Perform()
{
const Standard_Integer aMapSize = myMap.Size();
const Standard_Integer aMinTaskSize = 10;
@ -453,7 +452,7 @@ void BRepCheck_Analyzer::Perform (Standard_Boolean theIsParallel)
}
BRepCheck_ParallelAnalyzer aParallelAnalyzer (aArrayOfArray, myMap);
OSD_Parallel::For (0, aArrayOfArray.Size(), aParallelAnalyzer, !theIsParallel);
OSD_Parallel::For (0, aArrayOfArray.Size(), aParallelAnalyzer, !myIsParallel);
}
//=======================================================================

View File

@ -59,9 +59,12 @@ public:
//! BRepCheck_SelfIntersectingWire
BRepCheck_Analyzer (const TopoDS_Shape& S,
const Standard_Boolean GeomControls = Standard_True,
const Standard_Boolean theIsParallel = Standard_False)
const Standard_Boolean theIsParallel = Standard_False,
const Standard_Boolean theIsExact = Standard_False)
: myIsParallel(theIsParallel),
myIsExact(theIsExact)
{
Init (S, GeomControls, theIsParallel);
Init (S, GeomControls);
}
//! <S> is the shape to control. <GeomControls> If
@ -81,8 +84,35 @@ public:
//! For a wire :
//! BRepCheck_SelfIntersectingWire
Standard_EXPORT void Init (const TopoDS_Shape& S,
const Standard_Boolean GeomControls = Standard_True,
const Standard_Boolean theIsParallel = Standard_False);
const Standard_Boolean GeomControls = Standard_True);
//! Sets method to calculate distance: Calculating in finite number of points (if theIsExact
//! is false, faster, but possible not correct result) or exact calculating by using
//! BRepLib_CheckCurveOnSurface class (if theIsExact is true, slowly, but more correctly).
//! Exact method is used only when edge is SameParameter.
//! Default method is calculating in finite number of points
void SetExactMethod(const Standard_Boolean theIsExact)
{
myIsExact = theIsExact;
}
//! Returns true if exact method selected
Standard_Boolean IsExactMethod()
{
return myIsExact;
}
//! Sets parallel flag
void SetParallel(const Standard_Boolean theIsParallel)
{
myIsParallel = theIsParallel;
}
//! Returns true if parallel flag is set
Standard_Boolean IsParallel()
{
return myIsParallel;
}
//! <S> is a subshape of the original shape. Returns
//! <STandard_True> if no default has been detected on
@ -141,10 +171,9 @@ public:
private:
Standard_EXPORT void Put (const TopoDS_Shape& S,
const Standard_Boolean Gctrl,
const Standard_Boolean theIsParallel);
const Standard_Boolean Gctrl);
Standard_EXPORT void Perform (Standard_Boolean theIsParallel);
Standard_EXPORT void Perform();
Standard_EXPORT Standard_Boolean ValidSub (const TopoDS_Shape& S, const TopAbs_ShapeEnum SubType) const;
@ -152,6 +181,8 @@ private:
TopoDS_Shape myShape;
BRepCheck_IndexedDataMapOfShapeResult myMap;
Standard_Boolean myIsParallel;
Standard_Boolean myIsExact;
};

View File

@ -75,6 +75,7 @@ BRepCheck_Edge::BRepCheck_Edge(const TopoDS_Edge& E)
{
Init(E);
myGctrl = Standard_True;
myIsExactMethod = Standard_False;
}
//=======================================================================
@ -321,6 +322,7 @@ void BRepCheck_Edge::InContext(const TopoDS_Shape& S)
BRep_ListIteratorOfListOfCurveRepresentation itcr(TE->Curves());
Standard_Real eps = Precision::PConfusion();
Standard_Boolean toRunParallel = !myMutex.IsNull();
while (itcr.More()) {
const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
if (cr != myCref && cr->IsCurveOnSurface(Su,L)) {
@ -385,6 +387,8 @@ void BRepCheck_Edge::InContext(const TopoDS_Shape& S)
BRepLib_ValidateEdge aValidateEdge(myHCurve, ACS, SameParameter);
aValidateEdge.SetExitIfToleranceExceeded(Tol);
aValidateEdge.SetExactMethod(myIsExactMethod);
aValidateEdge.SetParallel(toRunParallel);
aValidateEdge.Process();
if (!aValidateEdge.IsDone() || !aValidateEdge.CheckTolerance(Tol))
{
@ -407,6 +411,8 @@ void BRepCheck_Edge::InContext(const TopoDS_Shape& S)
BRepLib_ValidateEdge aValidateEdgeOnClosedSurf(myHCurve, ACS, SameParameter);
aValidateEdgeOnClosedSurf.SetExitIfToleranceExceeded(Tol);
aValidateEdgeOnClosedSurf.SetExactMethod(myIsExactMethod);
aValidateEdgeOnClosedSurf.SetParallel(toRunParallel);
aValidateEdgeOnClosedSurf.Process();
if (!aValidateEdgeOnClosedSurf.IsDone() || !aValidateEdgeOnClosedSurf.CheckTolerance(Tol))
{
@ -466,6 +472,8 @@ void BRepCheck_Edge::InContext(const TopoDS_Shape& S)
BRepLib_ValidateEdge aValidateEdgeProj(myHCurve, ACS, SameParameter);
aValidateEdgeProj.SetExitIfToleranceExceeded(Tol);
aValidateEdgeProj.SetExactMethod(myIsExactMethod);
aValidateEdgeProj.SetParallel(toRunParallel);
aValidateEdgeProj.Process();
if (!aValidateEdgeProj.IsDone() || !aValidateEdgeProj.CheckTolerance(Tol))
{

View File

@ -51,7 +51,23 @@ public:
//! Sets status of Edge;
Standard_EXPORT void SetStatus (const BRepCheck_Status theStatus);
//! Sets method to calculate distance: Calculating in finite number of points (if theIsExact
//! is false, faster, but possible not correct result) or exact calculating by using
//! BRepLib_CheckCurveOnSurface class (if theIsExact is true, slowly, but more correctly).
//! Exact method is used only when edge is SameParameter.
//! Default method is calculating in finite number of points
void SetExactMethod(Standard_Boolean theIsExact)
{
myIsExactMethod = theIsExact;
}
//! Returns true if exact method selected
Standard_Boolean IsExactMethod()
{
return myIsExactMethod;
}
//! Checks, if polygon on triangulation of heEdge
//! is out of 3D-curve of this edge.
Standard_EXPORT BRepCheck_Status CheckPolygonOnTriangulation (const TopoDS_Edge& theEdge);
@ -64,7 +80,7 @@ private:
Handle(BRep_CurveRepresentation) myCref;
Handle(Adaptor3d_Curve) myHCurve;
Standard_Boolean myGctrl;
Standard_Boolean myIsExactMethod;
};
#endif // _BRepCheck_Edge_HeaderFile

View File

@ -32,6 +32,7 @@
BRepLib_CheckCurveOnSurface::BRepLib_CheckCurveOnSurface
( const TopoDS_Edge& theEdge,
const TopoDS_Face& theFace)
: myIsParallel(Standard_False)
{
Init(theEdge, theFace);
}
@ -89,10 +90,10 @@ void BRepLib_CheckCurveOnSurface::Init(const TopoDS_Edge& theEdge, const TopoDS_
//function : Perform
//purpose : if isTheMTDisabled == TRUE parallelization is not used
//=======================================================================
void BRepLib_CheckCurveOnSurface::Perform(const Standard_Boolean isMultiThread)
void BRepLib_CheckCurveOnSurface::Perform()
{
// Compute the max distance
Compute(myAdaptorCurveOnSurface, isMultiThread);
Compute(myAdaptorCurveOnSurface);
if (ErrorStatus())
{
return;
@ -102,7 +103,7 @@ void BRepLib_CheckCurveOnSurface::Perform(const Standard_Boolean isMultiThread)
{
// compute max distance for myAdaptorCurveOnSurface2
// (for the second curve on closed surface)
Compute(myAdaptorCurveOnSurface2, isMultiThread);
Compute(myAdaptorCurveOnSurface2);
}
}
@ -110,8 +111,8 @@ void BRepLib_CheckCurveOnSurface::Perform(const Standard_Boolean isMultiThread)
//function : Compute
//purpose : if isTheMTDisabled == TRUE parallelization is not used
//=======================================================================
void BRepLib_CheckCurveOnSurface::Compute(const Handle(Adaptor3d_CurveOnSurface)& theCurveOnSurface,
const Standard_Boolean isMultiThread)
void BRepLib_CheckCurveOnSurface::Compute(const Handle(Adaptor3d_CurveOnSurface)& theCurveOnSurface)
{
myCOnSurfGeom.Perform(theCurveOnSurface, isMultiThread);
myCOnSurfGeom.SetParallel(myIsParallel);
myCOnSurfGeom.Perform(theCurveOnSurface);
}

View File

@ -27,7 +27,10 @@ public:
DEFINE_STANDARD_ALLOC
//! Default constructor
BRepLib_CheckCurveOnSurface() {}
BRepLib_CheckCurveOnSurface()
: myIsParallel(Standard_False)
{
}
//! Constructor
Standard_EXPORT BRepLib_CheckCurveOnSurface(const TopoDS_Edge& theEdge,
@ -37,8 +40,8 @@ public:
Standard_EXPORT void Init (const TopoDS_Edge& theEdge, const TopoDS_Face& theFace);
//! Performs the calculation
//! If isMultiThread == Standard_True then computation will be performed in parallel.
Standard_EXPORT void Perform(const Standard_Boolean isMultiThread = Standard_False);
//! If myIsParallel == Standard_True then computation will be performed in parallel.
Standard_EXPORT void Perform();
//! Returns true if the max distance has been found
Standard_Boolean IsDone() const
@ -46,6 +49,18 @@ public:
return myCOnSurfGeom.ErrorStatus() == 0;
}
//! Sets parallel flag
void SetParallel(const Standard_Boolean theIsParallel)
{
myIsParallel = theIsParallel;
}
//! Returns true if parallel flag is set
Standard_Boolean IsParallel()
{
return myIsParallel;
}
//! Returns error status
//! The possible values are:
//! 0 - OK;
@ -74,14 +89,14 @@ protected:
//! Computes the max distance for the 3d curve of <myCOnSurfGeom>
//! and 2d curve <theCurveOnSurface>
//! If isMultiThread == Standard_True then computation will be performed in parallel.
Standard_EXPORT void Compute (const Handle(Adaptor3d_CurveOnSurface)& theCurveOnSurface,
const Standard_Boolean isMultiThread);
Standard_EXPORT void Compute (const Handle(Adaptor3d_CurveOnSurface)& theCurveOnSurface);
private:
GeomLib_CheckCurveOnSurface myCOnSurfGeom;
Handle(Adaptor3d_CurveOnSurface) myAdaptorCurveOnSurface;
Handle(Adaptor3d_CurveOnSurface) myAdaptorCurveOnSurface2;
Standard_Boolean myIsParallel;
};
#endif // _BRepLib_CheckCurveOnSurface_HeaderFile

View File

@ -17,6 +17,7 @@
#include <Adaptor3d_CurveOnSurface.hxx>
#include <BRepCheck.hxx>
#include <Extrema_LocateExtPC.hxx>
#include <GeomLib_CheckCurveOnSurface.hxx>
//=============================================================================
//function : BRepLib_ValidateEdge
@ -32,7 +33,9 @@ BRepLib_ValidateEdge::BRepLib_ValidateEdge(Handle(Adaptor3d_Curve) theReferenceC
myToleranceForChecking(0),
myCalculatedDistance(0),
myExitIfToleranceExceeded(Standard_False),
myIsDone(Standard_False)
myIsDone(Standard_False),
myIsExactMethod(Standard_False),
myIsMultiThread(Standard_False)
{ }
//=============================================================================
@ -96,6 +99,22 @@ void BRepLib_ValidateEdge::SetExitIfToleranceExceeded(Standard_Real theTolerance
//purpose :
//=============================================================================
void BRepLib_ValidateEdge::Process()
{
if (myIsExactMethod && mySameParameter)
{
processExact();
}
else
{
processApprox();
}
}
//=============================================================================
//function : processApprox
//purpose :
//=============================================================================
void BRepLib_ValidateEdge::processApprox()
{
myIsDone = Standard_True;
Standard_Real aSquareToleranceForChecking = myToleranceForChecking * myToleranceForChecking;
@ -212,3 +231,20 @@ void BRepLib_ValidateEdge::Process()
}
myCalculatedDistance = Sqrt(aMaxSquareDistance);
}
//=============================================================================
//function : processExact
//purpose :
//=============================================================================
void BRepLib_ValidateEdge::processExact()
{
GeomLib_CheckCurveOnSurface aCheckCurveOnSurface(myReferenceCurve);
aCheckCurveOnSurface.SetParallel(myIsMultiThread);
aCheckCurveOnSurface.Perform(myOtherCurve);
myIsDone = aCheckCurveOnSurface.IsDone();
if (myIsDone)
{
myCalculatedDistance = aCheckCurveOnSurface.MaxDistance();
}
}

View File

@ -21,8 +21,9 @@
class Adaptor3d_Curve;
class Adaptor3d_CurveOnSurface;
//! Computes the max distance between 3D-curve and curve on
//! surface in fixed points number
//! Computes the max distance between 3D-curve and curve on surface.
//! This class uses 2 methods: approximate using finite
//! number of points (default) and exact
class BRepLib_ValidateEdge
{
public:
@ -31,25 +32,54 @@ public:
const Handle(Adaptor3d_CurveOnSurface) theOtherCurve,
Standard_Boolean theSameParameter);
//! Sets method to calculate distance: Calculating in finite number of points (if theIsExact
//! is false, faster, but possible not correct result) or exact calculating by using
//! BRepLib_CheckCurveOnSurface class (if theIsExact is true, slowly, but more correctly).
//! Exact method is used only when edge is SameParameter.
//! Default method is calculating in finite number of points
void SetExactMethod(Standard_Boolean theIsExact)
{
myIsExactMethod = theIsExact;
}
//! Returns true if exact method selected
Standard_Boolean IsExactMethod()
{
return myIsExactMethod;
}
//! Sets parallel flag
void SetParallel(Standard_Boolean theIsMultiThread)
{
myIsMultiThread = theIsMultiThread;
}
//! Returns true if parallel flag is set
Standard_Boolean IsParallel()
{
return myIsMultiThread;
}
//! Set control points number (if you need a value other than 22)
void SetControlPointsNumber(Standard_Integer theControlPointsNumber)
{
myControlPointsNumber = theControlPointsNumber;
}
//! Sets the maximal allowed distance in the Process() function. If the distance greater than
//! theToleranceForChecking the Process() function stops. Use this for best performance
//! in case of checking of tolerance.
Standard_EXPORT void SetExitIfToleranceExceeded(Standard_Real theToleranceForChecking);
//! Sets limit to compute a distance in the Process() function. If the distance greater than
//! theToleranceForChecking the Process() function stopped. Use this in case checking of
//! tolerance for best performcnce. Has no effect in case using exact method.
void SetExitIfToleranceExceeded(Standard_Real theToleranceForChecking);
//! Computes the max distance for the 3d curve <myReferenceCurve>
//! and curve on surface <myOtherCurve>. If the SetExitIfToleranceExceeded()
//! function was called before <myCalculatedDistance> contains first
//! greater than SetExitIfToleranceExceeded() parameter value
//! greater than SetExitIfToleranceExceeded() parameter value. In case
//! using exact method always computes real max distance.
Standard_EXPORT void Process();
//! Returns true if the distance has been found for all points
Standard_Boolean IsDone()
Standard_Boolean IsDone() const
{
return myIsDone;
}
@ -67,6 +97,12 @@ private:
//! Adds some margin for distance checking
Standard_Real correctTolerance(Standard_Real theTolerance);
//! Calculating in finite number of points
void processApprox();
//! Calculating by using BRepLib_CheckCurveOnSurface class
void processExact();
private:
Handle(Adaptor3d_Curve) myReferenceCurve;
Handle(Adaptor3d_CurveOnSurface) myOtherCurve;
@ -76,6 +112,8 @@ private:
Standard_Real myCalculatedDistance;
Standard_Boolean myExitIfToleranceExceeded;
Standard_Boolean myIsDone;
Standard_Boolean myIsExactMethod;
Standard_Boolean myIsMultiThread;
};
#endif // _BRepLib_ValidateEdge_HeaderFile
#endif // _BRepLib_ValidateEdge_HeaderFile

View File

@ -855,19 +855,20 @@ static Standard_Integer checkshape (Draw_Interpretor& theCommands,
if (narg == 1)
{
theCommands << "\n";
theCommands << "Usage : checkshape [-top] shape [result] [-short] [-parallel]\n";
theCommands << "Usage : checkshape [-top] shape [result] [-short] [-parallel] [-exact]\n";
theCommands << "\n";
theCommands << "Where :\n";
theCommands << " -top - check topology only.\n";
theCommands << " shape - the name of the shape to test.\n";
theCommands << " result - the prefix of the output shape names. If it is used, structural\n";
theCommands << " output style will be used. Otherwise - contextual one.\n";
theCommands << " -short - short description of check.\n";
theCommands << " -top - check topology only.\n";
theCommands << " shape - the name of the shape to test.\n";
theCommands << " result - the prefix of the output shape names. If it is used, structural\n";
theCommands << " output style will be used. Otherwise - contextual one.\n";
theCommands << " -short - short description of check.\n";
theCommands << " -parallel - run check in parallel.\n";
theCommands << " -exact - run check using exact method.\n";
return 0;
}
if (narg > 6)
if (narg > 7)
{
theCommands << "Invalid number of args!!!\n";
theCommands << "No args to have help.\n";
@ -901,6 +902,7 @@ static Standard_Integer checkshape (Draw_Interpretor& theCommands,
Standard_Boolean IsShortDump = Standard_False;
Standard_Boolean IsContextDump = Standard_True;
Standard_Boolean IsParallel = Standard_False;
Standard_Boolean IsExact = Standard_False;
Standard_CString aPref(NULL);
if (aCurInd < narg && strncmp(a[aCurInd], "-", 1))
{
@ -921,6 +923,10 @@ static Standard_Integer checkshape (Draw_Interpretor& theCommands,
{
IsParallel = Standard_True;
}
else if (anArg == "-exact")
{
IsExact = Standard_True;
}
else
{
theCommands << "Syntax error at '" << anArg << "'";
@ -931,7 +937,7 @@ static Standard_Integer checkshape (Draw_Interpretor& theCommands,
try
{
OCC_CATCH_SIGNALS
BRepCheck_Analyzer anAna (aShape, aGeomCtrl, IsParallel);
BRepCheck_Analyzer anAna (aShape, aGeomCtrl, IsParallel, IsExact);
Standard_Boolean isValid = anAna.IsValid();
if (isValid)

View File

@ -319,7 +319,8 @@ GeomLib_CheckCurveOnSurface::GeomLib_CheckCurveOnSurface()
myErrorStatus(0),
myMaxDistance(RealLast()),
myMaxParameter(0.),
myTolRange(Precision::PConfusion())
myTolRange(Precision::PConfusion()),
myIsParallel(Standard_False)
{
}
@ -334,7 +335,8 @@ GeomLib_CheckCurveOnSurface::
myErrorStatus(0),
myMaxDistance(RealLast()),
myMaxParameter(0.),
myTolRange(theTolRange)
myTolRange(theTolRange),
myIsParallel(Standard_False)
{
}
@ -369,8 +371,7 @@ void GeomLib_CheckCurveOnSurface::Init( const Handle(Adaptor3d_Curve)& theCurve,
//function : Perform
//purpose :
//=======================================================================
void GeomLib_CheckCurveOnSurface::Perform(const Handle(Adaptor3d_CurveOnSurface)& theCurveOnSurface,
const Standard_Boolean isMultiThread)
void GeomLib_CheckCurveOnSurface::Perform(const Handle(Adaptor3d_CurveOnSurface)& theCurveOnSurface)
{
if( myCurve.IsNull() ||
theCurveOnSurface.IsNull())
@ -415,7 +416,7 @@ void GeomLib_CheckCurveOnSurface::Perform(const Handle(Adaptor3d_CurveOnSurface)
FillSubIntervals(myCurve, theCurveOnSurface->GetCurve(),
myCurve->FirstParameter(), myCurve->LastParameter(), aNbParticles, &anIntervals);
const Standard_Integer aNbThreads = isMultiThread ? Min(anIntervals.Size(), OSD_ThreadPool::DefaultPool()->NbDefaultThreadsToLaunch()) : 1;
const Standard_Integer aNbThreads = myIsParallel ? Min(anIntervals.Size(), OSD_ThreadPool::DefaultPool()->NbDefaultThreadsToLaunch()) : 1;
Array1OfHCurve aCurveArray(0, aNbThreads - 1);
Array1OfHCurve aCurveOnSurfaceArray(0, aNbThreads - 1);
for (Standard_Integer anI = 0; anI < aNbThreads; ++anI)

View File

@ -48,8 +48,19 @@ public:
//! Computes the max distance for the 3d curve <myCurve>
//! and 2d curve <theCurveOnSurface>
//! If isMultiThread == Standard_True then computation will be performed in parallel.
Standard_EXPORT void Perform(const Handle(Adaptor3d_CurveOnSurface)& theCurveOnSurface,
const Standard_Boolean isMultiThread = Standard_False);
Standard_EXPORT void Perform(const Handle(Adaptor3d_CurveOnSurface)& theCurveOnSurface);
//! Sets parallel flag
void SetParallel(const Standard_Boolean theIsParallel)
{
myIsParallel = theIsParallel;
}
//! Returns true if parallel flag is set
Standard_Boolean IsParallel()
{
return myIsParallel;
}
//! Returns true if the max distance has been found
Standard_Boolean IsDone() const
@ -87,6 +98,7 @@ private:
Standard_Real myMaxDistance;
Standard_Real myMaxParameter;
Standard_Real myTolRange;
Standard_Boolean myIsParallel;
};
#endif // _BRepLib_CheckCurveOnSurface_HeaderFile

View File

@ -807,7 +807,8 @@ Standard_Boolean IntTools_Tools::ComputeTolerance
new Adaptor3d_CurveOnSurface(aGeom2dAdaptorCurve, aGeomAdaptorSurface);
aCS.Init(aGeomAdaptorCurve, theTolRange);
aCS.Perform(anAdaptor3dCurveOnSurface, theToRunParallel);
aCS.SetParallel(theToRunParallel);
aCS.Perform(anAdaptor3dCurveOnSurface);
if (!aCS.IsDone()) {
return Standard_False;
}

View File

@ -1,7 +1,7 @@
pload TOPTEST
# To prevent loops limit to 5 minutes
cpulimit 300
# Execution time limit to prevent loops
cpulimit 1000
if { [info exists imagedir] == 0 } {
set imagedir .

View File

@ -1,7 +1,7 @@
puts "REQUIRED All: Faulty shapes in variables faulty_1 to faulty_51"
puts "REQUIRED All: Faulty shapes in variables faulty_1 to faulty_31"
puts "=========="
puts "0027814: Parallelize BRepCheck_Analyzer"
puts "=========="
puts ""
CheckPerform [locate_data_file OCC394.brep]
CheckPerform [locate_data_file OCC396.brep]

View File

@ -1,7 +1,7 @@
puts "REQUIRED All: Faulty shapes in variables faulty_1 to faulty_31"
puts "REQUIRED All: Faulty shapes in variables faulty_1 to faulty_287"
puts "=========="
puts "0027814: Parallelize BRepCheck_Analyzer"
puts "=========="
puts ""
CheckPerform [locate_data_file OCC396.brep]
CheckPerform [locate_data_file OCC54.brep]

View File

@ -0,0 +1,8 @@
puts "REQUIRED All: Faulty shapes in variables faulty_1 to faulty_88"
puts "=========="
puts "0032448: Provide exact validating (as option) using GeomLib_CheckCurveOnSurface"
puts "=========="
puts ""
restore [locate_data_file bug27814.brep] b
checkshape b -exact -parallel

View File

@ -0,0 +1,8 @@
puts "REQUIRED All: Faulty shapes in variables faulty_1 to faulty_6101"
puts "=========="
puts "0032448: Provide exact validating (as option) using GeomLib_CheckCurveOnSurface"
puts "=========="
puts ""
restore [locate_data_file OCC54.brep] b
checkshape b -exact -parallel

View File

@ -0,0 +1,7 @@
puts "=========="
puts "0032448: Provide exact validating (as option) using GeomLib_CheckCurveOnSurface"
puts "=========="
puts ""
restore [locate_data_file 5000-12.brep] b
checkshape b -exact -parallel

View File

@ -0,0 +1,8 @@
puts "REQUIRED All: Faulty shapes in variables faulty_1 to faulty_3675"
puts "=========="
puts "0032448: Provide exact validating (as option) using GeomLib_CheckCurveOnSurface"
puts "=========="
puts ""
restore [locate_data_file BPLSEITLI.brep] b
checkshape b -exact -parallel

View File

@ -0,0 +1,7 @@
puts "=========="
puts "0032448: Provide exact validating (as option) using GeomLib_CheckCurveOnSurface"
puts "=========="
puts ""
restore [locate_data_file bug24525_License.brep] b
checkshape b -exact -parallel

View File

@ -0,0 +1,8 @@
puts "REQUIRED All: Faulty shapes in variables faulty_1 to faulty_8234"
puts "=========="
puts "0032448: Provide exact validating (as option) using GeomLib_CheckCurveOnSurface"
puts "=========="
puts ""
restore [locate_data_file bug26278_E01754_000000_P00_01_0_VS3_1_20070102_sewed_fixed.brep] b
checkshape b -exact -parallel

View File

@ -0,0 +1,8 @@
puts "REQUIRED All: Faulty shapes in variables faulty_1 to faulty_7656"
puts "=========="
puts "0032448: Provide exact validating (as option) using GeomLib_CheckCurveOnSurface"
puts "=========="
puts ""
restore [locate_data_file bug30360_GES-13500-000.brep] b
checkshape b -exact -parallel

View File

@ -0,0 +1,8 @@
puts "REQUIRED All: Faulty shapes in variables faulty_1 to faulty_1943"
puts "=========="
puts "0032448: Provide exact validating (as option) using GeomLib_CheckCurveOnSurface"
puts "=========="
puts ""
restore [locate_data_file OCC187_from_bug_description.brep] b
checkshape b -exact -parallel

View File

@ -0,0 +1,8 @@
puts "REQUIRED All: Faulty shapes in variables faulty_1 to faulty_502"
puts "=========="
puts "0032448: Provide exact validating (as option) using GeomLib_CheckCurveOnSurface"
puts "=========="
puts ""
restore [locate_data_file OCC394.brep] b
checkshape b -exact -parallel

View File

@ -0,0 +1,8 @@
puts "REQUIRED All: Faulty shapes in variables faulty_1 to faulty_467"
puts "=========="
puts "0032448: Provide exact validating (as option) using GeomLib_CheckCurveOnSurface"
puts "=========="
puts ""
restore [locate_data_file OCC396.brep] b
checkshape b -exact -parallel