X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=blobdiff_plain;f=src%2FShapeFix%2FShapeFix_ComposeShell.cxx;h=9386e968751a55d3bd302c7f2257fde6f803f4b4;hp=5adcf9767d92ff7969dd48df310834a8d9e72954;hb=eafb234bf120f005d1a52abc75384d33d2de1721;hpb=d30c4db93b7b2398b2375a0fa120cc4bb376169b diff --git a/src/ShapeFix/ShapeFix_ComposeShell.cxx b/src/ShapeFix/ShapeFix_ComposeShell.cxx index 5adcf9767d..9386e96875 100755 --- a/src/ShapeFix/ShapeFix_ComposeShell.cxx +++ b/src/ShapeFix/ShapeFix_ComposeShell.cxx @@ -1,7 +1,23 @@ -// File: ShapeFix_ComposeShell.cxx -// Created: Tue Apr 27 11:34:07 1999 -// Author: Andrey BETENEV -// +// Created on: 1999-04-27 +// Created by: Andrey BETENEV +// Copyright (c) 1999-1999 Matra Datavision +// Copyright (c) 1999-2012 OPEN CASCADE SAS +// +// The content of this file is subject to the Open CASCADE Technology Public +// License Version 6.5 (the "License"). You may not use the content of this file +// except in compliance with the License. Please obtain a copy of the License +// at http://www.opencascade.org and read it completely before using this file. +// +// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its +// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. +// +// The Original Code and all software distributed under the License is +// distributed on an "AS IS" basis, without warranty of any kind, and the +// Initial Developer hereby disclaims all such warranties, including without +// limitation, any warranties of merchantability, fitness for a particular +// purpose or non-infringement. Please see the License for the specific terms +// and conditions governing the rights and limitations under the License. + // pdn 01.06.99 S4205: handling not-SameRange edges // abv 22.07.99 implementing patch indices // svv 10.01.00 porting on DEC @@ -650,9 +666,10 @@ Standard_Integer ShapeFix_ComposeShell::ComputeCode (const Handle(ShapeExtend_Wi } } if ( j < np ) { i = 0; break; } // not tangency - if ( i == endInd ) + if ( i == endInd ) { if ( special <=0 ) break; else special = -1; + } } if ( myClosedMode ) { if ( code != IOR_UNDEF && ! begin ) { @@ -1985,14 +2002,14 @@ void ShapeFix_ComposeShell::CollectWires (ShapeFix_SequenceOfWireSegment &wires, TopoDS_Vertex firstV, endV; TopoDS_Edge firstEdge, lastEdge; Standard_Real tol = 0; - Standard_Integer iumin, iumax, ivmin, ivmax; + Standard_Integer iumin = 0, iumax = 0, ivmin = 0, ivmax = 0; Standard_Real dsu=0., dsv=0.; Standard_Boolean canBeClosed = Standard_False; - while ( 1 ) { + for(;;) { Standard_Integer index = 0; Standard_Boolean misoriented = Standard_True, samepatch = Standard_False; Standard_Boolean reverse = Standard_False, connected = Standard_False; - Standard_Real angle = -PI, mindist = RealLast(); + Standard_Real angle = -M_PI, mindist = RealLast(); Standard_Integer weigth = 0; Standard_Real shiftu=0., shiftv=0.; @@ -2083,8 +2100,8 @@ void ShapeFix_ComposeShell::CollectWires (ShapeFix_SequenceOfWireSegment &wires, } // short segment is to be taken with highest priority by angle - Standard_Real ang = ( shorts(i) >0 ? PI : endTan.Angle ( lVec ) ); - if ( myClosedMode && shorts(i) <=0 && PI-ang < ::Precision::Angular() ) + Standard_Real ang = ( shorts(i) >0 ? M_PI : endTan.Angle ( lVec ) ); + if ( myClosedMode && shorts(i) <=0 && M_PI-ang < ::Precision::Angular() ) ang = 0.; // abv 21 Mar 00: trj3_s1-md-214.stp #2471: avoid going back // abv 05 Feb 02: face from Parasolid: use tolerance of edges for check // for coincidence (instead of vertex tolerance) in order @@ -2715,7 +2732,7 @@ void ShapeFix_ComposeShell::DispatchWires (TopTools_SequenceOfShape &faces, // Collect wires in packets lying on same surface and dispatch them TColStd_Array1OfBoolean used ( 1, nb ); used.Init ( Standard_False ); - while ( 1 ) { + for(;;) { TopTools_SequenceOfShape loops; Handle(Geom_Surface) Surf;