X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=blobdiff_plain;f=src%2FBRepFill%2FBRepFill_TrimSurfaceTool.cxx;h=583e6c7d76c2424067481c751faf38761ff2d756;hp=c5405c9e6b9adddd7d74a6c99b7574fff3e41b8b;hb=42cf5bc1cacbc83b1bf8639227311ad726522ace;hpb=7fd59977dfb3a75f75670474b59dfc0f3f5f90ba diff --git a/src/BRepFill/BRepFill_TrimSurfaceTool.cxx b/src/BRepFill/BRepFill_TrimSurfaceTool.cxx old mode 100755 new mode 100644 index c5405c9..583e6c7 --- a/src/BRepFill/BRepFill_TrimSurfaceTool.cxx +++ b/src/BRepFill/BRepFill_TrimSurfaceTool.cxx @@ -1,72 +1,86 @@ -// File: BRepFill_TrimSurfaceTool.cxx -// Created: Fri Oct 21 14:56:32 1994 -// Author: Bruno DUMORTIER -// +// Created on: 1994-10-21 +// Created by: Bruno DUMORTIER +// Copyright (c) 1994-1999 Matra Datavision +// Copyright (c) 1999-2014 OPEN CASCADE SAS +// +// This file is part of Open CASCADE Technology software library. +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. +// +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. -#include - -#include - -#include - #include #include +#include +#include #include #include +#include #include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include +#include #include -#include -#include +#include +#include +#include +#include +#include #include #include -#include #include +#include +#include #include +#include +#include +#include +#include +#include +#include #include #include +#include #include -#include +#include #include +#include #include -#include #include +#include #include #include +#include #include +#include +#include #include +#include #ifdef DRAW #include #include #endif -#ifdef DEB +#ifdef OCCT_DEBUG static Standard_Boolean Affich = Standard_False; static Standard_Integer NBCALL = 1; #endif //======================================================================= //function : BRepFill_TrimSurfaceTool -//purpose : Initialisation avec les deux face voisines -// Edge1 et Edge2 sont les edges paralleles correspondant -// a une iso minimum sur F1 et F2 respectivement. -// ie Edge1 est Umin ou VMin sur F1. -// Inv1 et Inv2 indique si Edge1 et Edge2 sont des -// parallleles retournees. +//purpose : Initialisation with two neighbor faces +// Edge1 and Edge2 are parallel edges corresponding +// to minimum iso on F1 and F2 respectively. +// ie Edge1 is Umin or VMin on F1. +// Inv1 and Inv2 show if Edge1 and Edge2 are +// returned parallel. //======================================================================= BRepFill_TrimSurfaceTool::BRepFill_TrimSurfaceTool @@ -85,7 +99,7 @@ myInv1(Inv1), myInv2(Inv2), myBis (Bis) { -#ifdef DEB +#ifdef OCCT_DEBUG if ( Affich) { cout << " ---------->TrimSurfaceTool : NBCALL = " << NBCALL << endl; @@ -115,7 +129,7 @@ myBis (Bis) //======================================================================= //function : Bubble -//purpose : Ordonne la sequence de point en x croissant. +//purpose : Order the sequence of points by increasing x. //======================================================================= static void Bubble(TColgp_SequenceOfPnt& Seq) @@ -148,11 +162,7 @@ static Standard_Real EvalPhase(const TopoDS_Edge& Edge, { gp_Pnt2d PE1,PE2,PF1,PF2; Standard_Real VDeg; -#ifndef DEB Standard_Real V = 0.; -#else - Standard_Real V; -#endif BRep_Tool::UVPoints(Edge,Face,PE1,PE2); VDeg = PE1.Y(); TopExp_Explorer Exp(Face,TopAbs_EDGE); @@ -166,7 +176,7 @@ static Standard_Real EvalPhase(const TopoDS_Edge& Edge, gp_Pnt P = GAS.Value(0., V); if ( gp_Vec(Axis.Location(), P).Dot(Axis.XDirection()) < 0.) - return PI; + return M_PI; else return 0.; } @@ -183,7 +193,7 @@ static void EvalParameters(const TopoDS_Edge& Edge, TColgp_SequenceOfPnt& Seq ) { Standard_Boolean Degener = BRep_Tool::Degenerated(Edge); - // recuperer les courbes 3d associees aux edges. + // return curves 3d associated to edges. TopLoc_Location L; Standard_Real f,l; @@ -205,7 +215,7 @@ static void EvalParameters(const TopoDS_Edge& Edge, Handle(Geom_Curve) C = BRep_Tool::Curve(Edge,L,f,l); CT = new Geom_TrimmedCurve(C,f,l); CT->Transform(L.Transformation()); - // projection de ces courbes 3d dans le plan xOy + // projection of 3d curves in the plane xOy Handle(Geom2d_Curve) C2d = GeomProjLib::Curve2d(CT,Plane); Geom2dAdaptor_Curve AC(C2d); @@ -266,9 +276,9 @@ static void EvalParameters(const TopoDS_Edge& Edge, NbSegments = Intersector.NbSegments(); if (NbSegments > 0) { -#ifdef DEB +#ifdef OCCT_DEBUG cout << " IntersectWith : " << NbSegments - << " Segments d`intersection" << endl; + << " Segments of intersection" << endl; #endif IntRes2d_IntersectionSegment Seg; for ( Standard_Integer i = 1; i <= NbSegments; i++) { @@ -283,7 +293,7 @@ static void EvalParameters(const TopoDS_Edge& Edge, Seq.Append(P); } } - // Ordonne la sequence en param croissant sur la bissectrice. + // Order the sequence by increasing parameter on the bissectrice. Bubble( Seq); // modified by NIZHNY-EAP Fri Dec 24 18:47:24 1999 ___BEGIN___ @@ -301,8 +311,8 @@ static void EvalParameters(const TopoDS_Edge& Edge, // modified by NIZHNY-EAP Fri Dec 24 18:47:28 1999 ___END___ } else { - // l`edge est degenere : on recupere le point et on cherche s`il est sur - // la bissectrice. + // the edge is degenerated : the point and it is found if it is + // on the bissectrice. gp_Pnt P3d = BRep_Tool::Pnt( TopExp::FirstVertex(Edge)); gp_Pnt2d P2d( P3d.X(), P3d.Y()); @@ -325,7 +335,7 @@ static void EvalParameters(const TopoDS_Edge& Edge, if ( PBis.Distance(P2d) > Tol) return; } - // eval parametre intersection. + // evaluate parameter intersection. Handle(Geom_Surface) GS = BRep_Tool::Surface(Face); GeomAdaptor_Surface GAS(GS); @@ -338,8 +348,8 @@ static void EvalParameters(const TopoDS_Edge& Edge, Axis = GAS.Sphere().Position(); break; case GeomAbs_Cone: { //---------------------------------------------------------- - // si myFace1 n est pas du meme cote de l apex que le point - // de parametre 0 0 sur le cone => phase = PI. + // if myFace1 is not at the same side of the apex as the point + // of parameter 0 0 on the cone => phase = M_PI. //---------------------------------------------------------- Axis = GAS.Cone().Position(); Phase = EvalPhase(Edge,Face,GAS,Axis); @@ -351,8 +361,8 @@ static void EvalParameters(const TopoDS_Edge& Edge, Axis = GAS.Cylinder().Position(); break; case GeomAbs_SurfaceOfRevolution: { //---------------------------------------------------------- - // si myFace1 n est pas du meme cote de l apex que le point - // de parametre 0 0 sur le cone => phase = PI. + // if myFace1 is not at the same side of the apex as the point + // of parameter 0 0 on the cone => phase = M_PI. //---------------------------------------------------------- Handle(Geom_SurfaceOfRevolution) GSRev = Handle(Geom_SurfaceOfRevolution)::DownCast(GS); @@ -373,7 +383,7 @@ static void EvalParameters(const TopoDS_Edge& Edge, Standard_Real U = Axis.XDirection(). AngleWithRef(D1,Axis.XDirection()^Axis.YDirection()); U += Phase; - if ( U < 0.) U += 2*PI; + if ( U < 0.) U += 2*M_PI; P = gp_Pnt(Bis->FirstParameter(), U, 0.); Seq.Append(P); @@ -428,7 +438,7 @@ Standard_Boolean BRepFill_TrimSurfaceTool::IsOnFace // eval if is on face 1 // modified by NIZHNY-EAP Fri Jan 21 09:49:09 2000 ___BEGIN___ - Inter.Init(myFace1, Line, 1e-6);//Precision::PConfusion()); + Inter.Init(myFace1, Line,1e-6);//Precision::PConfusion()); if (Inter.More()) return Standard_True; // eval if is on face 2 @@ -455,20 +465,17 @@ Standard_Real BRepFill_TrimSurfaceTool::ProjOn(const gp_Pnt2d& Point, Handle(Geom_TrimmedCurve) CT = new Geom_TrimmedCurve(C1,f,l); CT->Transform(L.Transformation()); - // projection de ces courbes 3d dans le plan xOy + // projection of curves 3d in the plane xOy Handle(Geom_Plane) Plane = new Geom_Plane(0,0,1,0); Handle(Geom2d_Curve) C2d = GeomProjLib::Curve2d(CT,Plane); - // eval the projection of the point on the curve. + // evaluate the projection of the point on the curve. Geom2dAPI_ProjectPointOnCurve Projector(Point, C2d); -#ifdef DEB - Standard_Real Dist = -#endif - Projector.LowerDistance(); -#ifdef DEB +#ifdef OCCT_DEBUG + Standard_Real Dist = Projector.LowerDistance(); if ( Dist > Precision::Confusion() ) { cout << " *** WARNING TrimSurfaceTool: *** " << endl; - cout << " --> le point n'est pas sur l'edge" < the point is not on the edge" <