mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-08 14:17:06 +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:
@@ -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)
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user