]> OCCT Git - occt.git/commitdiff
0027696: Return max distance in xdistcs Draw command
authoraml <aml@opencascade.com>
Thu, 22 Sep 2016 05:12:16 +0000 (08:12 +0300)
committerkgv <kgv@opencascade.com>
Fri, 30 Sep 2016 06:15:32 +0000 (09:15 +0300)
Message about maximal distance is added for xdistcs command.

src/GeometryTest/GeometryTest_TestProjCommands.cxx

index 2fbd7713d43fc94a9cfac9e8a9ed1be6b24bd6cc..f9b7d4eb29d45d6ad1edb5064035421fe813ea41 100644 (file)
@@ -344,6 +344,9 @@ static Standard_Integer xdistcs(Draw_Interpretor& di, Standard_Integer n, const
   iSize=3;
   //
   dT=(aT2-aT1)/(aNbP-1);
+
+  Standard_Real aMaxParam = 0.0;
+  Standard_Real aMaxDist  = 0.0;
   for (i=0; i<aNbP; ++i) {
     aT=aT1+i*dT;
     if (i==aNbP-1) {
@@ -374,7 +377,16 @@ static Standard_Integer xdistcs(Draw_Interpretor& di, Standard_Integer n, const
     //
     aMr=new Draw_Marker3D(aP, Draw_Plus, aColor, iSize);
     dout << aMr;
+
+    if (aD > aMaxDist)
+    {
+      aMaxParam = aT;
+      aMaxDist = aD;
+    }
   }
+
+  di << "Max distance = "  << aMaxDist << "\n" ;
+  di << "Param = " << aMaxParam << "\n" ;
   //
   return 0;
 }