char dizmois = val->Value(6);
char dizjour = val->Value(9);
char dizheur = val->Value(12);
- for (Standard_Integer i = 1; i <= 19; i ++) {
+ for (Standard_Integer i = 1; i <= 19; i ++)
+ {
char uncar = val->Value(i);
switch (i) {
- case 1 : if (uncar != '1' && uncar != '2') return Standard_False; break;
+ case 1 : if (uncar != '1' && uncar != '2') return Standard_False;
+ break;
case 2 :
case 3 :
- case 4 : if (uncar < '0' || uncar > '9') return Standard_False; break;
+ case 4 : if (uncar < '0' || uncar > '9') return Standard_False;
+ break;
case 5 : if (uncar != '-') return Standard_False;
- case 6 : if (uncar != '0' && uncar != '1') return Standard_False; break;
- case 7 : if (uncar < '0' || uncar > '9') return Standard_False;
- if (dizmois == '1' && (uncar < '0' || uncar > '2')) return Standard_False; break;
+ case 6 : if (uncar != '0' && uncar != '1') return Standard_False;
+ break;
+ case 7 : if (uncar < '0' || uncar > '9') return Standard_False;
+ if (dizmois == '1' && (uncar < '0' || uncar > '2')) return Standard_False;
+ break;
case 8 : if (uncar != '-') return Standard_False;
- case 9 : if (uncar < '0' || uncar > '3') return Standard_False; break;
+ case 9 : if (uncar < '0' || uncar > '3') return Standard_False;
+ break;
case 10 : if (uncar < '0' || uncar > '9') return Standard_False;
- if (dizjour == '3' && (uncar != '0' && uncar != '1')) return Standard_False; break;
+ if (dizjour == '3' && (uncar != '0' && uncar != '1')) return Standard_False;
+ break;
case 11 : if (uncar != 'T') return Standard_False;
- case 12 : if (uncar < '0' || uncar > '2') return Standard_False; break;
+ case 12 : if (uncar < '0' || uncar > '2') return Standard_False;
+ break;
case 13 : if (uncar < '0' || uncar > '9') return Standard_False;
- if (dizheur == '2' && (uncar < '0' || uncar > '3')) return Standard_False; break;
+ if (dizheur == '2' && (uncar < '0' || uncar > '3')) return Standard_False;
+ break;
case 14 : if (uncar != ':') return Standard_False;
- case 15 : if (uncar < '0' || uncar > '5') return Standard_False; break;
- case 16 : if (uncar < '0' || uncar > '9') return Standard_False; break;
+ case 15 : if (uncar < '0' || uncar > '5') return Standard_False;
+ break;
+ case 16 : if (uncar < '0' || uncar > '9') return Standard_False;
+ break;
case 17 : if (uncar != ':') return Standard_False;
- case 18 : if (uncar < '0' || uncar > '5') return Standard_False; break;
- case 19 : if (uncar < '0' || uncar > '9') return Standard_False; break;
- default : break;
+ case 18 : if (uncar < '0' || uncar > '5') return Standard_False;
+ break;
+ case 19 : if (uncar < '0' || uncar > '9') return Standard_False;
+ break;
+ default :
+ break;
}
}
return Standard_True;
//=======================================================================
//function : Load
-//purpose :
+//purpose :
//=======================================================================
-void Adaptor3d_CurveOnSurface::Load(const Handle(Adaptor2d_HCurve2d)& C)
+void Adaptor3d_CurveOnSurface::Load(const Handle(Adaptor2d_HCurve2d)& C)
{
myCurve = C;
- if (!mySurface.IsNull())
- {
- EvalKPart();
- GeomAbs_SurfaceType SType ;
- SType = mySurface->GetType();
- if( SType == GeomAbs_BSplineSurface)
- EvalFirstLastSurf();
- if( SType == GeomAbs_SurfaceOfExtrusion)
- EvalFirstLastSurf();
- if( SType == GeomAbs_SurfaceOfRevolution)
- EvalFirstLastSurf();
- if( SType == GeomAbs_OffsetSurface) {
- SType = mySurface->BasisSurface()->GetType();
- if( SType == GeomAbs_SurfaceOfRevolution ||
- SType == GeomAbs_SurfaceOfExtrusion ||
- SType == GeomAbs_BSplineSurface )
- EvalFirstLastSurf();
- }
- }
+ if (mySurface.IsNull())
+ {
+ return;
+ }
+
+ EvalKPart();
+
+ GeomAbs_SurfaceType SType = mySurface->GetType();
+ if (SType == GeomAbs_OffsetSurface)
+ {
+ SType = mySurface->BasisSurface()->GetType();
+ }
+
+ if (SType == GeomAbs_BSplineSurface ||
+ SType == GeomAbs_SurfaceOfExtrusion ||
+ SType == GeomAbs_SurfaceOfRevolution)
+ {
+ EvalFirstLastSurf();
+ }
}
//=======================================================================
for(i = 1; i <= NbPointTot; i++){
F.Section(Lin->Point(i),tabAppP,tabAppV,tabP2d,tabV2d,tabW,tabDW);
Standard_Real x,y,z;
- for(j = 1; j <= NbUPoles; j++){
+ for (j = 1; j <= NbUPoles; j++)
+ {
tabAppP(j).Coord(x,y,z);
- if(x < X) X = x; if(x > DX) DX = x;
- if(y < Y) Y = y; if(y > DY) DY = y;
- if(z < Z) Z = z; if(z > DZ) DZ = z;
+ if(x < X) { X = x; }
+ if(x > DX) { DX = x; }
+ if(y < Y) { Y = y; }
+ if(y > DY) { DY = y; }
+ if(z < Z) { Z = z; }
+ if(z > DZ) { DZ = z; }
}
- for(j = 1; j <= NbPoles2d; j++){
+ for (j = 1; j <= NbPoles2d; j++)
+ {
tabP2d(j).Coord(x,y);
- if(x < X2d(j)) X2d(j) = x; if(x > DX2d(j)) DX2d(j) = x;
- if(y < Y2d(j)) Y2d(j) = y; if(y > DY2d(j)) DY2d(j) = y;
+ if(x < X2d (j)) { X2d (j) = x; }
+ if(x > DX2d(j)) { DX2d(j) = x; }
+ if(y < Y2d (j)) { Y2d (j) = y; }
+ if(y > DY2d(j)) { DY2d(j) = y; }
}
}
// On calcule pour chaque ligne la transformation vers 0 1.
while (isNaturalRestriction || theDomain.More())
{
if (isNaturalRestriction)
- {
+ {
NbLGaussP[0] = Min(2 * NbUGaussP[0], math::GaussPointsMax());
}
else
LMaxSubs = BRepGProp_Gauss::MaxSubs(iLSubEnd);
if (LMaxSubs > SM)
+ {
LMaxSubs = SM;
+ }
BRepGProp_Gauss::InitMass(0.0, 1, LMaxSubs, anInertiaL);
BRepGProp_Gauss::Init(ErrL, 0.0, 1, LMaxSubs);
L2->Value(IL) = L1->Value(JL);
}
else
+ {
LRange[0] = IL = JL;
+ }
if (JL == LMaxSubs || Abs(L2->Value(JL) - L1->Value(JL)) < EPS_PARAM)
{
}
}
else
+ {
for (kL = 0; kL < kLEnd; kL++)
{
iLS = LRange[kL];
{
l = lm + lr * LGaussP[iGL]->Value(iL);
if (isNaturalRestriction)
- {
+ {
v = l;
u2 = BU2;
Dul = LGaussW[iGL]->Value(iL);
if (u2 < BU1)
u2 = BU1;
else if (u2 > BU2)
- u2 = BU2;
+ u2 = BU2;
}
ErrUL->Value(iLS) = 0.0;
CIxz = add(CIxz, mult(anIU.Ixz, Dul));
CIyz = add(CIyz, mult(anIU.Iyz, Dul));
}
- }//for: iL
+ }//for: iL
}//for: iGL
BRepGProp_Gauss::Inertia& aLI = anInertiaL->ChangeValue(iLS);
aLI.Ixz = mult(CIxz, lr);
aLI.Iyz = mult(CIyz, lr);
}//for: (kL)iLS
+ }
- // Calculate/correct epsilon of computation by current value of dim
- // That is need for not spend time for
- if (JL == iLSubEnd)
- {
- kLEnd = 2;
+ // Calculate/correct epsilon of computation by current value of dim
+ // That is need for not spend time for
+ if (JL == iLSubEnd)
+ {
+ kLEnd = 2;
- Standard_Real DDim = 0.0;
- for (i = 1; i <= JL; ++i)
- DDim += anInertiaL->Value(i).Mass;
+ Standard_Real DDim = 0.0;
+ for (i = 1; i <= JL; ++i)
+ DDim += anInertiaL->Value(i).Mass;
- #ifndef IS_MIN_DIM
+ #ifndef IS_MIN_DIM
+ {
+ if (myType == Vinert)
{
- if (myType == Vinert)
+ Standard_Real DIxx = 0.0, DIyy = 0.0, DIzz = 0.0;
+ for (i = 1; i <= JL; ++i)
{
- Standard_Real DIxx = 0.0, DIyy = 0.0, DIzz = 0.0;
- for (i = 1; i <= JL; ++i)
- {
- const BRepGProp_Gauss::Inertia& aLocalL =
- anInertiaL->Value(i);
+ const BRepGProp_Gauss::Inertia& aLocalL =
+ anInertiaL->Value(i);
- DIxx += aLocalL.Ixx;
- DIyy += aLocalL.Iyy;
- DIzz += aLocalL.Izz;
- }
-
- DDim = Abs(DIxx) + Abs(DIyy) + Abs(DIzz);
+ DIxx += aLocalL.Ixx;
+ DIyy += aLocalL.Iyy;
+ DIzz += aLocalL.Izz;
}
- }
- #endif
- DDim = Abs(DDim * anEpsilon);
-
- if (DDim > Eps)
- {
- Eps = DDim;
- EpsL = 0.9 * Eps;
+ DDim = Abs(DIxx) + Abs(DIyy) + Abs(DIzz);
}
}
- if (kLEnd == 2)
+ #endif
+
+ DDim = Abs(DDim * anEpsilon);
+
+ if (DDim > Eps)
{
- ErrorL = ErrL->Value(ErrL->Max());
+ Eps = DDim;
+ EpsL = 0.9 * Eps;
}
+ }
+ if (kLEnd == 2)
+ {
+ ErrorL = ErrL->Value(ErrL->Max());
+ }
} while ( (ErrorL - EpsL > 0.0 && isVerifyComputation) || kLEnd == 1 );
for ( i = 1; i <= JL; i++ )
+ {
addAndRestoreInertia(anInertiaL->Value(i), anInertia);
+ }
ErrorLMax = Max(ErrorLMax, ErrorL);
}
Standard_Real first = c3d->FirstParameter();
Standard_Real last = c3d->LastParameter();
Standard_Real dapp = -1.;
- Standard_Integer i = 0;
- for(i = 0; i <= nbp; i++){
+ for (Standard_Integer i = 0; i <= nbp; ++i)
+ {
const Standard_Real t = IntToReal(i)/IntToReal(nbp);
const Standard_Real u = first*(1.-t) + last*t;
gp_Pnt Pc3d = c3d->Value(u);
Precision::IsInfinite(Pcons.Y()) ||
Precision::IsInfinite(Pcons.Z()))
{
- d2=Precision::Infinite();
- break;
+ d2 = Precision::Infinite();
+ break;
}
Standard_Real temp = Pc3d.SquareDistance(Pcons);
-
dist(i+1) = temp;
-
- if(temp > d2) d2 = temp;
+ d2 = Max (d2, temp);
}
if(Precision::IsInfinite(d2))
Standard_Integer N2 = 0;
Standard_Integer N3 = 0;
- for( i = 1; i<= nbp+10; i++)
- if( dist(i) > 0 ) {
- if( dist(i) < 1.0 ) N1++;
- else N2++;
+ for (Standard_Integer i = 1; i<= nbp+10; ++i)
+ {
+ if (dist(i) > 0)
+ {
+ if (dist(i) < 1.0)
+ {
+ ++N1;
+ }
+ else
+ {
+ ++N2;
+ }
}
+ }
- if( N1 > N2 && N2 != 0 ) N3 = 100*N2/(N1+N2);
- if( N3 < 10 && N3 != 0 ) {
- ana = Standard_True;
- for( i = 1; i<= nbp+10; i++)
- if( dist(i) > 0 && dist(i) < 1.0 )
- if( dist(i) > D2 ) D2 = dist(i);
+ if (N1 > N2 && N2 != 0)
+ {
+ N3 = 100*N2/(N1+N2);
+ }
+ if (N3 < 10 && N3 != 0)
+ {
+ ana = Standard_True;
+ for (Standard_Integer i = 1; i <= nbp+10; ++i)
+ {
+ if (dist(i) > 0 && dist(i) < 1.0)
+ {
+ D2 = Max (D2, dist(i));
+ }
}
+ }
- //d2 = 1.5*sqrt(d2);
- d2 = (!ana) ? 1.5 * d2 : 1.5*sqrt(D2);
- if(d2<1.e-7) d2 = 1.e-7;
-
- return d2;
+ //d2 = 1.5*sqrt(d2);
+ d2 = (!ana) ? 1.5 * d2 : 1.5*sqrt(D2);
+ d2 = Max (d2, 1.e-7);
+ return d2;
}
void BRepLib::SameParameter(const TopoDS_Edge& AnEdge,
//=======================================================================
//function : CorrectWires
-//purpose :
+//purpose :
//=======================================================================
void BRepOffsetAPI_DraftAngle::CorrectWires()
//Sorting
for (i = 1; i <= NonSeam.Length(); i++)
+ {
for (j = 1; j < ParsNonSeam(i).Length(); j++)
+ {
for (k = j+1; k <= ParsNonSeam(i).Length(); k++)
+ {
if (ParsNonSeam(i)(k) < ParsNonSeam(i)(j))
{
Standard_Real temp = ParsNonSeam(i)(j);
ParsSeam(i)(j) = ParsSeam(i)(k);
ParsSeam(i)(k) = temp;
}
- BRepFill_DataMapIteratorOfDataMapOfShapeSequenceOfReal iter( Emap );
- for (; iter.More(); iter.Next())
+ }
+ }
+ }
+ BRepFill_DataMapIteratorOfDataMapOfShapeSequenceOfReal iter (Emap);
+ for (; iter.More (); iter.Next ())
+ {
+ TColStd_SequenceOfReal Seq = iter.Value ();
+ for (i = 1; i < Seq.Length (); i++)
+ {
+ for (j = i + 1; j <= Seq.Length (); j++)
+ {
+ if (Seq (j) < Seq (i))
{
- TColStd_SequenceOfReal Seq;
- Seq = iter.Value();
- for (i = 1; i < Seq.Length(); i++)
- for (j = i+1; j <= Seq.Length(); j++)
- if (Seq(j) < Seq(i))
- {
- Standard_Real temp = Seq(i);
- Seq(i) = Seq(j);
- Seq(j) = temp;
- }
- Emap( iter.Key() ) = Seq;
+ Standard_Real temp = Seq (i);
+ Seq (i) = Seq (j);
+ Seq (j) = temp;
}
- BRepFill_DataMapOfShapeSequenceOfReal EPmap;
- TopTools_DataMapOfShapeSequenceOfShape EVmap; //Seam
- TopTools_DataMapOfShapeSequenceOfShape EWmap; //Seam and wires intersecting it
- iter.Initialize( Emap );
- for (; iter.More(); iter.Next())
+ }
+ }
+ Emap (iter.Key ()) = Seq;
+ }
+ BRepFill_DataMapOfShapeSequenceOfReal EPmap;
+ TopTools_DataMapOfShapeSequenceOfShape EVmap; //Seam
+ TopTools_DataMapOfShapeSequenceOfShape EWmap; //Seam and wires intersecting it
+ iter.Initialize (Emap);
+ for (; iter.More (); iter.Next ())
+ {
+ TColStd_SequenceOfReal parseq;
+ EPmap.Bind (iter.Key (), parseq);
+ TopTools_SequenceOfShape shapeseq;
+ EVmap.Bind (iter.Key (), shapeseq);
+ TopTools_SequenceOfShape shapeseq2;
+ EWmap.Bind (iter.Key (), shapeseq2);
+ }
+
+ //Reconstruction of non-seam edges
+ BRepTools_Substitution aSub;
+ BRep_Builder BB;
+ for (i = 1; i <= NonSeam.Length (); i++)
+ {
+ TopoDS_Edge anEdge = TopoDS::Edge (NonSeam (i));
+ TopTools_ListOfShape NewEdges;
+ TopoDS_Edge NewE;
+ TopoDS_Vertex Vfirst, Vlast;
+ TopExp::Vertices (anEdge, Vfirst, Vlast);
+ Standard_Real par, FirstPar, LastPar;
+ BRep_Tool::Range (anEdge, FirstPar, LastPar);
+ Standard_Integer firstind = 1;
+ par = ParsNonSeam (i)(1);
+ TopoDS_Edge SeamEdge = TopoDS::Edge (Seam (i)(1));
+ //Find the face
+ for (j = 1; j <= Eseq.Length (); j++)
+ if (SeamEdge.IsSame (Eseq (j)))
+ break;
+ TopoDS_Face theFace = TopoDS::Face (Fseq (j));
+ TopLoc_Location L;
+ Handle (Geom_Surface) theSurf = BRep_Tool::Surface (theFace, L);
+ if (Abs (par - FirstPar) <= Precision::Confusion ())
+ {
+ BB.UpdateVertex (Vfirst, ParsSeam (i)(1), SeamEdge, BRep_Tool::Tolerance (Vfirst));
+ EPmap (SeamEdge).Append (ParsSeam (i)(1));
+ EVmap (SeamEdge).Append (Vfirst);
+ EWmap (SeamEdge).Append (NonSeamWires (i));
+ firstind = 2;
+ }
+ Standard_Real prevpar = FirstPar;
+ TopoDS_Vertex PrevV = Vfirst;
+ for (j = firstind; j <= ParsNonSeam (i).Length (); j++)
+ {
+ TopoDS_Shape aLocalShape = anEdge.EmptyCopied ();
+ NewE = TopoDS::Edge (aLocalShape);
+ //NewE = TopoDS::Edge( anEdge.EmptyCopied() );
+ TopoDS_Vertex NewV;
+ par = ParsNonSeam (i)(j);
+ BB.Range (NewE, prevpar, par);
+ SeamEdge = TopoDS::Edge (Seam (i)(j));
+ if (j == ParsNonSeam (i).Length () && Abs (par - LastPar) <= Precision::Confusion ())
+ {
+ NewV = Vlast;
+ if (firstind == 2 && j == 2)
{
- TColStd_SequenceOfReal parseq;
- EPmap.Bind( iter.Key(), parseq );
- TopTools_SequenceOfShape shapeseq;
- EVmap.Bind( iter.Key(), shapeseq );
- TopTools_SequenceOfShape shapeseq2;
- EWmap.Bind( iter.Key(), shapeseq2 );
+ BB.UpdateVertex (Vlast, ParsSeam (i)(j), SeamEdge, BRep_Tool::Tolerance (Vlast));
+ EPmap (SeamEdge).Append (ParsSeam (i)(j));
+ EVmap (SeamEdge).Append (Vlast);
+ EWmap (SeamEdge).Append (NonSeamWires (i));
+ break;
}
+ }
+ else
+ {
+ BRepAdaptor_Curve bcur (NewE);
+ gp_Pnt Point = bcur.Value (par);
+ NewV = BRepLib_MakeVertex (Point);
+ BB.UpdateVertex (NewV, par, NewE, 10.*Precision::Confusion ());
+ }
+ BB.UpdateVertex (NewV, ParsSeam (i)(j), SeamEdge, 10.*Precision::Confusion ());
+ NewE.Orientation (TopAbs_FORWARD);
+ BB.Add (NewE, PrevV.Oriented (TopAbs_FORWARD));
+ BB.Add (NewE, NewV.Oriented (TopAbs_REVERSED));
+
+ NewEdges.Append (NewE);
+ EPmap (SeamEdge).Append (ParsSeam (i)(j));
+ EVmap (SeamEdge).Append (NewV);
+ EWmap (SeamEdge).Append (NonSeamWires (i));
+
+ prevpar = par;
+ PrevV = NewV;
+ }
+ //The last edge
+ TopoDS_Shape aLocalShape = anEdge.EmptyCopied ();
+ NewE = TopoDS::Edge (aLocalShape);
+ //NewE = TopoDS::Edge( anEdge.EmptyCopied() );
+ par = LastPar;
+ if (Abs (prevpar - par) > Precision::Confusion ())
+ {
+ BB.Range (NewE, prevpar, par);
+ NewE.Orientation (TopAbs_FORWARD);
+ BB.Add (NewE, PrevV.Oriented (TopAbs_FORWARD));
+ BB.Add (NewE, Vlast.Oriented (TopAbs_REVERSED));
+ NewEdges.Append (NewE);
+ }
- //Reconstruction of non-seam edges
- BRepTools_Substitution aSub;
- BRep_Builder BB;
- for (i = 1; i <= NonSeam.Length(); i++)
- {
- TopoDS_Edge anEdge = TopoDS::Edge( NonSeam(i) );
- TopTools_ListOfShape NewEdges;
- TopoDS_Edge NewE;
- TopoDS_Vertex Vfirst, Vlast;
- TopExp::Vertices( anEdge, Vfirst, Vlast );
- Standard_Real par, FirstPar, LastPar;
- BRep_Tool::Range( anEdge, FirstPar, LastPar );
- Standard_Integer firstind = 1;
- par = ParsNonSeam(i)(1);
- TopoDS_Edge SeamEdge = TopoDS::Edge( Seam(i)(1) );
- //Find the face
- for (j = 1; j <= Eseq.Length(); j++)
- if (SeamEdge.IsSame( Eseq(j) ))
- break;
- TopoDS_Face theFace = TopoDS::Face( Fseq(j) );
- TopLoc_Location L;
- Handle( Geom_Surface ) theSurf = BRep_Tool::Surface( theFace, L );
- if (Abs(par-FirstPar) <= Precision::Confusion())
- {
- BB.UpdateVertex( Vfirst, ParsSeam(i)(1), SeamEdge, BRep_Tool::Tolerance(Vfirst) );
- EPmap( SeamEdge ).Append( ParsSeam(i)(1) );
- EVmap( SeamEdge ).Append( Vfirst );
- EWmap( SeamEdge ).Append( NonSeamWires(i) );
- firstind = 2;
- }
- Standard_Real prevpar = FirstPar;
- TopoDS_Vertex PrevV = Vfirst;
- for (j = firstind; j <= ParsNonSeam(i).Length(); j++)
- {
- TopoDS_Shape aLocalShape = anEdge.EmptyCopied();
- NewE = TopoDS::Edge( aLocalShape );
- //NewE = TopoDS::Edge( anEdge.EmptyCopied() );
- TopoDS_Vertex NewV;
- par = ParsNonSeam(i)(j);
- BB.Range( NewE, prevpar, par );
- SeamEdge = TopoDS::Edge( Seam(i)(j) );
- if (j == ParsNonSeam(i).Length() && Abs(par-LastPar) <= Precision::Confusion())
- {
- NewV = Vlast;
- if (firstind == 2 && j == 2)
- {
- BB.UpdateVertex( Vlast, ParsSeam(i)(j), SeamEdge, BRep_Tool::Tolerance(Vlast) );
- EPmap( SeamEdge ).Append( ParsSeam(i)(j) );
- EVmap( SeamEdge ).Append( Vlast );
- EWmap( SeamEdge ).Append( NonSeamWires(i) );
- break;
- }
- }
- else
- {
- BRepAdaptor_Curve bcur( NewE );
- gp_Pnt Point = bcur.Value( par );
- NewV = BRepLib_MakeVertex( Point );
- BB.UpdateVertex( NewV, par, NewE, 10.*Precision::Confusion() );
- }
- BB.UpdateVertex( NewV, ParsSeam(i)(j), SeamEdge, 10.*Precision::Confusion() );
- NewE.Orientation( TopAbs_FORWARD );
- BB.Add( NewE, PrevV.Oriented(TopAbs_FORWARD) );
- BB.Add( NewE, NewV.Oriented(TopAbs_REVERSED) );
-
- NewEdges.Append( NewE );
- EPmap( SeamEdge ).Append( ParsSeam(i)(j) );
- EVmap( SeamEdge ).Append( NewV );
- EWmap( SeamEdge ).Append( NonSeamWires(i) );
-
- prevpar = par;
- PrevV = NewV;
- }
- //The last edge
- TopoDS_Shape aLocalShape = anEdge.EmptyCopied();
- NewE = TopoDS::Edge( aLocalShape );
- //NewE = TopoDS::Edge( anEdge.EmptyCopied() );
- par = LastPar;
- if (Abs(prevpar-par) > Precision::Confusion())
- {
- BB.Range( NewE, prevpar, par );
- NewE.Orientation( TopAbs_FORWARD );
- BB.Add( NewE, PrevV.Oriented(TopAbs_FORWARD) );
- BB.Add( NewE, Vlast.Oriented(TopAbs_REVERSED) );
- NewEdges.Append( NewE );
- }
+ //Substitute anEdge by NewEdges
+ aSub.Substitute (anEdge, NewEdges);
+ }
- //Substitute anEdge by NewEdges
- aSub.Substitute( anEdge, NewEdges );
+ //Sorting of EPmap and EVmap and removing repeating points from them
+ iter.Initialize (EPmap);
+ for (; iter.More (); iter.Next ())
+ {
+ TColStd_SequenceOfReal Seq;
+ Seq = iter.Value ();
+ TopTools_SequenceOfShape SeqShape;
+ SeqShape = EVmap (iter.Key ());
+ TopTools_SequenceOfShape SeqShape2;
+ SeqShape2 = EWmap (iter.Key ());
+ for (i = 1; i < Seq.Length (); i++)
+ {
+ for (j = i + 1; j <= Seq.Length (); j++)
+ {
+ if (Seq (j) < Seq (i))
+ {
+ Standard_Real temp = Seq (i);
+ Seq (i) = Seq (j);
+ Seq (j) = temp;
+ TopoDS_Shape tmp = SeqShape (i);
+ SeqShape (i) = SeqShape (j);
+ SeqShape (j) = tmp;
+ tmp = SeqShape2 (i);
+ SeqShape2 (i) = SeqShape2 (j);
+ SeqShape2 (j) = tmp;
}
+ }
+ }
- //Sorting of EPmap and EVmap and removing repeating points from them
- iter.Initialize( EPmap );
- for (; iter.More(); iter.Next())
+ EPmap (iter.Key ()) = Seq;
+ EVmap (iter.Key ()) = SeqShape;
+ EWmap (iter.Key ()) = SeqShape2;
+ }
+ iter.Initialize (EPmap);
+ for (; iter.More (); iter.Next ())
+ {
+ TColStd_SequenceOfReal Seq;
+ Seq = iter.Value ();
+ TopTools_SequenceOfShape SeqShape;
+ SeqShape = EVmap (iter.Key ());
+ TopTools_SequenceOfShape SeqShape2;
+ SeqShape2 = EWmap (iter.Key ());
+ Standard_Boolean remove = Standard_True;
+ while (remove)
+ {
+ remove = Standard_False;
+ for (i = 1; i < Seq.Length (); i++)
+ {
+ if (Abs (Seq (i) - Seq (i + 1)) <= Precision::Confusion ())
{
- TColStd_SequenceOfReal Seq;
- Seq = iter.Value();
- TopTools_SequenceOfShape SeqShape;
- SeqShape = EVmap( iter.Key() );
- TopTools_SequenceOfShape SeqShape2;
- SeqShape2 = EWmap( iter.Key() );
- for (i = 1; i < Seq.Length(); i++)
- for (j = i+1; j <= Seq.Length(); j++)
- if (Seq(j) < Seq(i))
- {
- Standard_Real temp = Seq(i);
- Seq(i) = Seq(j);
- Seq(j) = temp;
- TopoDS_Shape tmp = SeqShape(i);
- SeqShape(i) = SeqShape(j);
- SeqShape(j) = tmp;
- tmp = SeqShape2(i);
- SeqShape2(i) = SeqShape2(j);
- SeqShape2(j) = tmp;
- }
- EPmap( iter.Key() ) = Seq;
- EVmap( iter.Key() ) = SeqShape;
- EWmap( iter.Key() ) = SeqShape2;
+ Seq.Remove (i + 1);
+ SeqShape.Remove (i + 1);
+ SeqShape2.Remove (i + 1);
+ remove = Standard_True;
}
- iter.Initialize( EPmap );
- for (; iter.More(); iter.Next())
+ }
+ }
+ EPmap (iter.Key ()) = Seq;
+ EVmap (iter.Key ()) = SeqShape;
+ EWmap (iter.Key ()) = SeqShape2;
+ }
+
+ //Reconstruction of seam edges
+ TopTools_DataMapOfShapeShape VEmap;
+ iter.Initialize (Emap);
+ for (; iter.More (); iter.Next ())
+ {
+ TopoDS_Edge anEdge = TopoDS::Edge (iter.Key ());
+ Standard_Boolean onepoint = Standard_False;
+ TopTools_ListOfShape NewEdges;
+ TColStd_SequenceOfReal Seq;
+ Seq = iter.Value ();
+ TColStd_SequenceOfReal Seq2;
+ Seq2 = EPmap (anEdge);
+ TopTools_SequenceOfShape SeqVer;
+ SeqVer = EVmap (anEdge);
+ TopTools_SequenceOfShape SeqWire;
+ SeqWire = EWmap (anEdge);
+ TopoDS_Vertex Vfirst, Vlast;
+ TopExp::Vertices (anEdge, Vfirst, Vlast);
+ Standard_Real fpar, lpar, FirstPar, LastPar;
+ BRep_Tool::Range (anEdge, FirstPar, LastPar);
+ fpar = FirstPar;
+ lpar = Seq (1);
+ TopoDS_Edge NewE;
+ Standard_Integer firstind = 1;
+ if (Abs (fpar - lpar) <= Precision::Confusion ())
+ {
+ firstind = 2;
+ fpar = Seq (1);
+ lpar = Seq (2);
+ }
+ else
+ {
+ if (Seq.Length () % 2 != 0)
+ {
+ VEmap.Bind (Vfirst, anEdge);
+ firstind = 2;
+ fpar = Seq (1);
+ if (Seq.Length () > 2)
+ lpar = Seq (2);
+ else
+ onepoint = Standard_True;
+ }
+ }
+ if (!onepoint)
+ {
+ TopoDS_Shape aLocalShape = anEdge.EmptyCopied ();
+ NewE = TopoDS::Edge (aLocalShape);
+ //NewE = TopoDS::Edge( anEdge.EmptyCopied() );
+ BB.Range (NewE, fpar, lpar);
+ NewE.Orientation (TopAbs_FORWARD);
+ if (firstind == 1)
+ {
+ BB.Add (NewE, Vfirst.Oriented (TopAbs_FORWARD));
+ aLocalShape = SeqVer (1).Oriented (TopAbs_REVERSED);
+ BB.Add (NewE, TopoDS::Vertex (aLocalShape));
+ //BB.Add( NewE, TopoDS::Vertex( SeqVer(1).Oriented(TopAbs_REVERSED) ) );
+ }
+ else
+ {
+ aLocalShape = SeqVer (1).Oriented (TopAbs_FORWARD);
+ BB.Add (NewE, TopoDS::Vertex (aLocalShape));
+ aLocalShape = SeqVer (2).Oriented (TopAbs_REVERSED);
+ BB.Add (NewE, TopoDS::Vertex (aLocalShape));
+ //BB.Add( NewE, TopoDS::Vertex( SeqVer(1).Oriented(TopAbs_FORWARD) ) );
+ //BB.Add( NewE, TopoDS::Vertex( SeqVer(2).Oriented(TopAbs_REVERSED) ) );
+ }
+ NewEdges.Append (NewE);
+
+ firstind++;
+ for (i = firstind; i < Seq.Length (); i += 2)
+ {
+ aLocalShape = anEdge.EmptyCopied ();
+ NewE = TopoDS::Edge (aLocalShape);
+ //NewE = TopoDS::Edge( anEdge.EmptyCopied() );
+ fpar = Seq (i);
+ lpar = Seq (i + 1);
+ BB.Range (NewE, fpar, lpar);
+ //Find vertices
+ for (j = 1; j <= Seq2.Length (); j++)
{
- TColStd_SequenceOfReal Seq;
- Seq = iter.Value();
- TopTools_SequenceOfShape SeqShape;
- SeqShape = EVmap( iter.Key() );
- TopTools_SequenceOfShape SeqShape2;
- SeqShape2 = EWmap( iter.Key() );
- Standard_Boolean remove = Standard_True;
- while (remove)
+ if (Abs (fpar - Seq2 (j)) <= Precision::Confusion ())
{
- remove = Standard_False;
- for (i = 1; i < Seq.Length(); i++)
- if (Abs(Seq(i)-Seq(i+1)) <= Precision::Confusion())
- {
- Seq.Remove(i+1);
- SeqShape.Remove(i+1);
- SeqShape2.Remove(i+1);
- remove = Standard_True;
- }
+ break;
}
- EPmap( iter.Key() ) = Seq;
- EVmap( iter.Key() ) = SeqShape;
- EWmap( iter.Key() ) = SeqShape2;
}
+ NewE.Orientation (TopAbs_FORWARD);
+ TopoDS_Shape aLocalShapeCur = SeqVer (j).Oriented (TopAbs_FORWARD);
+ BB.Add (NewE, TopoDS::Vertex (aLocalShapeCur));
+ aLocalShapeCur = SeqVer (j + 1).Oriented (TopAbs_REVERSED);
+ BB.Add (NewE, TopoDS::Vertex (aLocalShapeCur));
+ //BB.Add( NewE, TopoDS::Vertex( SeqVer(j).Oriented(TopAbs_FORWARD) ) );
+ //BB.Add( NewE, TopoDS::Vertex( SeqVer(j+1).Oriented(TopAbs_REVERSED) ) );
+ NewEdges.Append (NewE);
+ }
+ }
- //Reconstruction of seam edges
- TopTools_DataMapOfShapeShape VEmap;
- iter.Initialize( Emap );
- for (; iter.More(); iter.Next())
- {
- TopoDS_Edge anEdge = TopoDS::Edge( iter.Key() );
- Standard_Boolean onepoint = Standard_False;
- TopTools_ListOfShape NewEdges;
- TColStd_SequenceOfReal Seq;
- Seq = iter.Value();
- TColStd_SequenceOfReal Seq2;
- Seq2 = EPmap( anEdge );
- TopTools_SequenceOfShape SeqVer;
- SeqVer = EVmap( anEdge );
- TopTools_SequenceOfShape SeqWire;
- SeqWire = EWmap( anEdge );
- TopoDS_Vertex Vfirst, Vlast;
- TopExp::Vertices( anEdge, Vfirst, Vlast );
- Standard_Real fpar, lpar, FirstPar, LastPar;
- BRep_Tool::Range( anEdge, FirstPar, LastPar );
- fpar = FirstPar;
- lpar = Seq(1);
- TopoDS_Edge NewE;
- Standard_Integer firstind = 1;
- if (Abs(fpar-lpar) <= Precision::Confusion())
- {
- firstind = 2;
- fpar = Seq(1);
- lpar = Seq(2);
- }
- else
- {
- if (Seq.Length()%2 != 0)
- {
- VEmap.Bind( Vfirst, anEdge );
- firstind = 2;
- fpar = Seq(1);
- if (Seq.Length() > 2)
- lpar = Seq(2);
- else
- onepoint = Standard_True;
- }
- }
- if (!onepoint)
- {
- TopoDS_Shape aLocalShape = anEdge.EmptyCopied();
- NewE = TopoDS::Edge( aLocalShape );
- //NewE = TopoDS::Edge( anEdge.EmptyCopied() );
- BB.Range( NewE, fpar, lpar );
- NewE.Orientation( TopAbs_FORWARD );
- if (firstind == 1)
- {
- BB.Add( NewE, Vfirst.Oriented(TopAbs_FORWARD) );
- aLocalShape = SeqVer(1).Oriented(TopAbs_REVERSED);
- BB.Add( NewE, TopoDS::Vertex( aLocalShape ) );
- //BB.Add( NewE, TopoDS::Vertex( SeqVer(1).Oriented(TopAbs_REVERSED) ) );
- }
- else
- {
- aLocalShape = SeqVer(1).Oriented(TopAbs_FORWARD);
- BB.Add( NewE, TopoDS::Vertex( aLocalShape ) );
- aLocalShape = SeqVer(2).Oriented(TopAbs_REVERSED);
- BB.Add( NewE, TopoDS::Vertex( aLocalShape ) );
- //BB.Add( NewE, TopoDS::Vertex( SeqVer(1).Oriented(TopAbs_FORWARD) ) );
- //BB.Add( NewE, TopoDS::Vertex( SeqVer(2).Oriented(TopAbs_REVERSED) ) );
- }
- NewEdges.Append( NewE );
+ i = Seq.Length ();
+ fpar = Seq (i);
+ lpar = LastPar;
+ if (Abs (fpar - lpar) <= Precision::Confusion ())
+ continue;
+ TopoDS_Shape aLocalShape = anEdge.EmptyCopied ();
+ NewE = TopoDS::Edge (aLocalShape);
+ //NewE = TopoDS::Edge( anEdge.EmptyCopied() );
+ BB.Range (NewE, fpar, lpar);
+ NewE.Orientation (TopAbs_FORWARD);
+ aLocalShape = SeqVer (SeqVer.Length ()).Oriented (TopAbs_FORWARD);
+ BB.Add (NewE, TopoDS::Vertex (aLocalShape));
+ //BB.Add( NewE, TopoDS::Vertex( SeqVer(SeqVer.Length()).Oriented(TopAbs_FORWARD) ) );
+ BB.Add (NewE, Vlast.Oriented (TopAbs_REVERSED));
+ NewEdges.Append (NewE);
+
+ //Substitute anEdge by NewEdges
+ aSub.Substitute (anEdge, NewEdges);
+ }
- firstind++;
- for (i = firstind; i < Seq.Length(); i += 2)
- {
- aLocalShape = anEdge.EmptyCopied();
- NewE = TopoDS::Edge( aLocalShape );
- //NewE = TopoDS::Edge( anEdge.EmptyCopied() );
- fpar = Seq(i);
- lpar = Seq(i+1);
- BB.Range( NewE, fpar, lpar );
- //Find vertices
- for (j = 1; j <= Seq2.Length(); j++)
- if (Abs(fpar-Seq2(j)) <= Precision::Confusion())
- break;
- NewE.Orientation( TopAbs_FORWARD );
- TopoDS_Shape aLocalShapeCur = SeqVer(j).Oriented(TopAbs_FORWARD);
- BB.Add( NewE, TopoDS::Vertex( aLocalShapeCur) );
- aLocalShapeCur = SeqVer(j+1).Oriented(TopAbs_REVERSED);
- BB.Add( NewE, TopoDS::Vertex( aLocalShapeCur ) );
- //BB.Add( NewE, TopoDS::Vertex( SeqVer(j).Oriented(TopAbs_FORWARD) ) );
- //BB.Add( NewE, TopoDS::Vertex( SeqVer(j+1).Oriented(TopAbs_REVERSED) ) );
- NewEdges.Append( NewE );
- }
- }
+ //Removing edges connected with missing extremities of seam edges
+ TopTools_DataMapIteratorOfDataMapOfShapeShape itve (VEmap);
+ for (; itve.More (); itve.Next ())
+ {
+ TopoDS_Shape V = itve.Key ();
+ TopoDS_Shape E = itve.Value ();
+ TopoDS_Shape W;
+ for (i = 1; i <= Eseq.Length (); i++)
+ {
+ if (E.IsSame (Eseq (i)))
+ {
+ W = Wseq (i);
+ break;
+ }
+ }
+ TopoDS_Shape Etoremove;
+ eit.Initialize (W);
+ for (; eit.More (); eit.Next ())
+ {
+ TopoDS_Edge CurE = TopoDS::Edge (eit.Value ());
+ if (CurE.IsSame (E))
+ continue;
+ TopoDS_Vertex Vfirst, Vlast;
+ TopExp::Vertices (CurE, Vfirst, Vlast);
+ if (Vfirst.IsSame (V) || Vlast.IsSame (V))
+ {
+ Etoremove = CurE;
+ break;
+ }
+ }
+ if (!Etoremove.IsNull ())
+ {
+ W.Free (Standard_True);
+ BB.Remove (W, Etoremove);
+ }
+ }
- i = Seq.Length();
- fpar = Seq(i);
- lpar = LastPar;
- if (Abs(fpar-lpar) <= Precision::Confusion())
- continue;
- TopoDS_Shape aLocalShape = anEdge.EmptyCopied();
- NewE = TopoDS::Edge( aLocalShape );
- //NewE = TopoDS::Edge( anEdge.EmptyCopied() );
- BB.Range( NewE, fpar, lpar );
- NewE.Orientation( TopAbs_FORWARD );
- aLocalShape = SeqVer(SeqVer.Length()).Oriented(TopAbs_FORWARD);
- BB.Add( NewE, TopoDS::Vertex( aLocalShape ) );
- //BB.Add( NewE, TopoDS::Vertex( SeqVer(SeqVer.Length()).Oriented(TopAbs_FORWARD) ) );
- BB.Add( NewE, Vlast.Oriented(TopAbs_REVERSED) );
- NewEdges.Append( NewE );
-
- //Substitute anEdge by NewEdges
- aSub.Substitute( anEdge, NewEdges );
- }
+ aSub.Build (myShape);
+ if (aSub.IsCopied (myShape))
+ {
+ const TopTools_ListOfShape& listSh = aSub.Copy (myShape);
+ if (!listSh.IsEmpty ())
+ myShape = listSh.First ();
+ }
- //Removing edges connected with missing extremities of seam edges
- TopTools_DataMapIteratorOfDataMapOfShapeShape itve( VEmap );
- for (; itve.More(); itve.Next())
+ //Reconstruction of wires
+ TopTools_ListOfShape theCopy;
+ TopTools_DataMapIteratorOfDataMapOfShapeListOfShape itww (WWmap);
+ for (; itww.More (); itww.Next ())
+ {
+ CurWire = itww.Key ();
+ theCopy = aSub.Copy (CurWire);
+ CurWire = theCopy.First ();
+ CurWire.Free (Standard_True);
+ TopTools_ListIteratorOfListOfShape itl (itww.Value ());
+ for (; itl.More (); itl.Next ())
+ {
+ TopoDS_Shape aWire = itl.Value ();
+ CurFace = WFmap (aWire);
+ theCopy = aSub.Copy (aWire);
+ aWire = theCopy.First ();
+ //Adjusting period
+ TopLoc_Location L;
+ Handle (Geom_Surface) theSurf = BRep_Tool::Surface (TopoDS::Face (CurFace), L);
+ eit.Initialize (aWire);
+ for (; eit.More (); eit.Next ())
+ {
+ TopoDS_Edge anEdge = TopoDS::Edge (eit.Value ());
+ gp_Pnt2d Pfirst, Plast, Pmid;
+ BRep_Tool::UVPoints (anEdge, TopoDS::Face (CurFace), Pfirst, Plast);
+ BRepAdaptor_Curve2d bc2d (anEdge, TopoDS::Face (CurFace));
+ Pmid = bc2d.Value ((bc2d.FirstParameter () + bc2d.LastParameter ()) / 2.);
+ gp_Vec2d offset;
+ Standard_Boolean translate = Standard_False;
+ if (Pfirst.X () - 2.*M_PI > Precision::Confusion () ||
+ Plast.X () - 2.*M_PI > Precision::Confusion () ||
+ Pmid.X () - 2.*M_PI > Precision::Confusion ())
{
- TopoDS_Shape V = itve.Key();
- TopoDS_Shape E = itve.Value();
- TopoDS_Shape W;
- for (i = 1; i <= Eseq.Length(); i++)
- if (E.IsSame( Eseq(i) ))
- {
- W = Wseq(i);
- break;
- }
- TopoDS_Shape Etoremove;
- eit.Initialize( W );
- for (; eit.More(); eit.Next())
- {
- TopoDS_Edge CurE = TopoDS::Edge( eit.Value() );
- if (CurE.IsSame( E ))
- continue;
- TopoDS_Vertex Vfirst, Vlast;
- TopExp::Vertices( CurE, Vfirst, Vlast );
- if (Vfirst.IsSame( V ) || Vlast.IsSame( V ))
- {
- Etoremove = CurE;
- break;
- }
- }
- if (! Etoremove.IsNull())
- {
- W.Free( Standard_True );
- BB.Remove( W, Etoremove );
- }
+ offset.SetCoord (-2.*M_PI, 0);
+ translate = Standard_True;
}
-
- aSub.Build( myShape );
- if (aSub.IsCopied( myShape ))
+ if (Pfirst.X () < -Precision::Confusion () ||
+ Plast.X () < -Precision::Confusion () ||
+ Pmid.X () < -Precision::Confusion ())
{
- const TopTools_ListOfShape& listSh = aSub.Copy( myShape );
- if (! listSh.IsEmpty())
- myShape = listSh.First();
+ offset.SetCoord (2.*M_PI, 0);
+ translate = Standard_True;
}
-
- //Reconstruction of wires
- TopTools_ListOfShape theCopy;
- TopTools_DataMapIteratorOfDataMapOfShapeListOfShape itww( WWmap );
- for (; itww.More(); itww.Next())
+ if (translate)
{
- CurWire = itww.Key();
- theCopy = aSub.Copy( CurWire );
- CurWire = theCopy.First();
- CurWire.Free( Standard_True );
- TopTools_ListIteratorOfListOfShape itl( itww.Value() );
- for (; itl.More(); itl.Next())
+ const Handle (BRep_TEdge)& TE = *((Handle (BRep_TEdge)*) &anEdge.TShape ());
+ BRep_ListIteratorOfListOfCurveRepresentation itcr (TE->ChangeCurves ());
+ Handle (BRep_GCurve) GC;
+
+ for (; itcr.More (); itcr.Next ())
{
- TopoDS_Shape aWire = itl.Value();
- CurFace = WFmap( aWire );
- theCopy = aSub.Copy( aWire );
- aWire = theCopy.First();
- //Adjusting period
- TopLoc_Location L;
- Handle( Geom_Surface ) theSurf = BRep_Tool::Surface( TopoDS::Face(CurFace), L );
- eit.Initialize( aWire );
- for (; eit.More(); eit.Next())
+ GC = Handle (BRep_GCurve)::DownCast (itcr.Value ());
+ if (!GC.IsNull () && GC->IsCurveOnSurface (theSurf, L))
{
- TopoDS_Edge anEdge = TopoDS::Edge( eit.Value() );
- gp_Pnt2d Pfirst, Plast, Pmid;
- BRep_Tool::UVPoints( anEdge, TopoDS::Face(CurFace), Pfirst, Plast );
- BRepAdaptor_Curve2d bc2d( anEdge, TopoDS::Face(CurFace) );
- Pmid = bc2d.Value( (bc2d.FirstParameter()+bc2d.LastParameter())/2. );
- gp_Vec2d offset;
- Standard_Boolean translate = Standard_False;
- if (Pfirst.X()-2.*M_PI > Precision::Confusion() ||
- Plast.X()-2.*M_PI > Precision::Confusion() ||
- Pmid.X()-2.*M_PI > Precision::Confusion())
- {
- offset.SetCoord( -2.*M_PI, 0 );
- translate = Standard_True;
- }
- if (Pfirst.X() < -Precision::Confusion() ||
- Plast.X() < -Precision::Confusion() ||
- Pmid.X() < -Precision::Confusion())
- {
- offset.SetCoord( 2.*M_PI, 0 );
- translate = Standard_True;
- }
- if (translate)
- {
- const Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*) &anEdge.TShape());
- BRep_ListIteratorOfListOfCurveRepresentation itcr( TE->ChangeCurves() );
- Handle(BRep_GCurve) GC;
-
- for (; itcr.More(); itcr.Next())
- {
- GC = Handle(BRep_GCurve)::DownCast(itcr.Value());
- if (!GC.IsNull() && GC->IsCurveOnSurface( theSurf, L ))
- {
- Handle(Geom2d_Curve) PC = GC->PCurve();
- PC = Handle(Geom2d_Curve)::DownCast( PC->Translated( offset ) );
- GC->PCurve( PC );
- TE->ChangeCurves().Remove( itcr );
- TE->ChangeCurves().Append( GC );
- break;
- }
- }
- }
- }
- ///////////////////
- eit.Initialize( aWire, Standard_False );
- for (; eit.More(); eit.Next())
- {
- TopoDS_Shape anEdge = eit.Value();
- BB.Add( CurWire, anEdge );
- }
- if (aSub.IsCopied( CurFace ))
- {
- theCopy = aSub.Copy( CurFace );
- CurFace = theCopy.First();
+ Handle (Geom2d_Curve) PC = GC->PCurve ();
+ PC = Handle (Geom2d_Curve)::DownCast (PC->Translated (offset));
+ GC->PCurve (PC);
+ TE->ChangeCurves ().Remove (itcr);
+ TE->ChangeCurves ().Append (GC);
+ break;
}
- CurFace.Free( Standard_True );
- BB.Remove( CurFace, aWire );
}
}
+ }
+ ///////////////////
+ eit.Initialize (aWire, Standard_False);
+ for (; eit.More (); eit.Next ())
+ {
+ TopoDS_Shape anEdge = eit.Value ();
+ BB.Add (CurWire, anEdge);
+ }
+ if (aSub.IsCopied (CurFace))
+ {
+ theCopy = aSub.Copy (CurFace);
+ CurFace = theCopy.First ();
+ }
+ CurFace.Free (Standard_True);
+ BB.Remove (CurFace, aWire);
+ }
+ }
}
//=======================================================================
//function : CorrectVertexTol
{
Standard_Boolean wdeg = Standard_True;
for (i = 1; i <= myWires.Length(); i++)
+ {
for (explo.Init(myWires(i), TopAbs_EDGE); explo.More(); explo.Next())
{
const TopoDS_Edge& anEdge = TopoDS::Edge(explo.Current());
wdeg = wdeg && (BRep_Tool::Degenerated(anEdge));
}
- if (wdeg)
- throw Standard_Failure("Wrong usage of punctual sections");
+ }
+ if (wdeg)
+ {
+ throw Standard_Failure("Wrong usage of punctual sections");
+ }
}
myNbEdgesInSection = 0;
Standard_Boolean BRepPrim_GWedge::HasEdge (const BRepPrim_Direction d1,
const BRepPrim_Direction d2) const
-{
+{
Standard_Boolean state = !(myInfinite[BRepPrim_Wedge_NumDir1(d1)] ||
- myInfinite[BRepPrim_Wedge_NumDir1(d2)]);
+ myInfinite[BRepPrim_Wedge_NumDir1(d2)]);
Standard_Integer i = BRepPrim_Wedge_NumDir2(d1,d2);
if ( i == 6 || i == 7 ) state = state && ( X2Max != X2Min );
else if ( i == 1 || i == 3 ) state = state && ( Z2Max != Z2Min );
gp_Vec VX = myAxes.XDirection();
gp_Vec VY = myAxes.YDirection();
gp_Vec VZ = myAxes.Direction();
-
+
switch (i/4) {
-
+
case 0 :
D = myAxes.Direction();
break;
-
+
case 1 :
D = myAxes.XDirection();
break;
-
+
case 2 :
D = myAxes.YDirection();
break;
-
+
};
-
+
switch (i) {
-
+
case 0 :
// XMin YMin
X = XMin;
Y = YMin;
Z = ZMin;
break;
-
+
case 1 :
// XMin YMax
X = X2Min;
Y = YMax;
Z = Z2Min;
break;
-
+
case 2 :
// XMax YMin
X = XMax;
Y = YMin;
Z = ZMin;
break;
-
+
case 3 :
// XMax YMax
X = X2Max;
Y = YMax;
Z = Z2Min;
break;
-
+
case 4 :
// YMin ZMin
X = XMin;
Y = YMin;
Z = ZMin;
break;
-
+
case 5 :
// YMin ZMax
X = XMin;
Y = YMin;
Z = ZMax;
break;
-
+
case 6 :
// YMax ZMin
X = X2Min;
Y = YMax;
Z = Z2Min;
break;
-
+
case 7 :
// YMax ZMax
X = X2Min;
Y = YMax;
Z = Z2Max;
break;
-
+
case 8 :
// ZMin XMin
X = XMin;
Y = YMin;
Z = ZMin;
- if ( (XMin != X2Min) || (ZMin != Z2Min) )
+ if ( (XMin != X2Min) || (ZMin != Z2Min) )
+ {
D = gp_Vec( (X2Min-XMin)*VX + (YMax-YMin)*VY + (Z2Min-ZMin)*VZ);
+ }
break;
-
+
case 9 :
// ZMax XMin
X = XMin;
Y = YMin;
Z = ZMax;
- if ( (XMin != X2Min) || (ZMax != Z2Max) )
+ if ( (XMin != X2Min) || (ZMax != Z2Max) )
+ {
D = gp_Vec( (X2Min-XMin)*VX + (YMax-YMin)*VY + (Z2Max-ZMax)*VZ);
+ }
break;
-
+
case 10 :
// ZMin XMax
X = XMax;
Y = YMin;
Z = ZMin;
- if ( (XMax != X2Max) || (ZMin != Z2Min) )
+ if ( (XMax != X2Max) || (ZMin != Z2Min) )
+ {
D = gp_Vec( (X2Max-XMax)*VX + (YMax-YMin)*VY + (Z2Min-ZMin)*VZ);
+ }
break;
-
+
case 11 :
// ZMax XMax
X = XMax;
Y = YMin;
Z = ZMax;
- if ( (XMax != X2Max) || (ZMax != Z2Max) )
- D = gp_Vec(gp_Pnt(XMax,YMin,ZMax),gp_Pnt(X2Max,YMax,Z2Max));
+ if ( (XMax != X2Max) || (ZMax != Z2Max) )
+ {
D = gp_Vec( (X2Max-XMax)*VX + (YMax-YMin)*VY + (Z2Max-ZMax)*VZ);
+ }
break;
-
+
}
gp_Pnt P = myAxes.Location();
P.Translate(Y*gp_Vec(myAxes.YDirection()));
P.Translate(Z*gp_Vec(myAxes.Direction ()));
return gp_Lin(gp_Ax1(P,D));
-
+
}
//=======================================================================
// Binds all the faces of S
// - to the face itself if it is not copied
// - to the copy if it is copied
- if(myBounds.Contains(S)) return;
+ if(myBounds.Contains(S))
+ {
+ return;
+ }
+
BRep_Builder B;
- for (TopExp_Explorer wex(S,TopAbs_WIRE,TopAbs_FACE); wex.More(); wex.Next())
- myBounds.Add(wex.Current(),wex.Current());
-
+ for (TopExp_Explorer wex(S,TopAbs_WIRE,TopAbs_FACE); wex.More(); wex.Next())
+ {
+ myBounds.Add(wex.Current(),wex.Current());
+ }
+
for (TopExp_Explorer eex(S,TopAbs_EDGE,TopAbs_WIRE); eex.More(); eex.Next())
+ {
myBounds.Add(eex.Current(),eex.Current());
-
+ }
+
for (TopExp_Explorer vex(S,TopAbs_VERTEX,TopAbs_EDGE); vex.More(); vex.Next())
+ {
myBounds.Add(vex.Current(),vex.Current());
-
+ }
+
// explore the faces
for (TopExp_Explorer fex(S,TopAbs_FACE); fex.More(); fex.Next()) {
const Standard_Integer Id)
{
if (Id == 1) // the new edge is a fillet
+ {
fillets.Append(NewEdge);
+ }
else // the new edge is a chamfer
+ {
chamfers.Append(NewEdge);
- if (history.IsBound(E1)) history.UnBind(E1);
- if ( status != ChFi2d_FirstEdgeDegenerated
- && status != ChFi2d_BothEdgesDegenerated) {
- if (!E1.IsSame(TrimE1)) history.Bind(E1, TrimE1);
}
- if (history.IsBound(E2)) history.UnBind(E2);
- if ( status != ChFi2d_LastEdgeDegenerated
- && status != ChFi2d_BothEdgesDegenerated) {
- if (!E2.IsSame(TrimE2)) history.Bind(E2, TrimE2);
+
+ history.UnBind(E1);
+ if (status != ChFi2d_FirstEdgeDegenerated
+ && status != ChFi2d_BothEdgesDegenerated)
+ {
+ if (!E1.IsSame(TrimE1))
+ {
+ history.Bind(E1, TrimE1);
+ }
+ }
+ history.UnBind(E2);
+ if (status != ChFi2d_LastEdgeDegenerated
+ && status != ChFi2d_BothEdgesDegenerated)
+ {
+ if (!E2.IsSame(TrimE2))
+ {
+ history.Bind(E2, TrimE2);
+ }
}
} // UpDateHistory
if (GBz.IsNull()) {
GBs = DrawTrSurf::GetBSplineSurface(a[1]);
if (GBs.IsNull())
+ {
return 1;
- BSpline = Standard_True;
+ }
+ BSpline = Standard_True;
}
Standard_Real dx = Draw::Atof(a[n-3]);
if (GBz.IsNull()) {
GBs = DrawTrSurf::GetBSplineSurface(a[1]);
if (GBs.IsNull())
+ {
return 1;
- BSpline = Standard_True;
+ }
+ BSpline = Standard_True;
}
Standard_Integer UIndex = 0;
switch (Tr1->TransitionType()) { // compute the transition
case IntRes2d_In :
- if (myFEOri == TopAbs_REVERSED) Orie = TopAbs_REVERSED;
- else Orie = TopAbs_FORWARD ; break;
+ Orie = (myFEOri == TopAbs_REVERSED ? TopAbs_REVERSED : TopAbs_FORWARD);
+ break;
case IntRes2d_Out :
- if (myFEOri == TopAbs_REVERSED) Orie = TopAbs_FORWARD ;
- else Orie = TopAbs_REVERSED; break;
+ Orie = (myFEOri == TopAbs_REVERSED ? TopAbs_FORWARD : TopAbs_REVERSED);
+ break;
case IntRes2d_Touch :
switch (Tr1->Situation()) {
case IntRes2d_Inside :
- if (myFEOri == TopAbs_REVERSED) Orie = TopAbs_EXTERNAL;
- else Orie = TopAbs_INTERNAL; break;
+ Orie = (myFEOri == TopAbs_REVERSED ? TopAbs_EXTERNAL : TopAbs_INTERNAL);
+ break;
case IntRes2d_Outside :
- if (myFEOri == TopAbs_REVERSED) Orie = TopAbs_INTERNAL;
- else Orie = TopAbs_EXTERNAL; break;
+ Orie = (myFEOri == TopAbs_REVERSED ? TopAbs_INTERNAL : TopAbs_EXTERNAL);
+ break;
case IntRes2d_Unknown :
return Standard_True;
- } break;
+ }
+ break;
case IntRes2d_Undecided :
return Standard_True;
}
// #### INITIALISATIONS ####
// #########################################
-static int initactor = 0;
+static int THE_IFSelect_Functions_initactor = 0;
-
- void IFSelect_Functions::Init ()
+void IFSelect_Functions::Init()
{
- if (initactor) return; initactor = 1;
+ if (THE_IFSelect_Functions_initactor)
+ {
+ return;
+ }
+
+ THE_IFSelect_Functions_initactor = 1;
IFSelect_Act::SetGroup("DE: General");
IFSelect_Act::AddFunc("xstatus","Lists XSTEP Status : Version, System Name ...",funstatus);
IFSelect_Act::AddFunc("handler","Toggle status catch Handler Error of the session",fun1);
#define MAXWORDS 200
#define MAXCARS 1000
-static int initactor = 0;
+static int THE_IFSelect_SessionPilot_initactor = 0;
static TCollection_AsciiString nulword;
//#define DEBUG_TRACE
// Nb Maxi de words : cf thewords et method SetCommandLine
- IFSelect_SessionPilot::IFSelect_SessionPilot (const Standard_CString prompt)
- : theprompt (prompt) , thewords (0,MAXWORDS-1) , thewordeb (0,MAXWORDS-1)
+IFSelect_SessionPilot::IFSelect_SessionPilot (const Standard_CString prompt)
+: theprompt (prompt),
+ thewords (0, MAXWORDS - 1),
+ thewordeb (0, MAXWORDS - 1)
{
- if (theprompt.Length() == 0) theprompt.AssignCat ("Test-XSTEP>");
- therecord = Standard_False; thenbwords = 0;
- if (initactor) return; initactor = 1;
+ if (theprompt.Length() == 0)
+ {
+ theprompt.AssignCat ("Test-XSTEP>");
+ }
+ therecord = Standard_False;
+ thenbwords = 0;
+ if (THE_IFSelect_SessionPilot_initactor)
+ {
+ return;
+ }
+
+ THE_IFSelect_SessionPilot_initactor = 1;
Add (1,"x");
Add (1,"exit");
Add (2,"?");
}
Handle(IFSelect_Selection) sel;
- if (np >= 0) nomsel[np] = 0; if (nf >= 0) nomsel[nf] = '\0';
+ if (np >= 0)
+ {
+ nomsel[np] = 0;
+ }
+ if (nf >= 0)
+ {
+ nomsel[nf] = '\0';
+ }
Handle(Standard_Transient) item = NamedItem(nomsel);
// Parentheses ? essayer Signature (plus tard : Selection parametree)
if (selname[i] == ' ') continue;
if (selname[i] == ',' || selname[i] == ')') {
entid[j] = '\0';
- if (j == 0) continue; j = 0;
+ if (j == 0) continue;
+ j = 0;
num = NumberFromLabel (entid);
if (num <= 0 || !numap.Add (num)) continue;
Handle(Standard_Transient) anent = StartingEntity(num);
IMPLEMENT_STANDARD_RTTIEXT(IGESAppli_Protocol,IGESData_Protocol)
-static int deja = 0;
+static int THE_IGESAppli_Protocol_deja = 0;
+
static Handle(Standard_Type) atype01,atype02,atype03,atype04,atype05,atype06,
atype07,atype08,atype09,atype10,atype11,atype12,atype13,atype14,atype15,
atype16,atype17,atype18,atype19;
- IGESAppli_Protocol::IGESAppli_Protocol ()
+IGESAppli_Protocol::IGESAppli_Protocol()
{
- if (deja) return; deja = 1;
+ if (THE_IGESAppli_Protocol_deja)
+ {
+ return;
+ }
+
+ THE_IGESAppli_Protocol_deja = 1;
atype01 = STANDARD_TYPE(IGESAppli_DrilledHole);
atype02 = STANDARD_TYPE(IGESAppli_ElementResults);
atype03 = STANDARD_TYPE(IGESAppli_FiniteElement);
IMPLEMENT_STANDARD_RTTIEXT(IGESBasic_Protocol,IGESData_Protocol)
-static int deja = 0;
+static int THE_IGESBasic_Protocol_deja = 0;
+
static Handle(Standard_Type) atype01,atype02,atype03,atype04,atype05,atype06,
atype07,atype08,atype09,atype10,atype11,atype12,atype13,atype14,atype15,atype16;
- IGESBasic_Protocol::IGESBasic_Protocol ()
+IGESBasic_Protocol::IGESBasic_Protocol()
{
- if (deja) return; deja = 1;
+ if (THE_IGESBasic_Protocol_deja)
+ {
+ return;
+ }
+
+ THE_IGESBasic_Protocol_deja = 1;
atype01 = STANDARD_TYPE(IGESBasic_AssocGroupType);
atype02 = STANDARD_TYPE(IGESBasic_ExternalRefFile);
atype03 = STANDARD_TYPE(IGESBasic_ExternalRefFileIndex);
PR.SendFail(Msg221);
return;
}
- if (nbprops == 0) return; ncur ++;
+ if (nbprops == 0)
+ {
+ return;
+ }
+
+ ++ncur;
Interface_EntityList props;
if (PR.ReadEntList
(IR,PR.CurrentList(nbprops),Msg38, props,Standard_False) )
IGESData_IGESWriter::IGESData_IGESWriter
(const Handle(IGESData_IGESModel)& amodel)
: thedirs(0,amodel->NbEntities()) , thepnum(1,amodel->NbEntities()+1),
- thecurr (MaxcarsG+1) , themodew (0) , thefloatw (9)
+ thecurr (MaxcarsG+1) , themodew (0) , thefloatw (9)
{
themodel = amodel;
thehead = new TColStd_HSequenceOfHAsciiString();
//=======================================================================
//function : SendStartLine
-//purpose :
+//purpose :
//=======================================================================
void IGESData_IGESWriter::SendStartLine (const Standard_CString startline)
{
writefnes (S," S0000001");
}
else S<<" S0000001";
-// 123456789 123456789 123456789 123456789 123456789 123456789 123456789 12
+// 123456789 123456789 123456789 123456789 123456789 123456789 123456789 12
S << endl;
} else {
nbs = thestar->Length();
// for (Standard_Integer k = line->Length()+1; k <= MaxcarsG; k ++) S<<' ';
S << &blancs[line->Length()];
if (fnes) writefnes (S,finlin);
- else S << finlin; S << endl;
+ else S << finlin;
+ S << endl;
}
}
#ifdef PATIENCELOG
// for (Standard_Integer k = line->Length()+1; k <= MaxcarsG; k ++) S<<' ';
S << &blancs[line->Length()];
if (fnes) writefnes (S,finlin);
- else S << finlin; S << endl;
+ else S << finlin;
+ S << endl;
isGood = S.good();
}
if(!isGood)
v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7],
v[8],v[9],v[10],v[11] ,2*i-1);
if (fnes) writefnes (S,ligne);
- else S << ligne; S<< "\n";
+ else S << ligne;
+ S<< "\n";
sprintf(ligne,"%8d%8d%8d%8d%8d%8s%8s%8s%8sD%7.7d",
v[0],v[13],v[14],v[15],v[16],res1,res2,lab,num,2*i);
if (fnes) writefnes (S,ligne);
- else S << ligne; S<< "\n";
+ else S << ligne;
+ S<< "\n";
// cout << "Ent.no "<<i<<" No en P "<<thepnum.Value(i)<<
// " Lignes P:"<<thepnum.Value(i+1)-thepnum.Value(i)<<endl;
// for (j = 0; j < 17; j ++) S<<v[j]<<" ";
cout<<" Parameter Section : "<<thepnum.Value(nbd)-1
<<" lines (* = 1000 lines) "<<flush;
#endif
-
+
blancs[MaxcarsP] = '\0';
for (i = 1; i <= nbd && isGood; i ++) {
for (Standard_Integer j = thepnum.Value(i); j < thepnum.Value(i+1); j ++) {
// for (Standard_Integer k = line->Length()+1; k <= MaxcarsP; k ++)S<<' ';
S << &blancs[line->Length()];
if (fnes) writefnes (S,finlin);
- else S << finlin; S << endl;
+ else S << finlin;
+ S << endl;
isGood = S.good();
#ifdef PATIENCELOG
lignespatience --;
nbs,nbg,nbd*2,thepnum.Value(thepnum.Length())-1);
// 12345678- 16- 24- 32 56789 123456789 123456789 123456789 12
if (fnes) writefnes (S,ligne);
- else S << ligne; S<< "\n";
+ else S << ligne;
+ S<< "\n";
S.flush();
isGood = S.good();
#ifdef PATIENCELOG
IMPLEMENT_STANDARD_RTTIEXT(IGESDefs_Protocol,IGESData_Protocol)
-static int deja = 0;
+static int THE_IGESDefs_Protocol_deja = 0;
+
static Handle(Standard_Type) atype1,atype2,atype3,atype4,atype5,atype6,atype7;
- IGESDefs_Protocol::IGESDefs_Protocol ()
+IGESDefs_Protocol::IGESDefs_Protocol()
{
- if (deja) return; deja = 1;
+ if (THE_IGESDefs_Protocol_deja)
+ {
+ return;
+ }
+
+ THE_IGESDefs_Protocol_deja = 1;
atype1 = STANDARD_TYPE(IGESDefs_AssociativityDef);
atype2 = STANDARD_TYPE(IGESDefs_AttributeDef);
atype3 = STANDARD_TYPE(IGESDefs_AttributeTable);
Standard_Integer IGESDefs_Protocol::TypeNumber
(const Handle(Standard_Type)& atype) const
-{
+{
if (atype == atype1) return 1;
else if (atype == atype2) return 2;
else if (atype == atype3) return 3;
}
else if (fn == 0) continue;
mess[0] = '\0';
- switch (aty) {
- case 1 : if (!list->IsKind(STANDARD_TYPE(TColStd_HArray1OfInteger)))
- sprintf(mess,"Attribute List n0.%d (Integers) badly defined", aty);
- break;
- case 2 : if (!list->IsKind(STANDARD_TYPE(TColStd_HArray1OfReal)))
- sprintf(mess,"Attribute List n0.%d (Reals) badly defined", aty);
- break;
- case 3 : if (!list->IsKind(STANDARD_TYPE(Interface_HArray1OfHAsciiString)))
- sprintf(mess,"Attribute List n0.%d (Strings) badly defined", aty);
- break;
- case 4 : if (!list->IsKind(STANDARD_TYPE(IGESData_HArray1OfIGESEntity)))
- sprintf(mess,"Attribute List n0.%d (IGES Pointers) badly defined", aty);
- break;
- case 6 : if (!list->IsKind(STANDARD_TYPE(TColStd_HArray1OfInteger)))
- sprintf(mess,"Attribute List n0.%d (Logicals i.e. Integers) badly defined", aty);
- break;
- default : break;
+ switch (aty)
+ {
+ case 1:
+ if (!list->IsKind(STANDARD_TYPE(TColStd_HArray1OfInteger)))
+ {
+ sprintf(mess,"Attribute List n0.%d (Integers) badly defined", aty);
+ }
+ break;
+ case 2:
+ if (!list->IsKind(STANDARD_TYPE(TColStd_HArray1OfReal)))
+ {
+ sprintf(mess,"Attribute List n0.%d (Reals) badly defined", aty);
+ }
+ break;
+ case 3:
+ if (!list->IsKind(STANDARD_TYPE(Interface_HArray1OfHAsciiString)))
+ {
+ sprintf(mess,"Attribute List n0.%d (Strings) badly defined", aty);
+ }
+ break;
+ case 4:
+ if (!list->IsKind(STANDARD_TYPE(IGESData_HArray1OfIGESEntity)))
+ {
+ sprintf(mess,"Attribute List n0.%d (IGES Pointers) badly defined", aty);
+ }
+ break;
+ case 6:
+ if (!list->IsKind(STANDARD_TYPE(TColStd_HArray1OfInteger)))
+ {
+ sprintf(mess,"Attribute List n0.%d (Logicals i.e. Integers) badly defined", aty);
+ }
+ break;
+ default:
+ break;
}
if (mess[0] != '\0') ach->AddFail(mess);
}
IMPLEMENT_STANDARD_RTTIEXT(IGESDimen_Protocol,IGESData_Protocol)
-static int deja = 0;
+static int THE_IGESDimen_Protocol_deja = 0;
+
static Handle(Standard_Type) atype01,atype02,atype03,atype04,atype05,atype06,
atype07,atype08,atype09,atype10,atype11,atype12,atype13,atype14,atype15,
atype16,atype17,atype18,atype19,atype20,atype21,atype22,atype23;
- IGESDimen_Protocol::IGESDimen_Protocol ()
+IGESDimen_Protocol::IGESDimen_Protocol()
{
- if (deja) return; deja = 1;
+ if (THE_IGESDimen_Protocol_deja)
+ {
+ return;
+ }
+
+ THE_IGESDimen_Protocol_deja = 1;
atype01 = STANDARD_TYPE(IGESDimen_AngularDimension);
atype02 = STANDARD_TYPE(IGESDimen_BasicDimension);
atype03 = STANDARD_TYPE(IGESDimen_CenterLine);
IMPLEMENT_STANDARD_RTTIEXT(IGESDraw_Protocol,IGESData_Protocol)
-static int deja = 0;
+static int THE_IGESDraw_Protocol_deja = 0;
static Handle(Standard_Type) atype01,atype02,atype03,atype04,atype05,atype06,
atype07,atype08,atype09,atype10,atype11,atype12,atype13,atype14;
- IGESDraw_Protocol::IGESDraw_Protocol ()
+IGESDraw_Protocol::IGESDraw_Protocol()
{
- if (deja) return; deja = 1;
+ if (THE_IGESDraw_Protocol_deja)
+ {
+ return;
+ }
+
+ THE_IGESDraw_Protocol_deja = 1;
atype01 = STANDARD_TYPE(IGESDraw_CircArraySubfigure);
atype02 = STANDARD_TYPE(IGESDraw_ConnectPoint);
atype03 = STANDARD_TYPE(IGESDraw_Drawing);
IMPLEMENT_STANDARD_RTTIEXT(IGESGeom_Protocol,IGESData_Protocol)
-static int deja = 0;
+static int THE_IGESGeom_Protocol_deja = 0;
static Handle(Standard_Type) atype01,atype02,atype03,atype04,atype05,atype06,
atype07,atype08,atype09,atype10,atype11,atype12,atype13,atype14,atype15,
atype16,atype17,atype18,atype19,atype20,atype21,atype22,atype23;
- IGESGeom_Protocol::IGESGeom_Protocol ()
+IGESGeom_Protocol::IGESGeom_Protocol()
{
- if (deja) return; deja = 1;
+ if (THE_IGESGeom_Protocol_deja)
+ {
+ return;
+ }
+ THE_IGESGeom_Protocol_deja = 1;
atype01 = STANDARD_TYPE(IGESGeom_BSplineCurve);
atype02 = STANDARD_TYPE(IGESGeom_BSplineSurface);
atype03 = STANDARD_TYPE(IGESGeom_Boundary);
IMPLEMENT_STANDARD_RTTIEXT(IGESGraph_Protocol,IGESData_Protocol)
-static int deja = 0;
+static int THE_IGESGraph_Protocol_deja = 0;
static Handle(Standard_Type) atype01,atype02,atype03,atype04,atype05,atype06,
atype07,atype08,atype09,atype10,atype11,atype12,atype13,atype14;
- IGESGraph_Protocol::IGESGraph_Protocol ()
+IGESGraph_Protocol::IGESGraph_Protocol()
{
- if (deja) return; deja = 1;
+ if (THE_IGESGraph_Protocol_deja)
+ {
+ return;
+ }
+ THE_IGESGraph_Protocol_deja = 1;
atype01 = STANDARD_TYPE(IGESGraph_Color);
atype02 = STANDARD_TYPE(IGESGraph_DefinitionLevel);
atype03 = STANDARD_TYPE(IGESGraph_DrawingSize);
Standard_CString unm = "";
if (!ent->Unit().IsNull()) unm = ent->Unit()->ToCString();
switch (unf) {
- case 1 : if ((strcmp(unm,"IN") == 0) || (strcmp(unm,"INCH") == 0))
- name = new TCollection_HAsciiString ("IN"); break;
- case 2 : if (strcmp(unm,"MM") == 0)
- name = new TCollection_HAsciiString ("MM"); break;
- case 3 : break; // nom libre
- case 4 : if (strcmp(unm,"FT") == 0)
- name = new TCollection_HAsciiString ("FT"); break;
- case 5 : if (strcmp(unm,"MI") == 0)
- name = new TCollection_HAsciiString ("MI"); break;
- case 6 : if (strcmp(unm,"M") == 0)
- name = new TCollection_HAsciiString ("M"); break;
- case 7 : if (strcmp(unm,"KM") == 0)
- name = new TCollection_HAsciiString ("KM"); break;
- case 8 : if (strcmp(unm,"MIL") == 0)
- name = new TCollection_HAsciiString ("MIL"); break;
- case 9 : if (strcmp(unm,"UM") == 0)
- name = new TCollection_HAsciiString ("UM"); break;
- case 10 : if (strcmp(unm,"CM") == 0)
- name = new TCollection_HAsciiString ("CM"); break;
- case 11 : if (strcmp(unm,"UIN") == 0)
- name = new TCollection_HAsciiString ("UIN"); break;
- default : break; // on ne peut rien faire ... ?
+ case 1:
+ if ((strcmp(unm,"IN") == 0) || (strcmp(unm,"INCH") == 0))
+ {
+ name = new TCollection_HAsciiString ("IN");
+ }
+ break;
+ case 2:
+ if (strcmp(unm,"MM") == 0)
+ {
+ name = new TCollection_HAsciiString ("MM");
+ }
+ break;
+ case 3:
+ break; // nom libre
+ case 4:
+ if (strcmp(unm,"FT") == 0)
+ {
+ name = new TCollection_HAsciiString ("FT");
+ }
+ break;
+ case 5:
+ if (strcmp(unm,"MI") == 0)
+ {
+ name = new TCollection_HAsciiString ("MI");
+ }
+ break;
+ case 6:
+ if (strcmp(unm,"M") == 0)
+ {
+ name = new TCollection_HAsciiString ("M");
+ }
+ break;
+ case 7:
+ if (strcmp(unm,"KM") == 0)
+ {
+ name = new TCollection_HAsciiString ("KM");
+ }
+ break;
+ case 8:
+ if (strcmp(unm,"MIL") == 0)
+ {
+ name = new TCollection_HAsciiString ("MIL");
+ }
+ break;
+ case 9:
+ if (strcmp(unm,"UM") == 0)
+ {
+ name = new TCollection_HAsciiString ("UM");
+ }
+ break;
+ case 10:
+ if (strcmp(unm,"CM") == 0)
+ {
+ name = new TCollection_HAsciiString ("CM");
+ }
+ break;
+ case 11:
+ if (strcmp(unm,"UIN") == 0)
+ {
+ name = new TCollection_HAsciiString ("UIN");
+ }
+ break;
+ default:
+ break; // on ne peut rien faire ... ?
}
res |= (!name.IsNull());
#include <stdio.h>
IMPLEMENT_STANDARD_RTTIEXT(IGESSelect_Activator,IFSelect_Activator)
-static int initActivator = 0;
+static int THE_IGESSelect_Activator_initActivator = 0;
- IGESSelect_Activator::IGESSelect_Activator ()
+IGESSelect_Activator::IGESSelect_Activator()
{
- if (initActivator) return; initActivator = 1;
+ if (THE_IGESSelect_Activator_initActivator)
+ {
+ return;
+ }
+ THE_IGESSelect_Activator_initActivator = 1;
// Add ( 0,"load");
// Add ( 0,"loadiges"); // homonyme
SetForGroup ("XSTEP-IGES");
IMPLEMENT_STANDARD_RTTIEXT(IGESSolid_Protocol,IGESData_Protocol)
-static int deja = 0;
+static int THE_IGESSolid_Protocol_deja = 0;
static Handle(Standard_Type) atype01,atype02,atype03,atype04,atype05,atype06,
atype07,atype08,atype09,atype10,atype11,atype12,atype13,atype14,atype15,
atype16,atype17,atype18,atype19,atype20,atype21,atype22,atype23,atype24;
- IGESSolid_Protocol::IGESSolid_Protocol ()
+IGESSolid_Protocol::IGESSolid_Protocol()
{
- if (deja) return; deja = 1;
+ if (THE_IGESSolid_Protocol_deja)
+ {
+ return;
+ }
+ THE_IGESSolid_Protocol_deja = 1;
atype01 = STANDARD_TYPE(IGESSolid_Block);
atype02 = STANDARD_TYPE(IGESSolid_BooleanTree);
atype03 = STANDARD_TYPE(IGESSolid_ConeFrustum);
Standard_Integer i;
for (i = 0; i < 4; i++)
+ {
if (Periods[i] != 0.)
{
if (Abs(NewParams[i] - OldParams[i]) >= 0.5*Periods[i])
NewParams[i] -= Periods[i];
}
}
+ }
- NewPoint.SetValue(NewParams[0], NewParams[1], NewParams[2], NewParams[3]);
- return NewPoint;
+ NewPoint.SetValue(NewParams[0], NewParams[1], NewParams[2], NewParams[3]);
+ return NewPoint;
}
//==================================================================================
#include <TColStd_SequenceOfAsciiString.hxx>
#include <NCollection_Vector.hxx>
-static int init = 0;
+static int THE_Interface_Category_init = 0;
static Standard_CString unspec = "unspecified";
static Standard_Mutex gMapTypesMutex;
gMapTypesMutex.Lock();
if ( !gMapTypesInit )
{
- if (init) return; init = 1;
- init = Interface_Category::AddCategory ("Shape");
- init = Interface_Category::AddCategory ("Drawing");
- init = Interface_Category::AddCategory ("Structure");
- init = Interface_Category::AddCategory ("Description");
- init = Interface_Category::AddCategory ("Auxiliary");
- init = Interface_Category::AddCategory ("Professional");
- init = Interface_Category::AddCategory ("FEA");
- init = Interface_Category::AddCategory ("Kinematics");
- init = Interface_Category::AddCategory ("Piping");
+ if (THE_Interface_Category_init)
+ {
+ return;
+ }
+
+ THE_Interface_Category_init = 1;
+ Interface_Category::AddCategory ("Shape");
+ Interface_Category::AddCategory ("Drawing");
+ Interface_Category::AddCategory ("Structure");
+ Interface_Category::AddCategory ("Description");
+ Interface_Category::AddCategory ("Auxiliary");
+ Interface_Category::AddCategory ("Professional");
+ Interface_Category::AddCategory ("FEA");
+ Interface_Category::AddCategory ("Kinematics");
+ Interface_Category::AddCategory ("Piping");
gMapTypesInit = Standard_True;
}
//=======================================================================
//function : Complies
-//purpose :
+//purpose :
//=======================================================================
Standard_Boolean Interface_CheckIterator::Complies
(const Interface_CheckStatus stat) const
{
- Standard_Boolean res = Standard_False;
- if (stat == Interface_CheckNoFail) res = Standard_True;
- Standard_Integer i, nb = thelist->Length();
- for (i = 1; i <= nb; i ++) {
+ Standard_Boolean res = (stat == Interface_CheckNoFail);
+ Standard_Integer nb = thelist->Length();
+ for (Standard_Integer i = 1; i <= nb; ++i)
+ {
const Handle(Interface_Check) ach = thelist->Value(i);
Standard_Integer nbf = ach->NbFails(), nbw = ach->NbWarnings();
- switch (stat) {
- case Interface_CheckOK : if (nbf + nbw > 0) return Standard_False; break;
- case Interface_CheckWarning : if (nbf > 0) return Standard_False;
- if (nbw > 0) res = Standard_True; break;
- case Interface_CheckFail : if (nbf > 0) return Standard_True; break;
- case Interface_CheckAny : return Standard_True;
- case Interface_CheckMessage : if (nbf + nbw > 0) return Standard_True; break;
- case Interface_CheckNoFail : if (nbf > 0) return Standard_False; break;
- default : break;
+ switch (stat)
+ {
+ case Interface_CheckOK:
+ {
+ if (nbf + nbw > 0)
+ {
+ return Standard_False;
+ }
+ break;
+ }
+ case Interface_CheckWarning:
+ {
+ if (nbf > 0)
+ {
+ return Standard_False;
+ }
+ if (nbw > 0)
+ {
+ res = Standard_True;
+ }
+ break;
+ }
+ case Interface_CheckFail:
+ {
+ if (nbf > 0)
+ {
+ return Standard_True;
+ }
+ break;
+ }
+ case Interface_CheckAny:
+ {
+ return Standard_True;
+ }
+ case Interface_CheckMessage:
+ {
+ if (nbf + nbw > 0)
+ {
+ return Standard_True;
+ }
+ break;
+ }
+ case Interface_CheckNoFail:
+ {
+ if (nbf > 0)
+ {
+ return Standard_False;
+ }
+ break;
+ }
+ default:
+ break;
}
}
return res;
static Standard_Integer thenp0 = -1;
-Interface_FileReaderData::Interface_FileReaderData (const Standard_Integer nbr,
+Interface_FileReaderData::Interface_FileReaderData (const Standard_Integer nbr,
const Standard_Integer npar)
- : therrload (0), thenumpar (0,nbr), theents (0,nbr)
+ : therrload (0), thenumpar (0,nbr), theents (0,nbr)
{
theparams = new Interface_ParamSet (npar);
thenumpar.Init(0);
const Handle(Standard_Transient)& Interface_FileReaderData::BoundEntity
(const Standard_Integer num) const
// { return theents(num); }
-{
+{
if (num >= theents.Lower() && num <= theents.Upper()) {
return theents(num);
}
OCC_CATCH_SIGNALS
Handle(Standard_Transient) temp = theents.Value(num);
}
- ////sln 21.01.2002 OCC133: Exception handling
+ ////sln 21.01.2002 OCC133: Exception handling
// catch (Standard_OutOfRange) {
// cout<<" Catch of sln"<<endl;
-
+
// return dummy;
// }
catch (Standard_Failure) {
-
+
// some work-around, the best would be to modify CDL to
// return "Handle(Standard_Transient)" not "const Handle(Standard_Transient)&"
static Handle(Standard_Transient) dummy;
}
//cout<<" Normal"<<endl;
if (theents.Value(num).IsImmutable()) cout << "IMMUTABLE:"<<num<<endl;
- return theents(num);
+ return theents(num);
}
*/
prem = MAXCHIF + 1; point = -1; // ligne[MAXCHIF+1] = '\0'; fin forcee
/* Analyse de la ligne (reputee representer un Flottant) */
- for (i = 0; ; i ++) { // critere d arret : cf '\0'
+ for (i = 0; ; i ++) // critere d arret : cf '\0'
+ {
const char& car = ligne[i];
/* critere d arret : ne pas l oublier, mais eviter de freiner le traitement
DONC, une fois en fin, plus une fois pour 1er passage
if (car == '\0')
{ if (point < 0) { point = i; jx = point - prem; }; break; } */
- if (prem > MAXCHIF) {
+ if (prem > MAXCHIF)
+ {
if (car == '0') continue;
if (car == '.') { point = i; continue; }
if (car == '+') continue;
if (car == '-') { moins = 1; continue; }
if (car == '\0')
- { if (point < 0) { point = i; jx = point - prem; }; break; }
- if (car < 33) continue;
+ {
+ if (point < 0)
+ {
+ point = i;
+ jx = point - prem;
+ }
+ break;
+ }
+ if (car < 33)
+ {
+ continue;
+ }
prem = i;
- if (point >= 0) jx = point - prem + 1;
+ if (point >= 0)
+ {
+ jx = point - prem + 1;
+ }
}
if (car > 48 && car <= 57)
- { chiffre[j] = car - 48; jj = ++j; continue; } // j++ puis jj = j
+ {
+ chiffre[j] = car - 48;
+ jj = ++j; // j++ puis jj = j
+ continue;
+ }
if (car == '0') { chiffre[j] = 0; j ++; continue; }
if (car == '.') { point = i; jx = point - prem; continue; }
if ((car & 94) == 68) { // prend : e E d D
je = i; exp = atoi(&ligne[i+1]); jx += exp;
- if (exp < -100 || exp > 100) grexp = 1; break;
+ if (exp < -100 || exp > 100)
+ {
+ grexp = 1;
+ }
+ break;
}
if (car == '\0')
- { if (point < 0) { point = i; jx = point - prem; }; break; }
+ {
+ if (point < 0)
+ {
+ point = i;
+ jx = point - prem;
+ }
+ break;
+ }
}
/* Interpretation : on decale le Point Decimal selon l Exposant
#include "../XSMessage/XSMessage_XSTEP_us.pxx"
-static int deja = 0;
+static int THE_Interface_Static_deja = 0;
void Interface_Static::Standards ()
{
- if (deja) return; deja = 1;
+ if (THE_Interface_Static_deja)
+ {
+ return;
+ }
+
+ THE_Interface_Static_deja = 1;
// read precision
//#74 rln 10.03.99 S4135: new values and default value
Seq.Append(gp_Pnt(LastV, RV2, 3));
Standard_Integer i, j;
for(i = 1; i <= 3; i++)
+ {
for(j = 1; j <= 4-i; j++)
- if(Seq(j).Y() < Seq(j+1).Y())
+ {
+ if(Seq(j).Y() < Seq(j+1).Y())
{
gp_Pnt swp;
swp = Seq.Value(j+1);
Seq.ChangeValue(j+1) = Seq.Value(j);
Seq.ChangeValue(j) = swp;
}
+ }
+ }
- t = Sol.X();
- t1 = Min(Sol.X(), NotSol);
- t2 = Max(Sol.X(), NotSol);
+ t = Sol.X ();
+ t1 = Min (Sol.X (), NotSol);
+ t2 = Max (Sol.X (), NotSol);
- Standard_Boolean isDone = Standard_False;
- while (!Seq.IsEmpty())
- {
- gp_Pnt P;
- P = Seq.Last();
- Seq.Remove(Seq.Length());
- ProjLib_PrjResolve aPrjPS(Curve->Curve(),
- Surface->Surface(),
- Standard_Integer(P.Z()));
- if(Standard_Integer(P.Z()) == 2)
- {
- aPrjPS.Perform(t, P.X(), V0, gp_Pnt2d(Tol, TolV),
- gp_Pnt2d(t1, Surface->FirstVParameter()),
- gp_Pnt2d(t2, Surface->LastVParameter()), FuncTol);
- if(!aPrjPS.IsDone()) continue;
- POnS = aPrjPS.Solution();
- Sol = gp_Pnt(POnS.X(), P.X(), POnS.Y());
- isDone = Standard_True;
- break;
- }
- else
- {
- aPrjPS.Perform(t, U0, P.X(), gp_Pnt2d(Tol, TolU),
- gp_Pnt2d(t1, Surface->FirstUParameter()),
- gp_Pnt2d(t2, Surface->LastUParameter()), FuncTol);
- if(!aPrjPS.IsDone()) continue;
- POnS = aPrjPS.Solution();
- Sol = gp_Pnt(POnS.X(), POnS.Y(), P.X());
- isDone = Standard_True;
- break;
- }
- }
+ Standard_Boolean isDone = Standard_False;
+ while (!Seq.IsEmpty ())
+ {
+ gp_Pnt P;
+ P = Seq.Last ();
+ Seq.Remove (Seq.Length ());
+ ProjLib_PrjResolve aPrjPS (Curve->Curve (),
+ Surface->Surface (),
+ Standard_Integer (P.Z ()));
+ if (Standard_Integer (P.Z ()) == 2)
+ {
+ aPrjPS.Perform (t, P.X (), V0, gp_Pnt2d (Tol, TolV),
+ gp_Pnt2d (t1, Surface->FirstVParameter ()),
+ gp_Pnt2d (t2, Surface->LastVParameter ()), FuncTol);
+ if (!aPrjPS.IsDone ()) continue;
+ POnS = aPrjPS.Solution ();
+ Sol = gp_Pnt (POnS.X (), P.X (), POnS.Y ());
+ isDone = Standard_True;
+ break;
+ }
+ else
+ {
+ aPrjPS.Perform (t, U0, P.X (), gp_Pnt2d (Tol, TolU),
+ gp_Pnt2d (t1, Surface->FirstUParameter ()),
+ gp_Pnt2d (t2, Surface->LastUParameter ()), FuncTol);
+ if (!aPrjPS.IsDone ()) continue;
+ POnS = aPrjPS.Solution ();
+ Sol = gp_Pnt (POnS.X (), POnS.Y (), P.X ());
+ isDone = Standard_True;
+ break;
+ }
+ }
- return isDone;
+ return isDone;
}
//=======================================================================
// 2. Removing common parts of bounds
for(i = 1; i < myNbCurves; i++)
{
- if(mySequence->Value(i)->Value(mySequence->Value(i)->Length()).X() >=
+ if(mySequence->Value(i)->Value(mySequence->Value(i)->Length()).X() >=
mySequence->Value(i+1)->Value(1).X())
+ {
mySequence->ChangeValue(i+1)->ChangeValue(1).SetX(mySequence->Value(i)->Value(mySequence->Value(i)->Length()).X() + 1.e-12);
+ }
}
// 3. Computation of the maximum distance from each part of curve to surface
myMaxDistance = new TColStd_HArray1OfReal(1, myNbCurves);
myMaxDistance->Init(0);
for(i = 1; i <= myNbCurves; i++)
- for(j = 1; j <= mySequence->Value(i)->Length(); j++)
+ {
+ for(j = 1; j <= mySequence->Value(i)->Length(); j++)
{
gp_Pnt POnC, POnS, aTriple;
Standard_Real Distance;
mySurface->D0(aTriple.Y(), aTriple.Z(), POnS);
Distance = POnC.Distance(POnS);
if (myMaxDistance->Value(i) < Distance)
+ {
myMaxDistance->ChangeValue(i) = Distance;
- }
-
+ }
+ }
+ }
- // 4. Check the projection to be a single point
+ // 4. Check the projection to be a single point
- gp_Pnt2d Pmoy, Pcurr, P;
- Standard_Real AveU, AveV;
- mySnglPnts = new TColStd_HArray1OfBoolean(1, myNbCurves);
- for(i = 1; i <= myNbCurves; i++) mySnglPnts->SetValue(i, Standard_True);
+ gp_Pnt2d Pmoy, Pcurr, P;
+ Standard_Real AveU, AveV;
+ mySnglPnts = new TColStd_HArray1OfBoolean(1, myNbCurves);
+ mySnglPnts->Init (Standard_True);
- for(i = 1; i <= myNbCurves; i++)
- {
- //compute an average U and V
+ for(i = 1; i <= myNbCurves; i++)
+ {
+ //compute an average U and V
- for(j = 1, AveU = 0., AveV = 0.; j <= mySequence->Value(i)->Length(); j++)
- {
- AveU += mySequence->Value(i)->Value(j).Y();
- AveV += mySequence->Value(i)->Value(j).Z();
- }
- AveU /= mySequence->Value(i)->Length();
- AveV /= mySequence->Value(i)->Length();
+ for(j = 1, AveU = 0., AveV = 0.; j <= mySequence->Value(i)->Length(); j++)
+ {
+ AveU += mySequence->Value(i)->Value(j).Y();
+ AveV += mySequence->Value(i)->Value(j).Z();
+ }
+ AveU /= mySequence->Value(i)->Length();
+ AveV /= mySequence->Value(i)->Length();
- Pmoy.SetCoord(AveU,AveV);
- for(j = 1; j <= mySequence->Value(i)->Length(); j++)
+ Pmoy.SetCoord(AveU,AveV);
+ for(j = 1; j <= mySequence->Value(i)->Length(); j++)
+ {
+ Pcurr =
+ gp_Pnt2d(mySequence->Value(i)->Value(j).Y(), mySequence->Value(i)->Value(j).Z());
+ if (Pcurr.Distance(Pmoy) > ((myTolU < myTolV) ? myTolV : myTolU))
{
- Pcurr =
- gp_Pnt2d(mySequence->Value(i)->Value(j).Y(), mySequence->Value(i)->Value(j).Z());
- if (Pcurr.Distance(Pmoy) > ((myTolU < myTolV) ? myTolV : myTolU))
- {
- mySnglPnts->SetValue(i, Standard_False);
- break;
- }
+ mySnglPnts->SetValue(i, Standard_False);
+ break;
}
}
+ }
- // 5. Check the projection to be an isoparametric curve of the surface
+ // 5. Check the projection to be an isoparametric curve of the surface
- myUIso = new TColStd_HArray1OfBoolean(1, myNbCurves);
- for(i = 1; i <= myNbCurves; i++) myUIso->SetValue(i, Standard_True);
+ myUIso = new TColStd_HArray1OfBoolean(1, myNbCurves);
+ myUIso->Init (Standard_True);
- myVIso = new TColStd_HArray1OfBoolean(1, myNbCurves);
- for(i = 1; i <= myNbCurves; i++) myVIso->SetValue(i, Standard_True);
+ myVIso = new TColStd_HArray1OfBoolean(1, myNbCurves);
+ myVIso->Init (Standard_True);
- for(i = 1; i <= myNbCurves; i++) {
- if (IsSinglePnt(i, P)|| mySequence->Value(i)->Length() <=2) {
- myUIso->SetValue(i, Standard_False);
- myVIso->SetValue(i, Standard_False);
- continue;
- }
+ for(i = 1; i <= myNbCurves; i++) {
+ if (IsSinglePnt(i, P)|| mySequence->Value(i)->Length() <=2) {
+ myUIso->SetValue(i, Standard_False);
+ myVIso->SetValue(i, Standard_False);
+ continue;
+ }
- // new test for isoparametrics
+ // new test for isoparametrics
- if ( mySequence->Value(i)->Length() > 2) {
- //compute an average U and V
+ if ( mySequence->Value(i)->Length() > 2) {
+ //compute an average U and V
- for(j = 1, AveU = 0., AveV = 0.; j <= mySequence->Value(i)->Length(); j++) {
- AveU += mySequence->Value(i)->Value(j).Y();
- AveV += mySequence->Value(i)->Value(j).Z();
- }
- AveU /= mySequence->Value(i)->Length();
- AveV /= mySequence->Value(i)->Length();
+ for(j = 1, AveU = 0., AveV = 0.; j <= mySequence->Value(i)->Length(); j++) {
+ AveU += mySequence->Value(i)->Value(j).Y();
+ AveV += mySequence->Value(i)->Value(j).Z();
+ }
+ AveU /= mySequence->Value(i)->Length();
+ AveV /= mySequence->Value(i)->Length();
- // is i-part U-isoparametric ?
- for(j = 1; j <= mySequence->Value(i)->Length(); j++)
+ // is i-part U-isoparametric ?
+ for(j = 1; j <= mySequence->Value(i)->Length(); j++)
+ {
+ if(Abs(mySequence->Value(i)->Value(j).Y() - AveU) > myTolU)
{
- if(Abs(mySequence->Value(i)->Value(j).Y() - AveU) > myTolU)
- {
- myUIso->SetValue(i, Standard_False);
- break;
- }
+ myUIso->SetValue(i, Standard_False);
+ break;
}
+ }
- // is i-part V-isoparametric ?
- for(j = 1; j <= mySequence->Value(i)->Length(); j++)
+ // is i-part V-isoparametric ?
+ for(j = 1; j <= mySequence->Value(i)->Length(); j++)
+ {
+ if(Abs(mySequence->Value(i)->Value(j).Z() - AveV) > myTolV)
{
- if(Abs(mySequence->Value(i)->Value(j).Z() - AveV) > myTolV)
- {
- myVIso->SetValue(i, Standard_False);
- break;
- }
+ myVIso->SetValue(i, Standard_False);
+ break;
}
- //
}
+ //
}
+ }
}
//=======================================================================
//function : Load
// proccessing projection bounds
BArr = new TColStd_HArray1OfReal(1, 2*myNbCurves);
for(i = 1; i <= myNbCurves; i++)
+ {
Bounds(i, BArr->ChangeValue(2*i - 1), BArr->ChangeValue(2*i));
+ }
// proccessing curve discontinuities
if(NbIntCur > 1) {
CArr = new TColStd_HArray1OfReal(1, NbIntCur - 1);
for(i = 1; i <= CArr->Length(); i++)
+ {
CArr->ChangeValue(i) = CutPntsT(i + 1);
+ }
}
// proccessing U-surface discontinuities
for(k = 2; k <= NbIntSurU; k++) {
// cout<<"CutPntsU("<<k<<") = "<<CutPntsU(k)<<endl;
for(i = 1; i <= myNbCurves; i++)
- for(j = 1; j < mySequence->Value(i)->Length(); j++) {
+ {
+ for(j = 1; j < mySequence->Value(i)->Length(); j++)
+ {
Ul = mySequence->Value(i)->Value(j).Y();
Ur = mySequence->Value(i)->Value(j + 1).Y();
}
}
}
+ }
}
for(i = 2; i <= TUdisc.Length(); i++)
+ {
if(TUdisc(i) - TUdisc(i-1) < Precision::PConfusion())
+ {
TUdisc.Remove(i--);
+ }
+ }
- if(TUdisc.Length())
+ if(TUdisc.Length())
{
UArr = new TColStd_HArray1OfReal(1, TUdisc.Length());
for(i = 1; i <= UArr->Length(); i++)
+ {
UArr->ChangeValue(i) = TUdisc(i);
+ }
}
// proccessing V-surface discontinuities
TColStd_SequenceOfReal TVdisc;
for(k = 2; k <= NbIntSurV; k++)
- for(i = 1; i <= myNbCurves; i++)
+ {
+ for(i = 1; i <= myNbCurves; i++)
{
// cout<<"CutPntsV("<<k<<") = "<<CutPntsV(k)<<endl;
for(j = 1; j < mySequence->Value(i)->Length(); j++) {
}
}
}
- for(i = 2; i <= TVdisc.Length(); i++)
- if(TVdisc(i) - TVdisc(i-1) < Precision::PConfusion())
- TVdisc.Remove(i--);
+ }
- if(TVdisc.Length())
+ for(i = 2; i <= TVdisc.Length(); i++)
+ {
+ if(TVdisc(i) - TVdisc(i-1) < Precision::PConfusion())
{
- VArr = new TColStd_HArray1OfReal(1, TVdisc.Length());
- for(i = 1; i <= VArr->Length(); i++)
- VArr->ChangeValue(i) = TVdisc(i);
+ TVdisc.Remove(i--);
}
+ }
- // fusion
- TColStd_SequenceOfReal Fusion;
- if(!CArr.IsNull())
+ if(TVdisc.Length())
+ {
+ VArr = new TColStd_HArray1OfReal(1, TVdisc.Length());
+ for(i = 1; i <= VArr->Length(); i++)
{
- GeomLib::FuseIntervals(BArr->ChangeArray1(),
- CArr->ChangeArray1(),
- Fusion, Precision::PConfusion());
- BArr = new TColStd_HArray1OfReal(1, Fusion.Length());
- for(i = 1; i <= BArr->Length(); i++)
- BArr->ChangeValue(i) = Fusion(i);
- Fusion.Clear();
+ VArr->ChangeValue(i) = TVdisc(i);
}
+ }
- if(!UArr.IsNull())
+ // fusion
+ TColStd_SequenceOfReal Fusion;
+ if(!CArr.IsNull())
+ {
+ GeomLib::FuseIntervals(BArr->ChangeArray1(),
+ CArr->ChangeArray1(),
+ Fusion, Precision::PConfusion());
+ BArr = new TColStd_HArray1OfReal(1, Fusion.Length());
+ for(i = 1; i <= BArr->Length(); i++)
{
- GeomLib::FuseIntervals(BArr->ChangeArray1(),
- UArr->ChangeArray1(),
- Fusion, Precision::PConfusion());
- BArr = new TColStd_HArray1OfReal(1, Fusion.Length());
- for(i = 1; i <= BArr->Length(); i++)
- BArr->ChangeValue(i) = Fusion(i);
- Fusion.Clear();
+ BArr->ChangeValue(i) = Fusion(i);
}
+ Fusion.Clear();
+ }
- if(!VArr.IsNull())
+ if(!UArr.IsNull())
+ {
+ GeomLib::FuseIntervals(BArr->ChangeArray1(),
+ UArr->ChangeArray1(),
+ Fusion, Precision::PConfusion());
+ BArr = new TColStd_HArray1OfReal(1, Fusion.Length());
+ for(i = 1; i <= BArr->Length(); i++)
{
- GeomLib::FuseIntervals(BArr->ChangeArray1(),
- VArr->ChangeArray1(),
- Fusion, Precision::PConfusion());
- BArr = new TColStd_HArray1OfReal(1, Fusion.Length());
- for(i = 1; i <= BArr->Length(); i++)
- BArr->ChangeValue(i) = Fusion(i);
+ BArr->ChangeValue(i) = Fusion(i);
}
+ Fusion.Clear();
+ }
- const_cast<ProjLib_CompProjectedCurve*>(this)->myTabInt = new TColStd_HArray1OfReal(1, BArr->Length());
+ if(!VArr.IsNull())
+ {
+ GeomLib::FuseIntervals(BArr->ChangeArray1(),
+ VArr->ChangeArray1(),
+ Fusion, Precision::PConfusion());
+ BArr = new TColStd_HArray1OfReal(1, Fusion.Length());
for(i = 1; i <= BArr->Length(); i++)
- myTabInt->ChangeValue(i) = BArr->Value(i);
+ {
+ BArr->ChangeValue(i) = Fusion(i);
+ }
+ }
+ const_cast<ProjLib_CompProjectedCurve*>(this)->myTabInt = new TColStd_HArray1OfReal(1, BArr->Length());
+ for(i = 1; i <= BArr->Length(); i++)
+ {
+ myTabInt->ChangeValue(i) = BArr->Value(i);
+ }
}
//=======================================================================
static Standard_Integer OCC7141 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{
- int nCount = 10;
-
- if (argc > 3)
- {
- di << "Usage : " << argv[0] << " [nCount] path\n";
- return 1;
- }
+ if (argc != 2 && argc != 3)
+ {
+ std::cout << "Usage : " << argv[0] << " [nCount] path\n";
+ return 1;
+ }
- if (argc > 2)
- nCount = Draw::Atoi(argv[1]);
- TCollection_AsciiString aFilePath = argv[2];
+ int nCount = (argc > 2 ? Draw::Atoi(argv[1]) : 10);
+ TCollection_AsciiString aFilePath (argv[argc > 2 ? 2 : 1]);
STEPCAFControl_Writer writer;
Handle(TDocStd_Document) document;
document = new TDocStd_Document("Pace Test-StepExporter-");
#include <StepAP214_Protocol.hxx>
#include <StepData_WriterLib.hxx>
-static int init = 0;
+static int THE_RWStepAP214_init = 0;
void RWStepAP214::Init()
- {
- if (init) return; init = 1;
- RWHeaderSection::Init();
- Handle(StepAP214_Protocol) proto = StepAP214::Protocol();
- Interface_GeneralLib::SetGlobal (new RWStepAP214_GeneralModule,proto);
- Interface_ReaderLib::SetGlobal (new RWStepAP214_ReadWriteModule,proto);
- StepData_WriterLib::SetGlobal (new RWStepAP214_ReadWriteModule,proto);
- }
+{
+ if (THE_RWStepAP214_init)
+ {
+ return;
+ }
+ THE_RWStepAP214_init = 1;
+ RWHeaderSection::Init();
+ Handle(StepAP214_Protocol) proto = StepAP214::Protocol();
+ Interface_GeneralLib::SetGlobal (new RWStepAP214_GeneralModule,proto);
+ Interface_ReaderLib::SetGlobal (new RWStepAP214_ReadWriteModule,proto);
+ StepData_WriterLib::SetGlobal (new RWStepAP214_ReadWriteModule,proto);
+}
TopoDS_Shape aShape = XCAFDoc_ShapeTool::GetShape(aSecondShapeL.Value(shIt));
Handle(StepRepr_ShapeAspect) aSA = WriteShapeAspect(WS, aDimensionL, aShape, dummyRC, dummyGISU);
if (aCSA.IsNull() && !aSA.IsNull())
+ {
aCSA = new StepRepr_CompositeShapeAspect();
- aCSA->Init(aSA->Name(), aSA->Description(), aSA->OfShape(), aSA->ProductDefinitional());
+ }
+ aCSA->Init(aSA->Name(), aSA->Description(), aSA->OfShape(), aSA->ProductDefinitional());
if (!aSA.IsNull()) {
Handle(StepRepr_ShapeAspectRelationship) aSAR = new StepRepr_ShapeAspectRelationship();
aSAR->Init(new TCollection_HAsciiString(), Standard_False, new TCollection_HAsciiString(), aCSA, aSA);
// On va tacher de calculer les positions et les comparer
gp_Pnt2d fuv,luv;
if (Edge.Orientation() == TopAbs_FORWARD)
- { TopExp::Vertices (Edge,fv,lv);
- if (ia2d) BRep_Tool::UVPoints (Edge,Face,fuv,luv); }
+ {
+ TopExp::Vertices (Edge, fv, lv);
+ if (ia2d) BRep_Tool::UVPoints (Edge, Face, fuv, luv);
+ }
else
- { TopExp::Vertices (Edge,lv,fv);
- if (ia2d) BRep_Tool::UVPoints (Edge,Face,luv,fuv); }
+ {
+ TopExp::Vertices (Edge, lv, fv);
+ if (ia2d) BRep_Tool::UVPoints (Edge, Face, luv, fuv);
+ }
gp_Pnt fp = BRep_Tool::Pnt (fv);
gp_Pnt lp = BRep_Tool::Pnt (lv);
gp_Pnt fxyz, lxyz;
- if (ia2d) {
+ if (ia2d)
+ {
surface->D0 (fuv.X(),fuv.Y(),fxyz);
surface->D0 (luv.X(),luv.Y(),lxyz);
df3d = fp.Distance (fxyz); maxp3d = Max (maxp3d,df3d);
dl3d = lp.Distance (lxyz); maxp3d = Max (maxp3d,dl3d);
- if (nbe > 1) duv = finuv.Distance (fuv); maxuv = Max (maxuv, duv);
+ if (nbe > 1)
+ {
+ duv = finuv.Distance (fuv);
+ maxuv = Max (maxuv, duv);
+ }
// et les min-max
u1 = Min (fuv.X(),luv.X()); u2 = Max (fuv.X(),luv.X());
v1 = Min (fuv.Y(),luv.Y()); v2 = Max (fuv.Y(),luv.Y());
void SWDRAW_ShapeAnalysis::InitCommands(Draw_Interpretor& theCommands)
{
static Standard_Integer initactor = 0;
- if (initactor) return; initactor = 1;
-
+ if (initactor)
+ {
+ return;
+ }
+ initactor = 1;
+
Standard_CString g = SWDRAW::GroupName();
theCommands.Add ("tolerance","shape [tolmin tolmax:real]", __FILE__,tolerance,g);
void SWDRAW_ShapeCustom::InitCommands(Draw_Interpretor& theCommands)
{
static Standard_Integer initactor = 0;
- if (initactor) return; initactor = 1;
+ if (initactor)
+ {
+ return;
+ }
+ initactor = 1;
Standard_CString g = SWDRAW::GroupName();
case 'e' : tse = TopAbs_EDGE; break;
case 'w' : tse = TopAbs_WIRE; break;
case 'f' : tse = TopAbs_FACE; break;
- case 's' : tse = TopAbs_SHELL;
- if (argv[3][1] == 'o') tse = TopAbs_SOLID; break;
+ case 's' : tse = (argv[3][1] == 'o' ? TopAbs_SOLID : TopAbs_SHELL);
+ break;
default : break;
}
Standard_Boolean modexp = Standard_False;
void SWDRAW_ShapeExtend::InitCommands(Draw_Interpretor& theCommands)
{
static Standard_Integer initactor = 0;
- if (initactor) return; initactor = 1;
-
+ if (initactor)
+ {
+ return;
+ }
+ initactor = 1;
+
Standard_CString g = SWDRAW::GroupName();
theCommands.Add ("sortcompound","shape_entree shape_result type=v-e-w-f-s-so [mode=n-e-c-x]",
__FILE__,sortcompound,g);
void SWDRAW_ShapeFix::InitCommands(Draw_Interpretor& theCommands)
{
static Standard_Integer initactor = 0;
- if (initactor) return; initactor = 1;
+ if (initactor)
+ {
+ return;
+ }
+ initactor = 1;
Standard_CString g = SWDRAW::GroupName();
void SWDRAW_ShapeProcess::InitCommands(Draw_Interpretor& theCommands)
{
static Standard_Boolean initactor = 0;
- if (initactor) return; initactor = 1;
+ if (initactor)
+ {
+ return;
+ }
+ initactor = 1;
ShapeProcess_OperLibrary::Init();
// ## DECLARATIONS ##
// ########################################
-static int initactor = 0;
-
void SWDRAW_ShapeTool::InitCommands (Draw_Interpretor& theCommands)
{
- if (initactor) return; initactor = 1;
+ static int initactor = 0;
+ if (initactor)
+ {
+ return;
+ }
+ initactor = 1;
const char* g;
g = "DE: old";
void SWDRAW_ShapeUpgrade::InitCommands(Draw_Interpretor& theCommands)
{
static Standard_Integer initactor = 0;
- if (initactor) return; initactor = 1;
+ if (initactor)
+ {
+ return;
+ }
+ initactor = 1;
Standard_CString g = SWDRAW::GroupName(); // "Tests of DivideTool";
Standard_Real x,y,z;
p.Coord (x,y,z);
if (nb < 1) { minx = maxx = x; miny = maxy = y; minz = maxz = z; }
- else {
- if (minx > x) minx = x; if (maxx < x) maxx = x;
- if (miny > y) miny = y; if (maxy < y) maxy = y;
- if (minz > z) minz = z; if (maxz < z) maxz = z;
+ else
+ {
+ if (minx > x) minx = x;
+ if (maxx < x) maxx = x;
+ if (miny > y) miny = y;
+ if (maxy < y) maxy = y;
+ if (minz > z) minz = z;
+ if (maxz < z) maxz = z;
}
nb ++;
}
for( ; i < 4; i +=3)
{
Standard_Integer j;
- for ( j=0; j < myNbCashe; j++ )
+ for (j = 0; j < myNbCashe; ++j)
+ {
if ( myCashe3d[j].SquareDistance (aP[i] ) < aTol2)
{
- aP2d[i] = mySurf->NextValueOfUV (myCashe2d[j], aP[i], theTol,
- theTol);
+ aP2d[i] = mySurf->NextValueOfUV (myCashe2d[j], aP[i], theTol, theTol);
aSavedPointNum = i;
aSavedPoint = myCashe2d[j];
if (i == 0)
isFromCashe = Standard_True;
break;
}
- if ( j >= myNbCashe )
- aP2d[i] = mySurf->ValueOfUV(aP[i], theTol);
+ }
- Standard_Real aDist = mySurf->Gap();
- Standard_Real aCurDist = aDist * aDist;
- if( aTol2 < aDist * aDist)
- aTol2 = aCurDist;
+ if (j >= myNbCashe)
+ {
+ aP2d[i] = mySurf->ValueOfUV(aP[i], theTol);
+ }
+
+ Standard_Real aDist = mySurf->Gap();
+ Standard_Real aCurDist = aDist * aDist;
+ if (aTol2 < aDist * aDist)
+ {
+ aTol2 = aCurDist;
+ }
}
if ( isPeriodicU || isPeriodicV )
for(i = 1; i < 3; i++)
{
Standard_Integer j;
- for ( j=0; j < myNbCashe; j++ )
+ for (j = 0; j < myNbCashe; ++j)
+ {
if ( myCashe3d[j].SquareDistance (aP[i] ) < aTol2)
{
aP2d[i] = mySurf->NextValueOfUV (myCashe2d[j], aP[i], theTol, theTol);
aSavedPoint = myCashe2d[j];
break;
}
- if ( j >= myNbCashe )
- aP2d[i] = mySurf->ValueOfUV(aP[i], theTol);
+ }
+
+ if (j >= myNbCashe)
+ {
+ aP2d[i] = mySurf->ValueOfUV(aP[i], theTol);
+ }
- Standard_Real aDist = mySurf->Gap();
- Standard_Real aCurDist = aDist * aDist;
- if( aTol2 < aDist * aDist)
- aTol2 = aCurDist;
+ Standard_Real aDist = mySurf->Gap();
+ Standard_Real aCurDist = aDist * aDist;
+ if (aTol2 < aDist * aDist)
+ {
+ aTol2 = aCurDist;
+ }
}
if (isPeriodicU)
{
//:q9 abv 23 Mar 99: use cashe as 1st approach
Standard_Integer j; // svv #1
- for ( j=0; j < myNbCashe; j++ )
+ for (j = 0; j < myNbCashe; ++j)
+ {
if ( myCashe3d[j].SquareDistance ( p3d ) < myPreci*myPreci )
{
- p2d = mySurf->NextValueOfUV (myCashe2d[j], p3d, myPreci,
- Precision::Confusion()+gap);
- if (i == 1) {
+ p2d = mySurf->NextValueOfUV (myCashe2d[j], p3d, myPreci, Precision::Confusion()+gap);
+ if (i == 1)
+ {
isFromCashe = Standard_True;
aSavedPoint = myCashe2d[j];
}
break;
}
- if ( j >= myNbCashe ) p2d = mySurf->ValueOfUV(p3d, myPreci);
+ }
+ if (j >= myNbCashe)
+ {
+ p2d = mySurf->ValueOfUV(p3d, myPreci);
+ }
}
}
else {
else if ( ! myFace.IsNull() ) {
B.UpdateEdge ( newEdge, theNewPCurve1, myFace, 0. );
}
-
+
if(!theNewCurve3d.IsNull())
sbe.SetRange3d(newEdge,f3d,l3d);
if(!theNewPCurve1.IsNull())
+ {
B.Range ( newEdge, myFace, f2d, l2d);
+ }
if((!wasSR || !srNew)&&!BRep_Tool::Degenerated(newEdge) )
+ {
B.SameRange(newEdge, Standard_False);
+ }
- //addition NM vertices to new edges
- Standard_Real afpar = (myEdgeDivide->HasCurve3d() ? f3d : f2d);
-
- Standard_Real alpar = (myEdgeDivide->HasCurve3d() ? l3d: l2d);
- Standard_Integer n =1;
- for( ; n <= aSeqParNM.Length(); n++) {
- Standard_Real apar = aSeqParNM.Value(n);
- TopoDS_Vertex aVold = TopoDS::Vertex(aSeqNMVertices.Value(n));
- TopoDS_Vertex aNMVer =ShapeAnalysis_TransferParametersProj::CopyNMVertex(aVold,newEdge,E);
- Context()->Replace(aVold,aNMVer);
- if(fabs(apar - afpar) <= Precision::PConfusion())
- Context()->Replace(aNMVer,V1);
- else if(fabs(apar - alpar) <= Precision::PConfusion())
- Context()->Replace(aNMVer,V);
- else if( apar > afpar && apar <alpar)
- B.Add (newEdge,aNMVer);
- else continue;
- aSeqNMVertices.Remove(n);
- aSeqParNM.Remove(n);
- n--;
- }
-
-
-// if (ShapeUpgrade::Debug()) cout <<"... New Edge "
+ //addition NM vertices to new edges
+ Standard_Real afpar = (myEdgeDivide->HasCurve3d () ? f3d : f2d);
+ Standard_Real alpar = (myEdgeDivide->HasCurve3d () ? l3d : l2d);
+ for (Standard_Integer n = 1; n <= aSeqParNM.Length (); ++n)
+ {
+ Standard_Real apar = aSeqParNM.Value (n);
+ TopoDS_Vertex aVold = TopoDS::Vertex (aSeqNMVertices.Value (n));
+ TopoDS_Vertex aNMVer = ShapeAnalysis_TransferParametersProj::CopyNMVertex (aVold, newEdge, E);
+ Context ()->Replace (aVold, aNMVer);
+ if (fabs (apar - afpar) <= Precision::PConfusion ())
+ {
+ Context ()->Replace (aNMVer, V1);
+ }
+ else if (fabs (apar - alpar) <= Precision::PConfusion ())
+ {
+ Context ()->Replace (aNMVer, V);
+ }
+ else if (apar > afpar && apar < alpar)
+ {
+ B.Add (newEdge, aNMVer);
+ }
+ else
+ {
+ continue;
+ }
+
+ aSeqNMVertices.Remove (n);
+ aSeqParNM.Remove (n);
+ n--;
+ }
+
+// if (ShapeUpgrade::Debug()) cout <<"... New Edge "
// <<(void*) &(*newEdge.TShape())<<" on vertices "
// <<(void*) &(*V1.TShape())<<", " <<(void*) &(*V.TShape())
// <<" with Tolerance "<<TolEdge <<endl;
#include <StepVisual_CameraModelD3MultiClippingUnion.hxx>
#include <StepVisual_AnnotationCurveOccurrenceAndAnnotationOccurrenceAndGeomReprItemAndReprItemAndStyledItem.hxx>
-static int init = 0;
+static int THE_StepAP214_Protocol_init = 0;
static Interface_DataMapOfTransientInteger types(800);
-
//=======================================================================
//function : StepAP214_Protocol
//purpose :
StepAP214_Protocol::StepAP214_Protocol ()
{
- if (init) return; init = 1;
+ if (THE_StepAP214_Protocol_init)
+ {
+ return;
+ }
+ THE_StepAP214_Protocol_init = 1;
types.Bind (STANDARD_TYPE(StepBasic_Address), 1);
types.Bind (STANDARD_TYPE(StepShape_AdvancedBrepShapeRepresentation), 2);
IMPLEMENT_STANDARD_RTTIEXT(StepSelect_Activator,IFSelect_Activator)
-static int initActivator = 0;
-
+static int THE_StepSelect_Activator_initActivator = 0;
StepSelect_Activator::StepSelect_Activator ()
{
- if (initActivator) return; initActivator = 1;
+ if (THE_StepSelect_Activator_initActivator)
+ {
+ return;
+ }
+
+ THE_StepSelect_Activator_initActivator = 1;
// Add ( 0,"load");
// Add ( 0,"loadstep"); // homonyme
// Add ( 1,"entity");
void TObjDRAW::Init(Draw_Interpretor& di)
{
-
static Standard_Boolean initactor = Standard_False;
- if (initactor) return; initactor = Standard_True;
+ if (initactor)
+ {
+ return;
+ }
+ initactor = Standard_True;
//=====================================
// General commands
}
if (is_planar)
+ {
ais->SetCustomPlane (aplane->Pln());
- anAIS = ais;
+ }
+
+ anAIS = ais;
return;
}
else
if(mySDFaceToFill.Orientation() == TopAbs_REVERSED)
aN1.Reverse();
scalarPr = aBiN*aN1;
-
- if(fabs(scalarPr) <= 1e-10) {//try to step inside
- TopOpeBRepBuild_Tools::GetNormalInNearestPoint(TopoDS::Face(mySDFaceToFill), aSplitP, aN1);
- if(mySDFaceToFill.Orientation() == TopAbs_REVERSED)
- aN1.Reverse();
- scalarPr = aBiN*aN1;
- if(fabs(scalarPr) <= 1e-10) // this can not be
- keep = (TB == TopAbs_IN); //just to do something
- }
-
+
+ if (fabs (scalarPr) <= 1e-10) //try to step inside
+ {
+ TopOpeBRepBuild_Tools::GetNormalInNearestPoint (TopoDS::Face (mySDFaceToFill), aSplitP, aN1);
+ if (mySDFaceToFill.Orientation () == TopAbs_REVERSED)
+ {
+ aN1.Reverse ();
+ }
+ scalarPr = aBiN*aN1;
+ if (fabs (scalarPr) <= 1e-10) // this can not be
+ {
+ keep = (TB == TopAbs_IN); //just to do something
+ }
+ }
+
TopAbs_State aPartState = (scalarPr > 0) ? TopAbs_IN : TopAbs_OUT;
keep = (aPartState == TB) ? Standard_True : Standard_False;
//=======================================================================
//function : Dump
-//purpose :
+//purpose :
//=======================================================================
void TopOpeBRepBuild_GTopo::Dump(Standard_OStream& OS,
- const Standard_Address a) const
+ const Standard_Address a) const
{
char* s = (char*)a;
if (myReverseForce) OS<<"reverse value : "<<myReverseValue<<endl;
- if(s) OS<<s; OS<<"\\ I N O";
+ if(s) OS<<s;
+ OS<<"\\ I N O";
OS<<endl;
- if(s) OS<<s; OS<<"I ";
- DumpVal(OS,TopAbs_IN,TopAbs_IN); OS<<" ";
- DumpVal(OS,TopAbs_IN,TopAbs_ON); OS<<" ";
+ if(s) OS<<s;
+ OS<<"I ";
+ DumpVal(OS,TopAbs_IN,TopAbs_IN); OS<<" ";
+ DumpVal(OS,TopAbs_IN,TopAbs_ON); OS<<" ";
DumpVal(OS,TopAbs_IN,TopAbs_OUT); OS<<endl;
- if(s) OS<<s; OS<<"N ";
- DumpVal(OS,TopAbs_ON,TopAbs_IN); OS<<" ";
- DumpVal(OS,TopAbs_ON,TopAbs_ON); OS<<" ";
+ if(s) OS<<s;
+ OS<<"N ";
+ DumpVal(OS,TopAbs_ON,TopAbs_IN); OS<<" ";
+ DumpVal(OS,TopAbs_ON,TopAbs_ON); OS<<" ";
DumpVal(OS,TopAbs_ON,TopAbs_OUT); OS<<endl;
- if(s) OS<<s; OS<<"O ";
- DumpVal(OS,TopAbs_OUT,TopAbs_IN); OS<<" ";
- DumpVal(OS,TopAbs_OUT,TopAbs_ON); OS<<" ";
+ if(s) OS<<s;
+ OS<<"O ";
+ DumpVal(OS,TopAbs_OUT,TopAbs_IN); OS<<" ";
+ DumpVal(OS,TopAbs_OUT,TopAbs_ON); OS<<" ";
DumpVal(OS,TopAbs_OUT,TopAbs_OUT); OS<<endl;
}
//modified by NIZNHY-PKV Sun Dec 15 17:41:43 2002 f
//=======================================================================
//function : FDSCNX_Close
-//purpose :
+//purpose :
//=======================================================================
void FDSCNX_Close()
{
}
//modified by NIZNHY-PKV Sun Dec 15 17:41:40 2002 t
-Standard_EXPORT const TopTools_ListOfShape& FDSCNX_EdgeConnexityShapeIndex(const TopoDS_Shape& E,const Handle(TopOpeBRepDS_HDataStructure)& HDS,const Standard_Integer SI)
+Standard_EXPORT const TopTools_ListOfShape& FDSCNX_EdgeConnexityShapeIndex(const TopoDS_Shape& E,const Handle(TopOpeBRepDS_HDataStructure)& HDS,const Standard_Integer SI)
{
if (HDS.IsNull()) return *GLOBAL_los;
if (!GLOBAL_FDSCNX_prepared) return *GLOBAL_los;
// S = edge --> liste de faces connexes par S
// S = face --> liste d'edges E de S qui ont au moins une autre face connexe
-Standard_EXPORT const TopTools_ListOfShape& FDSCNX_EdgeConnexitySameShape(const TopoDS_Shape& S,const Handle(TopOpeBRepDS_HDataStructure)& HDS)
+Standard_EXPORT const TopTools_ListOfShape& FDSCNX_EdgeConnexitySameShape(const TopoDS_Shape& S,const Handle(TopOpeBRepDS_HDataStructure)& HDS)
{
TopAbs_ShapeEnum t = S.ShapeType();
if (t == TopAbs_EDGE) {
Standard_Integer rf = BDS.AncestorRank(f); if (rf == 0) continue;
// BDS.Shape(f);
TopTools_DataMapOfShapeListOfShape& fle = *GLOBAL_fle;
- TopTools_DataMapOfShapeListOfShape& elf = (rf == 1) ? *GLOBAL_elf1 : *GLOBAL_elf2;
+ TopTools_DataMapOfShapeListOfShape& elf = (rf == 1) ? *GLOBAL_elf1 : *GLOBAL_elf2;
TopExp_Explorer exe;
for (exe.Init(f,TopAbs_EDGE);exe.More();exe.Next()) {
// for (TopExp_Explorer exe(f,TopAbs_EDGE);exe.More();exe.Next()) {
// BDS.Shape(e);
// Standard_Boolean se = BDS.IsSectionEdge(TopoDS::Edge(e)); if (!se) continue;
Standard_Boolean hs = BDS.HasShape(TopoDS::Edge(e)); if (!hs) continue;
- TopTools_ListOfShape thelist, thelist1;
- if (!fle.IsBound(f)) fle.Bind(f, thelist); fle.ChangeFind(f).Append(e);
- if (!elf.IsBound(e)) elf.Bind(e, thelist1); elf.ChangeFind(e).Append(f);
+
+ TopTools_ListOfShape* aListFle = fle.ChangeSeek (f);
+ if (aListFle == NULL)
+ {
+ aListFle = fle.Bound (f, TopTools_ListOfShape());
+ }
+ aListFle->Append(e);
+
+ TopTools_ListOfShape* aListElf = elf.ChangeSeek (e);
+ if (aListElf == NULL)
+ {
+ aListElf = elf.Bound (e, TopTools_ListOfShape());
+ }
+ aListElf->Append(f);
}
}
GLOBAL_FDSCNX_prepared = Standard_True;
}
-Standard_EXPORT Standard_Boolean FDSCNX_HasConnexFace(const TopoDS_Shape& S,const Handle(TopOpeBRepDS_HDataStructure)& HDS)
+Standard_EXPORT Standard_Boolean FDSCNX_HasConnexFace(const TopoDS_Shape& S,const Handle(TopOpeBRepDS_HDataStructure)& HDS)
{
- if (HDS.IsNull()) return Standard_False; const TopOpeBRepDS_DataStructure& BDS = HDS->DS();
- const TopAbs_ShapeEnum t = S.ShapeType(); if (t != TopAbs_FACE && t != TopAbs_EDGE) return Standard_False;
- const Standard_Integer rs = BDS.AncestorRank(S); if (rs == 0) return Standard_False;
- TopTools_DataMapOfShapeListOfShape* pelf = (rs == 1) ? GLOBAL_elf1 : GLOBAL_elf2; if (pelf == NULL) return Standard_False;
- TopTools_DataMapOfShapeListOfShape& fle = *GLOBAL_fle;
- TopTools_DataMapOfShapeListOfShape& elf = *pelf;
- Standard_Boolean has = Standard_False;
- if (t == TopAbs_EDGE) has = elf.IsBound(S);
- else if (t == TopAbs_FACE) has = fle.IsBound(S);
+ if (HDS.IsNull())
+ {
+ return Standard_False;
+ }
+
+ const TopOpeBRepDS_DataStructure& BDS = HDS->DS();
+ const TopAbs_ShapeEnum t = S.ShapeType();
+ if (t != TopAbs_FACE
+ && t != TopAbs_EDGE)
+ {
+ return Standard_False;
+ }
+ const Standard_Integer rs = BDS.AncestorRank(S);
+ if (rs == 0)
+ {
+ return Standard_False;
+ }
+
+ TopTools_DataMapOfShapeListOfShape* pelf = (rs == 1) ? GLOBAL_elf1 : GLOBAL_elf2;
+ if (pelf == NULL)
+ {
+ return Standard_False;
+ }
+
+ Standard_Boolean has = (t == TopAbs_EDGE ? pelf : GLOBAL_fle)->IsBound(S);
return has;
}
-Standard_EXPORT void FDSCNX_FaceEdgeConnexFaces(const TopoDS_Shape& F,const TopoDS_Shape& E,const Handle(TopOpeBRepDS_HDataStructure)& HDS,TopTools_ListOfShape& LF)
+Standard_EXPORT void FDSCNX_FaceEdgeConnexFaces(const TopoDS_Shape& F,const TopoDS_Shape& E,const Handle(TopOpeBRepDS_HDataStructure)& HDS,TopTools_ListOfShape& LF)
{
LF.Clear();
// verifier que E est une arete de connexite de F
Standard_Boolean EofF = Standard_False;
- const TopTools_ListOfShape& loe = FDSCNX_EdgeConnexitySameShape(F,HDS); if (loe.IsEmpty()) return;
- for (TopTools_ListIteratorOfListOfShape i(loe);i.More();i.Next()) {
+ const TopTools_ListOfShape& loe = FDSCNX_EdgeConnexitySameShape(F,HDS);
+ if (loe.IsEmpty())
+ {
+ return;
+ }
+ for (TopTools_ListIteratorOfListOfShape i(loe);i.More();i.Next())
+ {
const TopoDS_Shape& e = i.Value();
// HDS->Shape(e);
Standard_Boolean b = e.IsSame(E);
- if (b) {
+ if (b)
+ {
EofF=Standard_True;
break;
}
}
- if (!EofF) return;
-
- const TopTools_ListOfShape& lof = FDSCNX_EdgeConnexitySameShape(E,HDS); if (lof.IsEmpty()) return;
- for (TopTools_ListIteratorOfListOfShape it(lof);it.More();it.Next()) {
+ if (!EofF)
+ {
+ return;
+ }
+
+ const TopTools_ListOfShape& lof = FDSCNX_EdgeConnexitySameShape(E,HDS);
+ if (lof.IsEmpty())
+ {
+ return;
+ }
+ for (TopTools_ListIteratorOfListOfShape it(lof);it.More();it.Next())
+ {
const TopoDS_Shape& f = it.Value();
Standard_Boolean b = f.IsSame(F);
- if (!b) {
+ if (!b)
+ {
LF.Append(f);
}
}
Standard_EXPORT void FDSCNX_DumpIndex(const Handle(TopOpeBRepDS_HDataStructure)& HDS,const Standard_Integer I)
{
- if (HDS.IsNull()) return; const TopOpeBRepDS_DataStructure& BDS = HDS->DS();
+ if (HDS.IsNull())
+ {
+ return;
+ }
+
+ const TopOpeBRepDS_DataStructure& BDS = HDS->DS();
Standard_Integer ns=BDS.NbShapes();
- if (I<1 || I>ns) return;
+ if (I<1 || I>ns)
+ {
+ return;
+ }
+
Standard_Integer i=I;
const TopoDS_Shape& s=BDS.Shape(i);
TopAbs_ShapeEnum ts=s.ShapeType();
const TopTools_ListOfShape& ls=FDSCNX_EdgeConnexitySameShape(s,HDS);
- if (ts == TopAbs_EDGE) {
- TopTools_ListIteratorOfListOfShape ils(ls);if(!ils.More())return;
- for(;ils.More();ils.Next())cout<<BDS.Shape(ils.Value())<<" ";
+ if (ts == TopAbs_EDGE)
+ {
+ TopTools_ListIteratorOfListOfShape ils(ls);
+ if (!ils.More())
+ {
+ return;
+ }
+
+ for (; ils.More(); ils.Next())
+ {
+ cout<<BDS.Shape(ils.Value())<<" ";
+ }
}
- else if (ts == TopAbs_FACE) {
- TopTools_ListIteratorOfListOfShape ils(ls);if(!ils.More())return;
- for(;ils.More();ils.Next()) {
+ else if (ts == TopAbs_FACE)
+ {
+ TopTools_ListIteratorOfListOfShape ils(ls);
+ if (!ils.More())
+ {
+ return;
+ }
+
+ for (; ils.More(); ils.Next())
+ {
const TopoDS_Shape& e=ils.Value();
TopTools_ListOfShape lf;FDSCNX_FaceEdgeConnexFaces(s,e,HDS,lf);
- TopTools_ListIteratorOfListOfShape ilf(lf);if(!ilf.More())continue;
- for(;ilf.More();ilf.Next())cout<<BDS.Shape(ilf.Value())<<" ";
+ TopTools_ListIteratorOfListOfShape ilf(lf);
+ if (!ilf.More())
+ {
+ continue;
+ }
+ for (; ilf.More(); ilf.Next())
+ {
+ cout<<BDS.Shape(ilf.Value())<<" ";
+ }
}
}
}
Standard_EXPORT void FDSCNX_Dump(const Handle(TopOpeBRepDS_HDataStructure)& HDS,const Standard_Integer I)
{
- if (HDS.IsNull()) return; const TopOpeBRepDS_DataStructure& BDS = HDS->DS();
+ if (HDS.IsNull())
+ {
+ return;
+ }
+
+ const TopOpeBRepDS_DataStructure& BDS = HDS->DS();
Standard_Integer ns=BDS.NbShapes();
- if (I<1 || I>ns) return;
+ if (I<1 || I>ns)
+ {
+ return;
+ }
+
Standard_Integer i=I;
const TopoDS_Shape& s=BDS.Shape(i);Standard_Integer is=BDS.Shape(s);TopAbs_ShapeEnum ts=s.ShapeType();
const TopTools_ListOfShape& ls=FDSCNX_EdgeConnexitySameShape(s,HDS);
- if (ts == TopAbs_EDGE) {
- TopTools_ListIteratorOfListOfShape ils(ls);if(!ils.More())return;
+ if (ts == TopAbs_EDGE)
+ {
+ TopTools_ListIteratorOfListOfShape ils(ls);
+ if(!ils.More())
+ {
+ return;
+ }
+
cout<<"clear;";
- for(;ils.More();ils.Next())cout<<"tsee f "<<BDS.Shape(ils.Value())<<";";
+ for (; ils.More(); ils.Next())
+ {
+ cout<<"tsee f "<<BDS.Shape(ils.Value())<<";";
+ }
cout<<"tsee e "<<is<<";### edge "<<is<<" connexity"<<endl;
}
- else if (ts == TopAbs_FACE) {
- TopTools_ListIteratorOfListOfShape ils(ls);if(!ils.More())return;
- for(;ils.More();ils.Next()) {
+ else if (ts == TopAbs_FACE)
+ {
+ TopTools_ListIteratorOfListOfShape ils(ls);
+ if (!ils.More())
+ {
+ return;
+ }
+ for(;ils.More();ils.Next())
+ {
const TopoDS_Shape& e=ils.Value();Standard_Integer ie=BDS.Shape(e);
TopTools_ListOfShape lf;FDSCNX_FaceEdgeConnexFaces(s,e,HDS,lf);
- TopTools_ListIteratorOfListOfShape ilf(lf);if(!ilf.More())continue;
+ TopTools_ListIteratorOfListOfShape ilf(lf);
+ if (!ilf.More())
+ {
+ continue;
+ }
+
cout<<"clear;";cout<<"tsee f "<<is<<";";
- for(;ilf.More();ilf.Next())cout<<"tsee f "<<BDS.Shape(ilf.Value())<<";";
+ for (;ilf.More(); ilf.Next())
+ {
+ cout<<"tsee f "<<BDS.Shape(ilf.Value())<<";";
+ }
cout<<"tsee e "<<ie<<";### face "<<is<<" connexity"<<endl;
}
}
Standard_EXPORT void FDSCNX_Dump(const Handle(TopOpeBRepDS_HDataStructure)& HDS)
{
- if (HDS.IsNull()) return; const TopOpeBRepDS_DataStructure& BDS = HDS->DS();
- Standard_Integer i=1,ns=BDS.NbShapes();
- for (i=1;i<=ns;i++) FDSCNX_Dump(HDS,i);
+ if (HDS.IsNull())
+ {
+ return;
+ }
+
+ const TopOpeBRepDS_DataStructure& BDS = HDS->DS();
+ Standard_Integer ns=BDS.NbShapes();
+ for (Standard_Integer i = 1;i<=ns;i++)
+ {
+ FDSCNX_Dump(HDS,i);
+ }
}
Standard_Real uf=bs.FirstUParameter(),ul=bs.LastUParameter(),vf=bs.FirstVParameter(),vl=bs.LastVParameter();
Standard_Boolean onuf = (Abs(uf-u)<tolu), onul = (Abs(ul-u)<tolu);
Standard_Boolean onvf = (Abs(vf-v)<tolv), onvl = (Abs(vl-v)<tolv);
- if (onuf) onU = ONFIRST; if (onul) onU = ONLAST;
- if (onvf) onV = ONFIRST; if (onvl) onV = ONLAST;
- if (u < (uf-tolu)) onU = INFFIRST; if (u > (ul+tolu)) onU = SUPLAST;
- if (v < (vf-tolv)) onV = INFFIRST; if (v > (vl+tolv)) onV = SUPLAST;
+ if (onuf) onU = ONFIRST;
+ if (onul) onU = ONLAST;
+ if (onvf) onV = ONFIRST;
+ if (onvl) onV = ONLAST;
+ if (u < (uf-tolu)) onU = INFFIRST;
+ if (u > (ul+tolu)) onU = SUPLAST;
+ if (v < (vf-tolv)) onV = INFFIRST;
+ if (v > (vl+tolv)) onV = SUPLAST;
}
//=======================================================================
(ViewerTest_myContexts, TCollection_AsciiString (myDriverName + "/Viewer"));
}
else
+ {
myViewerName = ViewerTest_myContexts.Find2 (ViewerTest::GetAISContext());
+ }
- myViewName = CreateName <Handle(V3d_View)>
- (ViewerTest_myViews, TCollection_AsciiString(myViewerName + "/View"));
+ myViewName = CreateName <Handle(V3d_View)> (ViewerTest_myViews, TCollection_AsciiString(myViewerName + "/View"));
}
else
{
if (ViewerTest_myViews.Extent() > 1)
{
TCollection_AsciiString aNewViewName;
- for (NCollection_DoubleMap <TCollection_AsciiString, Handle(V3d_View)> :: Iterator
- anIter(ViewerTest_myViews); anIter.More(); anIter.Next())
+ for (NCollection_DoubleMap <TCollection_AsciiString, Handle(V3d_View)>::Iterator anIter (ViewerTest_myViews);
+ anIter.More(); anIter.Next())
+ {
if (anIter.Key1() != theViewName)
{
aNewViewName = anIter.Key1();
break;
}
- ActivateView (aNewViewName);
+ }
+ ActivateView (aNewViewName);
}
else
{
(( theArgsNb==1 ) || ( strcasecmp( theArgVec[1], "long" ) != 0 ));
if (isTreeView)
+ {
theDi << theArgVec[0] <<":\n";
+ }
- for (NCollection_DoubleMap <TCollection_AsciiString, Handle(Graphic3d_GraphicDriver)>::Iterator
- aDriverIter(ViewerTest_myDrivers); aDriverIter.More(); aDriverIter.Next())
- {
- if (isTreeView)
- theDi << aDriverIter.Key1() << ":\n";
+ for (NCollection_DoubleMap <TCollection_AsciiString, Handle(Graphic3d_GraphicDriver)>::Iterator aDriverIter (ViewerTest_myDrivers);
+ aDriverIter.More(); aDriverIter.Next())
+ {
+ if (isTreeView)
+ theDi << aDriverIter.Key1() << ":\n";
- for (NCollection_DoubleMap <TCollection_AsciiString, Handle(AIS_InteractiveContext)>::Iterator
- aContextIter(ViewerTest_myContexts); aContextIter.More(); aContextIter.Next())
+ for (NCollection_DoubleMap <TCollection_AsciiString, Handle(AIS_InteractiveContext)>::Iterator
+ aContextIter(ViewerTest_myContexts); aContextIter.More(); aContextIter.Next())
+ {
+ if (aContextIter.Key1().Search(aDriverIter.Key1()) != -1)
{
- if (aContextIter.Key1().Search(aDriverIter.Key1()) != -1)
+ if (isTreeView)
{
- if (isTreeView)
- {
- TCollection_AsciiString aContextName(aContextIter.Key1());
- theDi << " " << aContextName.Split(aDriverIter.Key1().Length() + 1) << ":\n";
- }
+ TCollection_AsciiString aContextName(aContextIter.Key1());
+ theDi << " " << aContextName.Split(aDriverIter.Key1().Length() + 1) << ":\n";
+ }
- for (NCollection_DoubleMap <TCollection_AsciiString, Handle(V3d_View)>::Iterator
- aViewIter(ViewerTest_myViews); aViewIter.More(); aViewIter.Next())
+ for (NCollection_DoubleMap <TCollection_AsciiString, Handle(V3d_View)>::Iterator aViewIter (ViewerTest_myViews);
+ aViewIter.More(); aViewIter.Next())
+ {
+ if (aViewIter.Key1().Search(aContextIter.Key1()) != -1)
{
- if (aViewIter.Key1().Search(aContextIter.Key1()) != -1)
+ TCollection_AsciiString aViewName(aViewIter.Key1());
+ if (isTreeView)
{
- TCollection_AsciiString aViewName(aViewIter.Key1());
- if (isTreeView)
- {
- if (aViewIter.Value() == ViewerTest::CurrentView())
- theDi << " " << aViewName.Split(aContextIter.Key1().Length() + 1) << "(*)\n";
- else
- theDi << " " << aViewName.Split(aContextIter.Key1().Length() + 1) << "\n";
- }
+ if (aViewIter.Value() == ViewerTest::CurrentView())
+ theDi << " " << aViewName.Split(aContextIter.Key1().Length() + 1) << "(*)\n";
else
- {
- theDi << aViewName << " ";
- }
+ theDi << " " << aViewName.Split(aContextIter.Key1().Length() + 1) << "\n";
+ }
+ else
+ {
+ theDi << aViewName << " ";
}
}
}
}
}
+ }
return 0;
}
void XDEDRAW::Init(Draw_Interpretor& di)
{
-
static Standard_Boolean initactor = Standard_False;
- if (initactor) return; initactor = Standard_True;
+ if (initactor)
+ {
+ return;
+ }
+ initactor = Standard_True;
// Load static variables for STEPCAF (ssv; 16.08.2012)
STEPCAFControl_Controller::Init();
void XDEDRAW_Colors::InitCommands(Draw_Interpretor& di)
{
-
static Standard_Boolean initactor = Standard_False;
- if (initactor) return; initactor = Standard_True;
+ if (initactor)
+ {
+ return;
+ }
+ initactor = Standard_True;
//=====================================
// Work with colors
return 0;
}
-void XDEDRAW_Common::InitCommands(Draw_Interpretor& di) {
-
+void XDEDRAW_Common::InitCommands(Draw_Interpretor& di)
+{
static Standard_Boolean initactor = Standard_False;
- if (initactor) return; initactor = Standard_True;
+ if (initactor)
+ {
+ return;
+ }
+ initactor = Standard_True;
Standard_CString g = "XDE translation commands";
void XDEDRAW_GDTs::InitCommands(Draw_Interpretor& di)
{
-
static Standard_Boolean initactor = Standard_False;
- if (initactor) return; initactor = Standard_True;
-
+ if (initactor)
+ {
+ return;
+ }
+ initactor = Standard_True;
Standard_CString g = "XDE G&DTs commands";
void XDEDRAW_Layers::InitCommands(Draw_Interpretor& di)
{
-
static Standard_Boolean initactor = Standard_False;
- if (initactor) return; initactor = Standard_True;
+ if (initactor)
+ {
+ return;
+ }
+ initactor = Standard_True;
//=====================================
// Work with layers
void XDEDRAW_Props::InitCommands(Draw_Interpretor& di)
{
-
static Standard_Boolean initactor = Standard_False;
- if (initactor) return; initactor = Standard_True;
+ if (initactor)
+ {
+ return;
+ }
+ initactor = Standard_True;
Standard_CString g = "XDE property's commands";
void XDEDRAW_Shapes::InitCommands(Draw_Interpretor& di)
{
-
static Standard_Boolean initactor = Standard_False;
- if (initactor) return; initactor = Standard_True;
+ if (initactor)
+ {
+ return;
+ }
+ initactor = Standard_True;
//=====================================
// Work with shapes
void XDEDRAW_Views::InitCommands(Draw_Interpretor& di)
{
-
static Standard_Boolean initactor = Standard_False;
- if (initactor) return; initactor = Standard_True;
-
+ if (initactor)
+ {
+ return;
+ }
+ initactor = Standard_True;
Standard_CString g = "XDE Views commands";
// #### ####
// ######################################################################
-static int initactor = 0;
-
+static int THE_XSControl_FuncShape_initactor = 0;
//=======================================================================
//function : Init
-//purpose :
+//purpose :
//=======================================================================
void XSControl_FuncShape::Init ()
{
- if (initactor) return; initactor = 1;
+ if (THE_XSControl_FuncShape_initactor)
+ {
+ return;
+ }
+
+ THE_XSControl_FuncShape_initactor = 1;
IFSelect_Act::SetGroup("DE: General");
// liste
if (n1 <= n2 && n1 > 0) {
char nom[50], nomsh[60]; Standard_Integer nbsh = 0;
- for (i = 0; i < paro; i ++) nom[i]=name[i]; nom[paro] = '\0';
+ for (i = 0; i < paro; i ++)
+ {
+ nom[i]=name[i];
+ }
+ nom[paro] = '\0';
sout<<"Shapes DRAW named : "<<nom<<n1<<" to "<<nom<<n2;
for (i = n1; i <= n2 ; i ++) {
const char* nomshh = &nomsh[0];
if (init) {
XSControl::Session(pilot)->InitTransferReader (0);
TR = XSControl::Session(pilot)->TransferReader();
- if (TR.IsNull()) {
+ if (TR.IsNull()) {
Handle(Message_Messenger) sout = Message::DefaultMessenger();
- sout<<" init not done or failed"<<endl;
- return IFSelect_RetError;
+ sout<<" init not done or failed"<<endl;
+ return IFSelect_RetError;
}
}
TR->BeginTransfer();
-static int initactor = 0;
+static int THE_XSControl_Functions_initactor = 0;
//=======================================================================
//function : Init
-//purpose :
+//purpose :
//=======================================================================
void XSControl_Functions::Init ()
{
- if (initactor) return; initactor = 1;
+ if (THE_XSControl_Functions_initactor)
+ {
+ return;
+ }
+
+ THE_XSControl_Functions_initactor = 1;
IFSelect_Act::SetGroup("DE: General");
IFSelect_Act::AddFunc ("xinit","[norm:string to change norme] reinitialises according to the norm",XSControl_xinit);
}
S<<"Transfer Write item n0."<<ne<<" of "<<max;
- if (nr > 0) S<<" ** Transfer Root n0."<<ne; S<<endl;
+ if (nr > 0)
+ {
+ S<<" ** Transfer Root n0."<<ne;
+ }
+ S<<endl;
ent = FP->FindTransient(finder);
S<<" -> Type "<<finder->DynamicType()->Name()<<endl;
FP->StartTrace (binder,finder,0,0); // pb sout/S
}
S<<"Transfer Read item n0."<<ne<<" of "<<max;
- if (nr > 0) S<<" ** Transfer Root n0."<<ne; S<<endl;
+ if (nr > 0)
+ {
+ S<<" ** Transfer Root n0."<<ne;
+ }
+ S<<endl;
if (!model.IsNull()) { S<<" In Model, Entity "; model->Print(ent,S); }
binder = TP->MapItem (ne);
S<<endl;
void XSDRAW::LoadDraw (Draw_Interpretor& theCommands)
{
- if (dejald) return; dejald = 1;
+ if (dejald)
+ {
+ return;
+ }
+ dejald = 1;
// Pour tout faire d un coup : BRepTest & cie:
LoadSession();