Resolved some C4702 (unreachable code) and C4127 (conditional expression is constant).
small corrections in NoSuchObject invoking.
Macros names changing, deadcode deleting, re-writing "for" loops into equivalent "if" structures.
changed condition in "if" block, deadcode deleted.
Small changes in else statement.
Handle(BOPInt_Context)& theContext)
{
Standard_Boolean bIsDone, bHasFirstPoint, bHasSecondPoint;
- Standard_Integer iErr, aIx, aNbDomains, i;
+ Standard_Integer iErr, aIx, aNbDomains;
Standard_Real aUMin, aUMax, aVMin, aVMax;
Standard_Real aVx = 0., aUx, aV1, aV2, aEpsT;
gp_Dir2d aD2D (0., 1.);
}
//
aNbDomains=aHatcher.NbDomains(aIx);
- for (i=1; i<=aNbDomains; ++i) {
- const HatchGen_Domain& aDomain=aHatcher.Domain (aIx, i) ;
+ if (aNbDomains > 0) {
+ const HatchGen_Domain& aDomain=aHatcher.Domain (aIx, 1) ;
bHasFirstPoint=aDomain.HasFirstPoint();
if (!bHasFirstPoint) {
iErr=3;
//
aVx=IntTools_Tools::IntermediatePoint(aV1, aV2);
//
- break;
+ }
+ else {
+ iErr=2;
+ return iErr;
}
//
aS->D0(aUx, aVx, aPx);
BRepTopAdaptor_FClass2d& /*FClass2d*/)
{
TopExp_Explorer exp;
- for (exp.Init(wir,TopAbs_EDGE);
- exp.More();
- exp.Next()) {
+ exp.Init(wir,TopAbs_EDGE);
+ if (exp.More()) {
const TopoDS_Edge& edg = TopoDS::Edge(exp.Current());
Standard_Real f,l;
Handle(Geom2d_Curve) C2d = BRep_Tool::CurveOnSurface(edg,F,f,l);
{
// Standard_Real U,V;
TopExp_Explorer exp;
- for (exp.Init(wir,TopAbs_EDGE);
- exp.More();
- exp.Next()) {
+ exp.Init(wir,TopAbs_EDGE);
+ if (exp.More()) {
const TopoDS_Edge& edg = TopoDS::Edge(exp.Current());
Standard_Real f,l;
bInternal=Standard_False;
//
aIt.Initialize(aSx);
- for (; aIt.More(); aIt.Next()) {
+ if (aIt.More()) {
const TopoDS_Shape& aSy=aIt.Value();
aOr=aSy.Orientation();
bInternal=(aOr==TopAbs_INTERNAL);
- break;
}
//
return bInternal;
S2->SetPole(i, j, P);
}
}
- else
- Standard_NoSuchObject_Raise_if(1,"BRepTools_GTrsfModification : Pb no BSpline/Bezier Type Surface");
+ else{
+ Standard_NoSuchObject::Raise("BRepTools_GTrsfModification : Pb no BSpline/Bezier Type Surface");
+ }
L.Identity();
return Standard_True;
C2->SetPole(i, P);
}
}
- else
- Standard_NoSuchObject_Raise_if(1,"BRepTools_GTrsfModification : Pb no BSpline/Bezier Type Curve");
+ else {
+ Standard_NoSuchObject::Raise("BRepTools_GTrsfModification : Pb no BSpline/Bezier Type Curve");
+ }
C = new Geom_TrimmedCurve(C, f, l);
}
L.Identity() ;
// VARIANT 2 : extend Arcprol, not create new small edge
// To do: modify for intcouture
- const Standard_Boolean variant1 = Standard_True;
+ #define VARIANT1
// First of all the ponts are cut with the edge of the spine.
Standard_Integer IArcspine = DStr.AddShape(Arcspine);
}
Handle(Geom2d_Curve) Hc;
- if (variant1)
+ #ifdef VARIANT1
parVtx = BRep_Tool::Parameter(Vtx,Arcprol);
- else
+ #else
parVtx = BRep_Tool::Parameter(V2,Arcprol);
+ #endif
const ChFiDS_FaceInterference& Fiop = Fd->Interference(IFopArc);
gp_Pnt2d pop1, pop2, pv1, pv2;
Hc = BRep_Tool::CurveOnSurface(Arcprol,Fop,Ubid,Ubid);
Interfop = ChFi3d_FilCurveInDS(IZob,Iop,zob2dop,Et);
DStr.ChangeShapeInterferences(Iop).Append(Interfop);
Handle(TopOpeBRepDS_CurvePointInterference) interfprol;
- if (variant1)
+ #ifdef VARIANT1
interfprol = ChFi3d_FilVertexInDS(TopAbs_FORWARD,IZob,IVtx,Udeb);
- else {
+ #else
+ {
Standard_Integer IV2 = DStr.AddShape(V2); // VARIANT 2
interfprol = ChFi3d_FilVertexInDS(TopAbs_FORWARD,IZob,IV2,Udeb);
}
+ #endif
DStr.ChangeCurveInterferences(IZob).Append(interfprol);
Standard_Integer icc = stripe->IndexPoint(isfirst,IFopArc);
interfprol = ChFi3d_FilPointInDS(TopAbs_REVERSED,IZob,icc,Ufin);
DStr.ChangeCurveInterferences(IZob).Append(interfprol);
- if (variant1) {
+ #ifdef VARIANT1
+ {
if (IFopArc == 1) box1.Add( zob3d->Value(Ufin) );
else box2.Add( zob3d->Value(Ufin) );
}
- else {
+ #else
+ {
// cut off existing Arcprol
Standard_Integer iArcprol = DStr.AddShape(Arcprol);
interfprol = ChFi3d_FilPointInDS(OVtx,iArcprol,icc,Udeb);
DStr.ChangeShapeInterferences(Arcprol).Append(interfprol);
}
+ #endif
}
}
ChFi3d_EnlargeBox(DStr,stripe,Fd,box1,box2,isfirst);
#define NEWSEQ 1
-static const Standard_Integer methode = 1; //-- 1:(Nv Traitement) 3:(Nv + Ancien +check) 2:(Ancien)
+#define MATH_FUNCTIONROOTS_NEWCODE // Nv Traitement
+//#define MATH_FUNCTIONROOTS_OLDCODE // Ancien
+//#define MATH_FUNCTIONROOTS_CHECK // Check
math_FunctionRoots::math_FunctionRoots(math_FunctionWithDerivative& F,
const Standard_Real A,
#endif
Sol.Clear();
NbStateSol.Clear();
- if(methode & 1) {
+ #ifdef MATH_FUNCTIONROOTS_NEWCODE
+ {
Done = Standard_True;
Standard_Real X0=A;
Standard_Real XN=B;
}
#if NEWSEQ
- if(methode==3) {
+ #ifdef MATH_FUNCTIONROOTS_CHECK
+ {
StaticSol.Clear();
Standard_Integer n=Sol.Length();
for(Standard_Integer ii=1;ii<=n;ii++) {
Sol.Clear();
NbStateSol.Clear();
}
+#endif
+#endif
#endif
}
- if(methode & 2) {
+#ifdef MATH_FUNCTIONROOTS_OLDCODE
+{
//-- ********************************************************************************
//-- ANCIEN TRAITEMENT
//-- ********************************************************************************
}
}
#if NEWSEQ
- if(methode == 3) {
+ #ifdef MATH_FUNCTIONROOTS_CHECK
+ {
Standard_Integer n1=StaticSol.Length();
Standard_Integer n2=Sol.Length();
if(n1!=n2) {
}
}
#endif
+#endif
}
+#endif
}