0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / src / GeomliteTest / GeomliteTest_ApproxCommands.cxx
index d6669f1..c88e2e4 100644 (file)
 #include <Draw.hxx>
 #include <Draw_Appli.hxx>
 #include <Draw_Interpretor.hxx>
-#include <Precision.hxx>
 #include <Draw_Marker3D.hxx>
 #include <Draw_Marker2D.hxx>
-#include <TColgp_HArray1OfPnt.hxx>
 #include <TColgp_SequenceOfPnt.hxx>
 #include <Geom_BSplineCurve.hxx>
 #include <Geom_BezierCurve.hxx>
-#include <TColgp_HArray1OfPnt2d.hxx>
 #include <TColgp_SequenceOfPnt2d.hxx>
 
 #include <Geom2d_BSplineCurve.hxx>
 #include <TColgp_HArray1OfPnt.hxx>
 #include <TColgp_Array1OfPnt.hxx>
 #include <TColgp_Array1OfPnt2d.hxx>
-#include <TColgp_HArray1OfVec.hxx>
-#include <TColgp_Array1OfVec.hxx>
-#include <TColStd_Array1OfReal.hxx>
-#include <TColStd_HArray1OfReal.hxx>
-#include <TColStd_HArray1OfBoolean.hxx>
-#include <Handle_TColStd_HArray1OfReal.hxx>
-#include <Handle_TColStd_HArray1OfBoolean.hxx>
-
-#include <AppParCurves_MultiBSpCurve.hxx>
-#include <AppParCurves_MultiCurve.hxx>
-#include <AppDef_MultiLine.hxx>
-#include <AppDef_TheVariational.hxx>
+
+#include <AppDef_Variational.hxx>
 #include <AppDef_Compute.hxx>
 #include <AppParCurves_HArray1OfConstraintCouple.hxx>
 #include <AppParCurves_ConstraintCouple.hxx>
 #include <AppDef_HArray1OfMultiPointConstraint.hxx>
 #include <AppDef_Array1OfMultiPointConstraint.hxx>
-#include <math_Vector.hxx>
 
-#ifdef WNT
-#include <stdio.h>
+#ifdef _WIN32
 Standard_IMPORT Draw_Viewer dout;
 #endif
 
@@ -125,7 +110,7 @@ static Standard_Integer PointsByPick
 {
  Standard_Integer id,XX,YY,b, i;
  
- di << "Pick points "<< "\n";
+ di << "Pick points \n";
  dout.Select(id, XX, YY, b);
  Standard_Real zoom = dout.Zoom(id);
  if (b != 1) return 0;
@@ -163,9 +148,9 @@ static Standard_Integer PointsByPick
    AppDef_MultiPointConstraint mpc(1,0);
    MPC->ChangeArray1().Init(mpc);
    for (i=1; i<=ThePoints.Length(); i++) {
-      AppDef_MultiPointConstraint mpc(1,0);
-      mpc.SetPoint(1, ThePoints.Value(i));
-      MPC->SetValue(i, mpc); 
+      AppDef_MultiPointConstraint aLocalMpc(1,0);
+      aLocalMpc.SetPoint(1, ThePoints.Value(i));
+      MPC->SetValue(i, aLocalMpc);
    }  
  }
  
