1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0022550: Fixing data races

This commit is contained in:
KGV
2012-01-27 14:12:59 +00:00
committed by bugmaster
parent 46921bd5c8
commit 41194117bf
62 changed files with 1170 additions and 1274 deletions

View File

@@ -188,30 +188,31 @@ is
-- curve to project and surface
returns Real
raises NoSuchObject;
-- Methods for debugging
GetSequence(me) returns HSequenceOfHSequenceOfPnt from ProjLib
---C++: return const &
is static;
GetType(me) returns CurveType from GeomAbs
---Purpose: Returns the type of the curve in the current
-- interval : Line, Circle, Ellipse, Hyperbola,
-- Parabola, BezierCurve, BSplineCurve, OtherCurve.
is redefined static;
fields
mySurface : HSurface from Adaptor3d;
myCurve : HCurve from Adaptor3d;
myNbCurves : Integer from Standard;
mySequence : HSequenceOfHSequenceOfPnt from ProjLib;
mySurface : HSurface from Adaptor3d;
myCurve : HCurve from Adaptor3d;
myNbCurves : Integer from Standard;
mySequence : HSequenceOfHSequenceOfPnt from ProjLib;
myTolU : Real from Standard;
myTolV : Real from Standard;
myMaxDist : Real from Standard;
myTolV : Real from Standard;
myMaxDist : Real from Standard;
myUIso : HArray1OfBoolean from TColStd;
myVIso : HArray1OfBoolean from TColStd;
mySnglPnts : HArray1OfBoolean from TColStd;
myMaxDistance : HArray1OfReal from TColStd;
mySnglPnts : HArray1OfBoolean from TColStd;
myMaxDistance : HArray1OfReal from TColStd;
myTabInt : HArray1OfReal from TColStd; -- this field should be mutable
end CompProjectedCurve;

View File

@@ -19,10 +19,9 @@
#include <GeomAbs_CurveType.hxx>
#include <GeomLib.hxx>
#define FuncTol 1.e-10
#if DEB
#ifdef __OCC_DEBUG_CHRONO
#include <OSD_Timer.hxx>
static OSD_Chronometer chr_init_point, chr_dicho_bound;
@@ -45,7 +44,6 @@ static void ResultChron( OSD_Chronometer & ch, Standard_Real & time)
}
#endif
static Handle(TColStd_HArray1OfReal) TabInt;
//=======================================================================
//function : d1
@@ -159,7 +157,7 @@ static void d1(const Standard_Real t,
//purpose : computes first derivative of the 3d projected curve
//=======================================================================
#ifdef DEB
#if 0
static void d1CurvOnSurf(const Standard_Real t,
const Standard_Real u,
const Standard_Real v,
@@ -398,7 +396,7 @@ static void DichExactBound(gp_Pnt& Sol,
const Handle(Adaptor3d_HCurve)& Curve,
const Handle(Adaptor3d_HSurface)& Surface)
{
#ifdef DEB
#ifdef __OCC_DEBUG_CHRONO
InitChron(chr_dicho_bound);
#endif
@@ -426,7 +424,7 @@ static void DichExactBound(gp_Pnt& Sol,
}
else aNotSol = t;
}
#ifdef DEB
#ifdef __OCC_DEBUG_CHRONO
ResultChron(chr_dicho_bound,t_dicho_bound);
dicho_bound_count++;
#endif
@@ -533,7 +531,7 @@ static Standard_Boolean InitialPoint(const gp_Pnt& Point,
void ProjLib_CompProjectedCurve::Init()
{
TabInt.Nullify();
myTabInt.Nullify();
Standard_Real Tol;// Tolerance for ExactBound
Standard_Integer i, Nend = 0;
@@ -632,11 +630,11 @@ static Standard_Boolean InitialPoint(const gp_Pnt& Point,
if (!initpoint)
{
myCurve->D0(t,CPoint);
#ifdef DEB
#ifdef __OCC_DEBUG_CHRONO
InitChron(chr_init_point);
#endif
initpoint=InitialPoint(CPoint, t,myCurve,mySurface, myTolU, myTolV, U, V);
#ifdef DEB
#ifdef __OCC_DEBUG_CHRONO
ResultChron(chr_init_point,t_init_point);
init_point_count++;
#endif
@@ -1278,15 +1276,9 @@ gp_Vec2d ProjLib_CompProjectedCurve::DN(const Standard_Real t,
Standard_Integer ProjLib_CompProjectedCurve::NbIntervals(const GeomAbs_Shape S) const
{
TabInt.Nullify();
const_cast<ProjLib_CompProjectedCurve*>(this)->myTabInt.Nullify();
BuildIntervals(S);
Standard_Integer NbInt;
NbInt=TabInt->Length() - 1;
#ifdef DEB
// cout<<"NbIntervals = "<<NbInt<<endl;
#endif
return NbInt;
return myTabInt->Length() - 1;
}
//=======================================================================
@@ -1296,16 +1288,8 @@ gp_Vec2d ProjLib_CompProjectedCurve::DN(const Standard_Real t,
void ProjLib_CompProjectedCurve::Intervals(TColStd_Array1OfReal& T,const GeomAbs_Shape S) const
{
if(TabInt.IsNull()) BuildIntervals(S);
T = TabInt->Array1();
#if DEB
/* cout<<"Intervals = ";
for(Standard_Integer i = 1; i <= T.Length(); i++)
cout<<T(i)<<" ";
cout<<endl;
*/
#endif
if (myTabInt.IsNull()) BuildIntervals (S);
T = myTabInt->Array1();
}
//=======================================================================
@@ -1315,11 +1299,7 @@ gp_Vec2d ProjLib_CompProjectedCurve::DN(const Standard_Real t,
void ProjLib_CompProjectedCurve::BuildIntervals(const GeomAbs_Shape S) const
{
#ifndef DEB
GeomAbs_Shape SforS = GeomAbs_CN;
#else
GeomAbs_Shape SforS;
#endif
switch(S) {
case GeomAbs_C0:
SforS = GeomAbs_C1;
@@ -1512,9 +1492,9 @@ gp_Vec2d ProjLib_CompProjectedCurve::DN(const Standard_Real t,
BArr->ChangeValue(i) = Fusion(i);
}
TabInt = new TColStd_HArray1OfReal(1, BArr->Length());
const_cast<ProjLib_CompProjectedCurve*>(this)->myTabInt = new TColStd_HArray1OfReal(1, BArr->Length());
for(i = 1; i <= BArr->Length(); i++)
TabInt->ChangeValue(i) = BArr->Value(i);
myTabInt->ChangeValue(i) = BArr->Value(i);
}
@@ -1544,24 +1524,3 @@ GeomAbs_CurveType ProjLib_CompProjectedCurve::GetType() const
{
return GeomAbs_OtherCurve;
}