0022312: Translation of french commentaries in OCCT files
[occt.git] / src / BRepFill / BRepFill_OffsetWire.cxx
index 22272a7..dfb7fb1 100755 (executable)
@@ -224,7 +224,7 @@ static Standard_Boolean KPartCircle
  BRepFill_IndexedDataMapOfOrientedShapeListOfShape& myMap,
  Standard_Boolean&    myIsDone)
 {
-  // Un seul contour qui est un cercle ferme
+  // The only contour which is a closed circle
   TopExp_Explorer exp(mySpine,TopAbs_EDGE);
   Standard_Integer NbEdges = 0;
   TopoDS_Edge      E;
@@ -319,7 +319,7 @@ void BRepFill_OffsetWire::Init(const TopoDS_Face&     Spine,
   myMap.Clear();
   myMapSpine.Clear();
   //------------------------------------------------------------------
-  // decoupe du spine pour les lieux bissecteurs.
+  // cut the spine for bissectors.
   //------------------------------------------------------------------
 //  Modified by Sergey KHROMOV - Tue Nov 26 17:39:03 2002 Begin
   static BRepMAT2d_Explorer Exp;
@@ -339,8 +339,8 @@ void BRepFill_OffsetWire::Init(const TopoDS_Face&     Spine,
   
 
   //-----------------------------------------------------
-  // Calcul de la carte des lieux bissecteurs a gauche.  
-  // et des Liens Topologie -> elements de base de la carte.
+  // Calculate the map of bissectors to the left.  
+  // and Links Topology -> base elements of the map.
   //-----------------------------------------------------
   
 //  Modified by Sergey KHROMOV - Tue Nov 26 17:39:03 2002 Begin
@@ -395,7 +395,7 @@ const TopTools_ListOfShape& BRepFill_OffsetWire::GeneratedShapes
 {  
   if (!myCallGen) {
     if (!myMapSpine.IsEmpty()) {
-      // myMapSpine peut etre vide si on est passe par PerformWithBilo.
+      // myMapSpine can be empty if passed by PerformWithBilo.
       TopTools_DataMapIteratorOfDataMapOfShapeShape it(myMapSpine);
       for (; it.More(); it.Next()) {
         if (myMap.Contains(it.Key())) {
@@ -632,7 +632,7 @@ void Compute (const TopoDS_Face&  Spine,
     TopoDS_Wire        NewW = TopoDS::Wire(aLocalShape);
 //    TopoDS_Wire        NewW = TopoDS::Wire(CurW.Moved(L));
     B.Add(aShape,NewW);
-    // mise a jour de la Map.
+    // update Map.
     TopoDS_Iterator it1( CurW);
     TopoDS_Iterator it2( NewW);
     for ( ; it1.More(); it1.Next(), it2.Next()) {
@@ -675,32 +675,28 @@ void BRepFill_OffsetWire::PerformWithBiLo
 }
   myMap.Clear();
 
-  //*****************************************
-  // si myOffset = 0, on ne s'emmerde pas !!
-  //*****************************************
   if ( Abs(myOffset) < Precision::Confusion()) {
     Compute(mySpine,myShape,myMap,Alt);
     myIsDone = Standard_True;
     return;
   }
 
-  //******************************
-  // Calcul pour un offset non nul 
-  //******************************
+  //********************************
+  // Calculate for a non null offset 
+  //********************************
   if (KPartCircle(mySpine,Offset,Alt,myShape,myMap,myIsDone)) return;
 
   BRep_Builder myBuilder;
   myBuilder.MakeCompound(TopoDS::Compound(myShape));
   
   //---------------------------------------------------------------------
-  // MapNodeVertex : associe a chaque noeud de la carte (key1) et
-  //                 a chaque element du profil (key2) un vertex (item).
-  // MapBis        : ensemble des edges ou vertex (item) generes par
-  //                 une bisectrice sur une face ou un edge (key)des 
-  //                 tuyaux ou revol.
-  // MapVerPar     : Map des parametres des vertex sur les edges paralleles 
-  //                 la liste contenue dans MapVerPar (E) correspond aux 
-  //                 parametres sur E des vertex contenu dans  MapBis(E);
+  // MapNodeVertex : associate to each node of the map (key1) and to
+  //                 each element of the profile (key2) a vertex (item).
+  // MapBis        : all edges or vertices (item) generated by 
+  //                 a bisectrice on a face or an edge (key) of revolution tubes.
+  // MapVerPar     : Map of parameters of vertices on parallel edges 
+  //                 the list contained in MapVerPar (E) corresponds to 
+  //                 parameters on E of vertices contained in MapBis(E);
   //---------------------------------------------------------------------
 
 
@@ -721,7 +717,7 @@ void BRepFill_OffsetWire::PerformWithBiLo
     (RefPlane->Translated( ALT * gp_Vec(RefPlane->Axis().Direction() )));
 
   //---------------------------------------------------------------
-  // Construction des Cercles et des OffsetCurves
+  // Construction of Circles and OffsetCurves
   //---------------------------------------------------------------
  
   for (Standard_Integer ic = 1; ic <= Locus.NumberOfContours(); ic++) {
@@ -743,13 +739,13 @@ void BRepFill_OffsetWire::PerformWithBiLo
 
 #ifdef DEB
   if (AffichEdge) {
-    cout << " Fin Construction des primitives geometriques"<<endl;
+    cout << " End Construction of geometric primitives "<<endl;
   }
 #endif
 
 
   //---------------------------------------------------
-  // Constructions des vertex de l offset.
+  // Construction of offset vertices.
   //---------------------------------------------------
   BRepFill_DataMapOfOrientedShapeListOfShape Detromp;
   Handle(MAT_Arc)        CurrentArc;
@@ -774,9 +770,9 @@ void BRepFill_OffsetWire::PerformWithBiLo
   }
 #endif
 
-    //-----------------------------------------------------------------------
-    // Recuperation des elements du spine correspondant aux basicElts separes.
-    //-----------------------------------------------------------------------
+    //-------------------------------------------------------------------
+    // Return elements of the spine corresponding to separate basicElts.
+    //-------------------------------------------------------------------
     S [0] = Link.GeneratingShape(CurrentArc->FirstElement());
     S [1] = Link.GeneratingShape(CurrentArc->SecondElement());
 
@@ -787,8 +783,8 @@ void BRepFill_OffsetWire::PerformWithBiLo
     BRepFill_DataMapOfShapeSequenceOfPnt   MapSeqPar;
 
     //-----------------------------------------------------------
-    // Recuperation des edges paralleles sur chaque face.
-    // Si pas d offset generees => saut a la bissectrice suivante. 
+    // Return parallel edges on each face.
+    // If no offset generated => move to the next bissectrice. 
     //--------------------------------------------------------------
     if (myMap.Contains(S[0]) && myMap.Contains(S[1])) {
       E [0] = TopoDS::Edge(myMap.FindFromKey(S[0]).First());
@@ -797,8 +793,8 @@ void BRepFill_OffsetWire::PerformWithBiLo
     else continue;
 
     //-----------------------------------------------------------
-    // Construction des vertex correspondant au noeud de la carte.
-    // si ils sont sur l offset.
+    // Construction of vertices corresponding to the node of the map.
+    // if they are on the offset.
     //-----------------------------------------------------------
     TopoDS_Vertex VS,VE;
     Handle(MAT_Node) Node1, Node2;
@@ -828,7 +824,7 @@ void BRepFill_OffsetWire::PerformWithBiLo
     }
 
     //---------------------------------------------
-    // Construction des geometries.
+    // Construction of geometries.
     //---------------------------------------------
     BRepFill_TrimEdgeTool Trim (Bisec, 
                                Locus.GeomElt(CurrentArc->FirstElement()),
@@ -836,7 +832,7 @@ void BRepFill_OffsetWire::PerformWithBiLo
                                myOffset);
 
     //-----------------------------------------------------------
-    // Construction des vertex sur les edges paralleles au spine.
+    // Construction of vertices on edges parallel to the spine.
     //-----------------------------------------------------------
 
     Trim.IntersectWith(E [0], E [1], Params);
@@ -857,7 +853,7 @@ void BRepFill_OffsetWire::PerformWithBiLo
         Vertices.SetValue(1,VS);
       
       else
-       // le point n avait pas ete trouve par IntersectWith
+       // the point was not found by IntersectWith
        Vertices.Prepend(VS);
     }
     if (EndOnEdge) {     
@@ -867,17 +863,17 @@ void BRepFill_OffsetWire::PerformWithBiLo
         Vertices.SetValue(Params.Length(),VE);
       
       else
-       // le point n avait pas ete trouve par IntersectWith
+       // the point was not found by IntersectWith
        Vertices.Append(VE);
     }
 
     //------------------------------------------------------------
-    // Mise a jour Detromp.
-    // Detromp permetra  de supprimer les vertex sur l offset 
-    // correspondant a des zones de tangences
-    // dans Detromp sont ranges les vertex qui limitent
-    // les portions de la bissectrices situes entre le spine et 
-    // offset.
+    // Update Detromp.
+    // Detromp allows to remove vertices on the offset 
+    // corresponding to tangency zones
+    // Detromp ranks the vertices that limit
+    // the parts of the bissectrices located between the spine and the 
+    // offset.
     //------------------------------------------------------------
     if (!Detromp.IsBound(S[0])) Detromp.Bind(S[0],EmptyList);
     if (!Detromp.IsBound(S[1])) Detromp.Bind(S[1],EmptyList);
@@ -886,8 +882,8 @@ void BRepFill_OffsetWire::PerformWithBiLo
     UpdateDetromp (Detromp(S[0]), Detromp(S[1]), Vertices, Params, 
                   Bisec, StartOnEdge, EndOnEdge, Trim);
     //----------------------------------------------
-    // Stockage des vertex sur les edges paralleles.
-    // on remplit MapBis et MapVerPar.
+    // Storage of vertices on parallel edges.
+    // fill MapBis and MapVerPar.
     //----------------------------------------------
     if (!Vertices.IsEmpty()) {
       for (k = 0; k <= 1; k++) {
@@ -904,11 +900,10 @@ void BRepFill_OffsetWire::PerformWithBiLo
     }
     else {
       //------------------------------------------------------------
-      //POUR LES CERCLES COMPLETS . la parallele peut etre contenue
-      // dans la zone sans intersection avec la frontiere
-      // pas d intersection 
-      // si myoffset est < distance des noeuds la parallele peut etre
-      // valide.
+      // FOR COMPLETE CIRCLES. the parallel line can be contained
+      // in the zone without intersection with the border
+      // no intersection 
+      // if myoffset is < distance of nodes the parallel can be valid.
       //-------------------------------------------------------------
       for (k = 0; k <= 1; k++) {
        if (!MapBis.IsBound(E[k])) {
@@ -923,12 +918,12 @@ void BRepFill_OffsetWire::PerformWithBiLo
   
 #ifdef DEB 
   if (AffichEdge) {
-    cout << " Fin Construction des vertex sur les offsets"<<endl;
+    cout << " End Construction of vertices on offsets"<<endl;
   }
 #endif
 
   //----------------------------------
-  // Construction des edges paralleles.
+  // Construction of parallel edges.
   //----------------------------------
   TopTools_IndexedDataMapOfShapeShape MapVV;
 
@@ -955,7 +950,7 @@ void BRepFill_OffsetWire::PerformWithBiLo
       }
       else {
        //-----------------
-       // Cercles complets
+       // Complete circles
        //-----------------
        myMap(j).Append(CurrentEdge);
       }
@@ -992,11 +987,11 @@ void BRepFill_OffsetWire::PerformWithBiLo
     }
       
   //----------------------------------
-  // Constructions des wires offset.
+  // Construction of offset wires.
   //----------------------------------
   MakeWires ();
 
-  // Mise a jour des vertex ( Construits dans le plan Z = 0) !!!
+  // Update vertices ( Constructed in the plane Z = 0) !!!
   TopTools_MapOfShape MapVertex;
   for ( TopExp_Explorer exp(myShape,TopAbs_VERTEX); exp.More(); exp.Next()) {
     TopoDS_Vertex V = TopoDS::Vertex(exp.Current());
@@ -1007,7 +1002,7 @@ void BRepFill_OffsetWire::PerformWithBiLo
     }
   }
 
-  // Constructions des courbes 3d.
+  // Construction of curves 3d.
   BRepLib::BuildCurves3d(myShape);
   MapVertex.Clear();
   TopExp_Explorer Explo( myShape, TopAbs_EDGE );
@@ -1109,7 +1104,7 @@ void BRepFill_OffsetWire::PrepareSpine()
       myMapSpine.Bind(V2,V2);
       Cuts.Clear();
 
-      // Decoupe
+      // Cut
       TopoDS_Shape aLocalShape = E.Oriented(TopAbs_FORWARD);
 //  Modified by Sergey KHROMOV - Thu Nov 16 17:29:29 2000 Begin
       if (nbEdges == 2 && nbResEdges == 0)
@@ -1161,7 +1156,7 @@ void BRepFill_OffsetWire::PrepareSpine()
 void BRepFill_OffsetWire::MakeWires()
 {
   //--------------------------------------------------------
-  // creation d une liste unique des edges paralelles crees.
+  // creation of a single list of created parallel edges.
   //--------------------------------------------------------
   TopTools_SequenceOfShape TheEdges;
   TopTools_ListOfShape     TheWires;
@@ -1192,7 +1187,7 @@ void BRepFill_OffsetWire::MakeWires()
   }
 
   //--------------------------------------
-  // Creation des wires paralleles.
+  // Creation of parallel wires.
   //--------------------------------------
   BRep_Builder B;
 
@@ -1227,7 +1222,7 @@ void BRepFill_OffsetWire::MakeWires()
 
     while(!End) {      
       //-------------------------------
-      // Construction d un wire.
+      // Construction of a wire.
       //-------------------------------
       TopExp::Vertices(CE,V1,V2);
       if (!CV.IsSame(V1)) CV = V1; else CV = V2;
@@ -1250,7 +1245,7 @@ void BRepFill_OffsetWire::MakeWires()
 
       if (!End) {
        if (MVE.FindFromKey(CV).Extent() > 2) {
-         //cout <<"vertex sur plus de 2 edges dans une face."<<endl;
+         //cout <<"vertex on more that 2 edges in a face."<<endl;
        }
        for ( itl.Initialize(MVE.FindFromKey(CV)); itl.More(); itl.Next()) {
          if (itl.Value().IsSame(CE)) {
@@ -1281,9 +1276,9 @@ void BRepFill_OffsetWire::MakeWires()
     TheWires.Append(NW);
   }
 
-  // mise a jour de myShape :
-  //      -- si un seul wire    : myShape est un Wire
-  //      -- si plusieurs wires : myShape est un Compound.
+  // update myShape :
+  //      -- if only one wire : myShape is a Wire
+  //      -- if several wires : myShape is a Compound.
   if ( TheWires.Extent() == 1) {
     myShape = TheWires.First();
   }
@@ -1572,13 +1567,11 @@ void BRepFill_OffsetWire::FixHoles()
 
 //=======================================================================
 //function : CutEdge
-//purpose  : Decoupe d une edge aux extrema de courbures et aux points
-//           d inflexion.
-//           Les cercles fermes sont aussi decoupes en deux.
-//           Si <Cuts> est vide l edge n est pas modifie.
-//           Le premier et le dernier vertex de l edge originale
-//           appartiennent respectivement a la premiere et derniere
-//           portions.
+//purpose  : Cut edge at the extrema of curvatures and points of inflexion.
+//           So, closed circles are cut in two.
+//           If <Cuts> is empty, the edge is not modified.
+//           The first and the last vertex of the initial edge 
+//           belong to the first and the last parts respectively.
 //=======================================================================
 Standard_Integer CutEdge (const TopoDS_Edge& E, 
                          const TopoDS_Face& F,
@@ -1611,7 +1604,7 @@ Standard_Integer CutEdge (const TopoDS_Edge& E,
       ( Abs(f-l) >= PI) ) {
     return 0;
     //---------------------------
-    // Decoupe cercle ferme.
+    // Cut closed circle.
     //---------------------------
     Standard_Real m = (f + l)*0.5;
 //  Modified by Sergey KHROMOV - Wed Mar  6 17:37:28 2002 Begin
@@ -1636,13 +1629,13 @@ Standard_Integer CutEdge (const TopoDS_Edge& E,
     Cuts.Append(FE.Oriented(E.Orientation()));
     Cuts.Append(LE.Oriented(E.Orientation()));
     //--------
-    // Retour.
+    // Return.
     //--------
     return 2;
   }
 
   //-------------------------
-  // Decoupe de la courbe.
+  // Cut curve.
   //-------------------------
   Cuter.Perform(CT2d);
 
@@ -1650,7 +1643,7 @@ Standard_Integer CutEdge (const TopoDS_Edge& E,
   if (ForceCut == 0) {
     if (Cuter.UnModified()) {
     //-----------------------------
-    // edge non modifiee => retour.
+    // edge not modified => return.
     //-----------------------------
       return 0;
     } else {
@@ -1687,7 +1680,7 @@ Standard_Integer CutEdge (const TopoDS_Edge& E,
 //  Modified by Sergey KHROMOV - Thu Nov 16 17:28:37 2000 End
 
   //--------------------------------------
-  // Creation des edges decoupees.
+  // Creation of cut edges.
   //--------------------------------------
   VF = V1;
 
@@ -1779,7 +1772,7 @@ void MakeCircle (const TopoDS_Edge&          E,
                       BRepFill_IndexedDataMapOfOrientedShapeListOfShape& Map,
                 const Handle(Geom_Plane)&   RefPlane)
 {
-  // eval the Axis of the Circle.
+  // evaluate the Axis of the Circle.
   Standard_Real f,l;
   Handle(Geom2d_Curve) GC = BRep_Tool::CurveOnSurface(E,F,f,l);
   gp_Vec2d DX;
@@ -1831,8 +1824,8 @@ void MakeOffset (const TopoDS_Edge&        E,
 
   Geom2dAdaptor_Curve  AC(G2d,f,l);
   if ( AC.GetType() == GeomAbs_Circle) {
-    // si l offset est superieur ou egal au rayon et du cote de la 
-    // concavite du cercle => edge null.
+    // if the offset is greater otr equal to the radius and the side of the  
+    // concavity of the circle => edge null.
     gp_Circ2d C1(AC.Circle());
 #ifdef DEB
     Standard_Real radius = 
@@ -1845,7 +1838,7 @@ void MakeOffset (const TopoDS_Edge&        E,
     Standard_Real Signe = ( Crossed > 0.) ? 1. : -1.;
 
     if (anOffset*Signe < AC.Circle().Radius()) {
-      // -anOffset vient d une Etrangete adaptoresque!
+
       Handle(Geom2dAdaptor_HCurve) AHC = 
        new Geom2dAdaptor_HCurve(G2d);
       Adaptor3d_OffsetCurve   Off(AHC,-anOffset);
@@ -1895,12 +1888,12 @@ void MakeOffset (const TopoDS_Edge&        E,
 
 //=======================================================================
 //function : UpdateDetromp
-//purpose  : Pour chaque interval sur la bissectrice defini par params
-//           test si le point milieu est a une distance > offset       
-//           dans ce cas les vertex correspondants aux extremites de l interval
-//           sont ranges dans le detrompeur.
-//           => Si un meme vertex apparait deux fois dans le detrompeur la 
-//           frontiere de la zone de proximitee est tangente a l offset .
+//purpose  : For each interval on bissectrice defined by parameters
+//           test if the medium point is at a distance > offset        
+//           in this case vertices corresponding to the extremities of the interval
+//           are ranked in the proofing.
+//           => If the same vertex appears in the proofing, the 
+//           border of the zone of proximity is tangent to the offset .
 //=======================================================================
 
 void UpdateDetromp (TopTools_ListOfShape&           Detromp1,
@@ -1921,7 +1914,7 @@ void UpdateDetromp (TopTools_ListOfShape&           Detromp1,
   U1 = Bis->FirstParameter();
   
   if (SOnE) { 
-    // le premier point de la bissectrice est sur l offset
+    // the first point of the bissectrice is on the offset
     V1 = TopoDS::Vertex(Vertices.Value(ii));
     ii++; 
   }
@@ -1944,7 +1937,7 @@ void UpdateDetromp (TopTools_ListOfShape&           Detromp1,
     ii ++;
   }
 
-  // test point milieu entre le dernier params et la fin de la bissectrice.
+  // test medium point between the last parameter and the end of the bissectrice.
   U2 = Bis->LastParameter();
   if (!EOnE) {
     if (!Precision::IsInfinite(U2)) {
@@ -1982,7 +1975,7 @@ Standard_Boolean VertexFromNode (const Handle(MAT_Node)&      aNode,
 
   if (!aNode->Infinite() && Abs(aNode->Distance()-Offset) < Tol) {
     //------------------------------------------------
-    // le Noeud donne un vertex sur l offset
+    // the Node gives a vertex on the offset
     //------------------------------------------------
     if (MapNodeVertex.IsBound(aNode)) {
       VN = TopoDS::Vertex(MapNodeVertex(aNode));
@@ -2043,7 +2036,7 @@ void TrimEdge (const TopoDS_Edge&              E,
   S.Clear();
 
   //-----------------------------------------------------------
-  // Tri des deux sequences en fonction du parametre sur l edge.
+  // Parse two sequences depending on the parameter on the edge.
   //-----------------------------------------------------------
   while (Change) {
     Change = Standard_False;
@@ -2057,7 +2050,7 @@ void TrimEdge (const TopoDS_Edge&              E,
   }
 
   //----------------------------------------------------------
-  // Si un vertex n est pas dans le detrompeur il est elimine.
+  // If a vertex is not in the proofing, it is eliminated.
   //----------------------------------------------------------
   if (!BRep_Tool::Degenerated(E)) {
     for (Standard_Integer k = 1; k <= TheVer.Length(); k ++) {
@@ -2071,9 +2064,9 @@ void TrimEdge (const TopoDS_Edge&              E,
   }
 
   //----------------------------------------------------------
-  // Si un vertex_double apparait deux fois dans le detrompeur
-  // le vertex est elimine .
-  // sinon on garde une seule de ces representations.
+  // If a vertex_double appears twice in the proofing 
+  // the vertex is removed.
+  // otherwise preserve only one of its representations.
   //----------------------------------------------------------
   if (!BRep_Tool::Degenerated(E)) {
     for (Standard_Integer k = 1; k < TheVer.Length(); k ++) {
@@ -2103,9 +2096,9 @@ void TrimEdge (const TopoDS_Edge&              E,
     }
   }
   //-----------------------------------------------------------
-  // Creation des edges.
-  // le nombre de vertex doit etre pair les edges a creer vont 
-  // d un vertex d indice impair i au vertex i+1;
+  // Creation of edges.
+  // the number of vertices should be even. The created edges  
+  // go from a vertex with uneven index i to vertex i+1;
   //-----------------------------------------------------------
   for (Standard_Integer k = 1; k < TheVer.Length(); k = k+2) {
     TopoDS_Shape aLocalShape = E.EmptyCopied();
@@ -2150,7 +2143,7 @@ void TrimEdge (const TopoDS_Edge&              E,
 
 //=======================================================================
 //function : DoubleOrNotInside
-//purpose  : return True si V apparait 2 fois dans LV ou n est pas dedans.
+//purpose  : return True if V appears twice in LV or is not inside.
 //=======================================================================
 
 Standard_Boolean DoubleOrNotInside (const TopTools_ListOfShape& LV,
@@ -2369,7 +2362,7 @@ static void QuasiFleche(const Adaptor3d_Curve& C,
   Standard_Real theFleche=0;
   Standard_Boolean flecheok = Standard_False;
   if (Norme > Eps) { 
-    // Evaluation de la fleche par interpolation . Voir IntWalk_IWalking_5.gxx
+    // Evaluation of the arrow by interpolation. See IntWalk_IWalking_5.gxx
     Standard_Real N1 = Vdeb.SquareMagnitude();
     Standard_Real N2 = Vdelta.SquareMagnitude();
     if (N1 > Eps && N2 > Eps) {