0024915: Wrong intersection curves between two cylinders
[occt.git] / src / GeometryTest / GeometryTest_APICommands.cxx
index b19c685..a72ecf4 100644 (file)
@@ -49,12 +49,12 @@ Standard_IMPORT Draw_Viewer dout;
 //=======================================================================
 
 static Standard_Integer proj (Draw_Interpretor& di, Standard_Integer n, const char** a)
-  {
+{
   if ( n < 5)
-    {
+  {
     cout << " Use proj curve/surf x y z [extrema algo: g(grad)/t(tree)]" << endl;
     return 1;
-    }
+  }
 
   gp_Pnt P(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4]));
 
@@ -68,9 +68,9 @@ static Standard_Integer proj (Draw_Interpretor& di, Standard_Integer n, const ch
     aProjAlgo = Extrema_ExtAlgo_Tree;
 
   if (GC.IsNull())
-    {
+  {
     GS = DrawTrSurf::GetSurface(a[1]);
-    
+
     if (GS.IsNull())
       return 1;
 
@@ -81,21 +81,21 @@ static Standard_Integer proj (Draw_Interpretor& di, Standard_Integer n, const ch
 
     Standard_Real UU,VV;
     for ( Standard_Integer i = 1; i <= proj.NbPoints(); i++)
-      {
+    {
       gp_Pnt P1 = proj.Point(i);
       if ( P.Distance(P1) > Precision::Confusion())
-        {
+      {
         Handle(Geom_Line) L = new Geom_Line(P,gp_Vec(P,P1));
         Handle(Geom_TrimmedCurve) CT = 
           new Geom_TrimmedCurve(L, 0., P.Distance(P1));
-       Sprintf(name,"%s%d","ext_",i);
+        Sprintf(name,"%s%d","ext_",i);
         char* temp = name; // portage WNT
         DrawTrSurf::Set(temp, CT);
         di << name << " ";
-        }
+      }
       else
-        {
-       Sprintf(name,"%s%d","ext_",i);
+      {
+        Sprintf(name,"%s%d","ext_",i);
         di << name << " ";
         char* temp = name; // portage WNT
         DrawTrSurf::Set(temp, P1);
@@ -103,47 +103,47 @@ static Standard_Integer proj (Draw_Interpretor& di, Standard_Integer n, const ch
         di << " Le point est sur la surface." << "\n";
         di << " Ses parametres sont:  UU = " << UU << "\n";
         di << "                       VV = " << VV << "\n";
-        }
       }
     }
+  }
   else
-    {
+  {
     GeomAPI_ProjectPointOnCurve proj(P,GC,GC->FirstParameter(),
-                                                GC->LastParameter());
+      GC->LastParameter());
 
     if(proj.NbPoints() == 0)
-      {
+    {
       cout << "No project point was found." << endl;
       return 0;
-      }
+    }
 
     for ( Standard_Integer i = 1; i <= proj.NbPoints(); i++)
-      {
+    {
       gp_Pnt P1 = proj.Point(i);
       Standard_Real UU = proj.Parameter(i);
       di << " parameter " << i << " = " << UU << "\n";
       if ( P.Distance(P1) > Precision::Confusion())
-        {
+      {
         Handle(Geom_Line) L = new Geom_Line(P,gp_Vec(P,P1));
         Handle(Geom_TrimmedCurve) CT = 
-                      new Geom_TrimmedCurve(L, 0., P.Distance(P1));
-       Sprintf(name,"%s%d","ext_",i);
+          new Geom_TrimmedCurve(L, 0., P.Distance(P1));
+        Sprintf(name,"%s%d","ext_",i);
         char* temp = name; // portage WNT
         DrawTrSurf::Set(temp, CT);
         di << name << " ";
-        }
+      }
       else
-        {
-       Sprintf(name,"%s%d","ext_",i);
+      {
+        Sprintf(name,"%s%d","ext_",i);
         char* temp = name; // portage WNT
         DrawTrSurf::Set(temp, P1);
         di << name << " ";
         UU = proj.Parameter(i);
         di << " Le point est sur la courbe." << "\n";
         di << " Son parametre est U = " << UU << "\n";
-        }
       }
     }
+  }
 
   return 0;
 }