@@ -208,7 +193,7 @@ static Standard_Integer PointsByPick
 //=======================================================================
 static void PointsByFile(Handle(AppDef_HArray1OfMultiPointConstraint)& MPC,
                         Handle(AppParCurves_HArray1OfConstraintCouple)& TABofCC,
-                        ifstream& iFile,
+                        std::ifstream& iFile,
                         Draw_Interpretor& di)
 {
   Standard_Integer nbp, i, nbc;
@@ -252,7 +237,7 @@ static void PointsByFile(Handle(AppDef_HArray1OfMultiPointConstraint)& MPC,
       for(i=1; i<=nbc; i++) {
        iFile >> num >> ordre;
        if ((num<1)||(num>nbp)) {
-         di << "Error on point Index in constrainte" << "\n";
+         di << "Error on point Index in constrainte\n";
          return;
        }
        Constraint = (AppParCurves_Constraint) (ordre+1);
@@ -303,7 +288,7 @@ static void PointsByFile(Handle(AppDef_HArray1OfMultiPointConstraint)& MPC,
       for(i=1; i<=nbc; i++) {
        iFile >> num >> ordre;
        if ((num<1)||(num>nbp)) {
-         di << "Error on point Index in constrainte" << "\n";
+         di << "Error on point Index in constrainte\n";
          return;
        }
        Constraint = (AppParCurves_Constraint) (ordre+1);
@@ -341,11 +326,11 @@ static Standard_Integer smoothing (Draw_Interpretor& di,Standard_Integer n, cons
   Standard_Integer id = 0, DegMax = -1;
 
   if (n == 1) {
-    di <<"give a name to your curve !" << "\n";
+    di <<"give a name to your curve !\n";
     return 0;
   }
   if (n == 2) {
-    di <<"give a tolerance to your curve !" << "\n";
+    di <<"give a tolerance to your curve !\n";
     return 0;
   }
   if (n == 3) {
@@ -378,9 +363,9 @@ static Standard_Integer smoothing (Draw_Interpretor& di,Standard_Integer n, cons
       // lecture du fichier.
     // nbpoints, 2d ou 3d, puis valeurs.
       const char* nomfic = a[ific];
-      ifstream iFile(nomfic, ios::in);
+      std::ifstream iFile(nomfic, std::ios::in);
       if (!iFile) { 
-       di << a[ific] <<"do not exist !" << "\n";
+       di << a[ific] <<"do not exist !\n";
        return 1;
       }
       PointsByFile(Points, TABofCC, iFile, di);
@@ -408,7 +393,7 @@ static Standard_Integer smoothing (Draw_Interpretor& di,Standard_Integer n, cons
       }
     }
 
-    AppDef_TheVariational Variation(AML, 
+    AppDef_Variational Variation(AML, 
                                    1, NbPoints,
                                    TABofCC);
     
@@ -421,8 +406,8 @@ static Standard_Integer smoothing (Draw_Interpretor& di,Standard_Integer n, cons
     if (Tolerance>0) { Variation.SetWithMinMax(Standard_True);}
     Variation.Approximate();
 
-#  ifdef DEB
-    //Variation.Dump(cout);
+#  ifdef GEOMLITETEST_DEB
+    //Variation.Dump(std::cout);
     Standard_SStream aSStream;
     Variation.Dump(aSStream);
     di << aSStream;
@@ -454,7 +439,7 @@ static Standard_Integer smoothing (Draw_Interpretor& di,Standard_Integer n, cons
       }
     } 
 
-    AppDef_TheVariational Variation(AML, 
+    AppDef_Variational Variation(AML, 
                                    1,  NbPoints,
                                    TABofCC);
 
@@ -466,8 +451,8 @@ static Standard_Integer smoothing (Draw_Interpretor& di,Standard_Integer n, cons
     Variation.SetTolerance( Abs(Tolerance));
     if (Tolerance>0) { Variation.SetWithMinMax(Standard_True);}
     Variation.Approximate();
-#     ifdef DEB
-    //Variation.Dump(cout);
+#     ifdef GEOMLITETEST_DEB
+    //Variation.Dump(std::cout);
     Standard_SStream aSStream;
     Variation.Dump(aSStream);
     di << aSStream;
@@ -508,20 +493,20 @@ static Standard_Integer smoothingbybezier (Draw_Interpretor& di,
   Standard_Integer Degree = 8;
 
   if (n == 1) {
-    di <<"give a name to your curve !" << "\n";
+    di <<"give a name to your curve !\n";
     return 0;
   }
   if (n == 2) {
-    di <<"give a tolerance to your curve !" << "\n";
+    di <<"give a tolerance to your curve !\n";
     return 0;
   }
  if (n == 3) {
-    di <<"give a max degree!" << "\n";
+    di <<"give a max degree!\n";
     return 0;
   }
 
   if (n == 4) {
-    di <<"give an option!" << "\n";
+    di <<"give an option!\n";
     return 0;
   }
   if (n >= 5) {
@@ -548,9 +533,9 @@ static Standard_Integer smoothingbybezier (Draw_Interpretor& di,
       // lecture du fichier.
       // nbpoints, 2d ou 3d, puis valeurs.
       const char* nomfic = a[5];
-      ifstream iFile(nomfic, ios::in);
+      std::ifstream iFile(nomfic, std::ios::in);
       if (!iFile) { 
-       di << a[6] <<"do not exist !" << "\n";
+       di << a[6] <<"do not exist !\n";
        return 1;
       }
       PointsByFile(Points, TABofCC, iFile, di);
@@ -602,7 +587,7 @@ static Standard_Integer smoothingbybezier (Draw_Interpretor& di,
       Appr.Perform (AML);
       
       if (! Appr.IsAllApproximated()) {
-       di << " No result" << "\n";
+       di << " No result\n";
       }
       AppParCurves_MultiCurve AnMuC = Appr.Value();
       ThePoints = new (TColgp_HArray1OfPnt2d) (1,  AnMuC.NbPoles() );
@@ -612,7 +597,7 @@ static Standard_Integer smoothingbybezier (Draw_Interpretor& di,
       di <<" Error2D is : " << err2d << "\n";
     }
     else {
-      AppDef_TheVariational Varia(AML, 
+      AppDef_Variational Varia(AML, 
                                  1,  NbPoints,
                                  TABofCC,
                                  Degree, 1);
@@ -620,7 +605,7 @@ static Standard_Integer smoothingbybezier (Draw_Interpretor& di,
       Varia.Approximate();
 
       if (! Varia.IsDone()) {
-       di << " No result" << "\n";
+       di << " No result\n";
       }
 
       AppParCurves_MultiBSpCurve  AnMuC = Varia.Value();
@@ -677,7 +662,7 @@ static Standard_Integer smoothingbybezier (Draw_Interpretor& di,
       Appr.Perform (AML);
       
       if (! Appr.IsAllApproximated()) {
-       di << " No result" << "\n";
+       di << " No result\n";
       }
       AppParCurves_MultiCurve AnMuC = Appr.Value();
       ThePoints = new (TColgp_HArray1OfPnt) (1,  AnMuC.NbPoles() );
@@ -687,7 +672,7 @@ static Standard_Integer smoothingbybezier (Draw_Interpretor& di,
       di <<" Error3D is : " << err << "\n";
     }
     else {
-      AppDef_TheVariational Varia(AML, 
+      AppDef_Variational Varia(AML, 
                                  1,  NbPoints,
                                  TABofCC,
                                  Degree, 1);
@@ -695,7 +680,7 @@ static Standard_Integer smoothingbybezier (Draw_Interpretor& di,
       Varia.SetTolerance(Abs(Tolerance));
       Varia.Approximate();
       if (! Varia.IsDone()) {
-       di << " No result" << "\n";
+       di << " No result\n";
       }
 
       AppParCurves_MultiBSpCurve  AnMuC = Varia.Value();