From: omy Date: Thu, 15 Nov 2012 08:59:23 +0000 (+0400) Subject: 0023143: Suspicious else X-Git-Tag: V6_6_0_beta~239 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=3fa7e3e72f4e434ee00a32f3fd0e81c9136d281d;p=occt-copy.git 0023143: Suspicious else Changes description: In src\IntPatch\IntPatch_ImpPrmIntersection.cxx , in ForcedPurgePoints function changed ParametersOnS2() to ParametersOnS1() in cases of Standard_Boolean IsReversed == false in lines 1522 & 1540 Got rid from duplicated code in function static void ForcedPurgePoints(...) --- diff --git a/src/IntPatch/IntPatch_ImpPrmIntersection.cxx b/src/IntPatch/IntPatch_ImpPrmIntersection.cxx index 7eab0bd50f..a54ebc96d7 100755 --- a/src/IntPatch/IntPatch_ImpPrmIntersection.cxx +++ b/src/IntPatch/IntPatch_ImpPrmIntersection.cxx @@ -1510,19 +1510,20 @@ static void ForcedPurgePoints(Handle(IntSurf_LineOn2S)& Result, if(Result->NbPoints() <= 30) return; Standard_Integer Index = 0, IndexLimF = 8, IndexLimL = 8; - if(Quad.TypeQuadric() == GeomAbs_Cone) { - Standard_Real Uapx = 0., Vapx = 0.; - Quad.Parameters(Quad.Cone().Apex(),Uapx,Vapx); - Standard_Real U1 = 0., V1 = 0., U2 = 0., V2 = 0.; + Standard_Real U1 = 0., V1 = 0., U2 = 0., V2 = 0.; if(IsReversed) { Result->Value(1).ParametersOnS2(U1,V1); Result->Value(Result->NbPoints()).ParametersOnS2(U2,V2); } else { - Result->Value(1).ParametersOnS2(U1,V1); - Result->Value(Result->NbPoints()).ParametersOnS2(U2,V2); + Result->Value(1).ParametersOnS1(U1,V1); + Result->Value(Result->NbPoints()).ParametersOnS1(U2,V2); } + if(Quad.TypeQuadric() == GeomAbs_Cone) { + Standard_Real Uapx = 0., Vapx = 0.; + Quad.Parameters(Quad.Cone().Apex(),Uapx,Vapx); + if(fabs(V1-Vapx) <= 1.e-3) IndexLimF = 12; if(fabs(V2-Vapx) <= 1.e-3) @@ -1531,16 +1532,7 @@ static void ForcedPurgePoints(Handle(IntSurf_LineOn2S)& Result, if(Quad.TypeQuadric() == GeomAbs_Sphere) { Standard_Real Vapx1 = M_PI/2., Vapx2 = -M_PI/2.; - Standard_Real U1 = 0., V1 = 0., U2 = 0., V2 = 0.; - if(IsReversed) { - Result->Value(1).ParametersOnS2(U1,V1); - Result->Value(Result->NbPoints()).ParametersOnS2(U2,V2); - } - else { - Result->Value(1).ParametersOnS2(U1,V1); - Result->Value(Result->NbPoints()).ParametersOnS2(U2,V2); - } - + if(fabs(V1-Vapx1) <= 1.e-3 || fabs(V1-Vapx2) <= 1.e-3) IndexLimF = 12; if(fabs(V2-Vapx1) <= 1.e-3 || fabs(V2-Vapx2) <= 1.e-3)