-// File: GeometryTest_FairCurveCommands.cxx
-// Created: Wed Oct 9 11:09:12 1996
-// Author: Philippe MANGIN
-// <pmn@sgi29>
+// Created on: 1996-10-09
+// Created by: Philippe MANGIN
+// Copyright (c) 1996-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 <GeometryTest.ixx>
-
#include <Draw.hxx>
+#include <DrawFairCurve_Batten.hxx>
+#include <DrawFairCurve_MinimalVariation.hxx>
#include <DrawTrSurf.hxx>
#include <DrawTrSurf_Point.hxx>
-#include <gp_Pnt2d.hxx>
#include <FairCurve_AnalysisCode.hxx>
#include <FairCurve_Batten.hxx>
#include <FairCurve_MinimalVariation.hxx>
-#include <DrawFairCurve_Batten.hxx>
-#include <DrawFairCurve_MinimalVariation.hxx>
-#include <string.h>
+#include <GeometryTest.hxx>
+#include <gp_Pnt2d.hxx>
+#include <string.h>
//=======================================================================
Standard_Boolean IsGoodNumber(Standard_Integer argc, Standard_Integer waiting, Draw_Interpretor& di)
//=======================================================================
// argc vaut 1 de plus, puisque argv[0] contient le nom de la commande
if (argc != (waiting+1))
{
- di << "Waiting "<< waiting << " arguments" << "\n";
+ di << "Waiting "<< waiting << " arguments\n";
return Standard_False;
}
else
const char *cheigth = argv[5];
const char *BattenName = argv[6];
- Standard_Boolean Ok;
FairCurve_AnalysisCode Iana;
- Standard_Real a1 = atof(cangle1),
- a2 = atof(cangle2),
- h = atof(cheigth);
+ Standard_Real a1 = Draw::Atof(cangle1),
+ a2 = Draw::Atof(cangle2),
+ h = Draw::Atof(cheigth);
gp_Pnt2d P1, P2;
if (! DrawTrSurf::GetPoint2d(cp2, P2) ) return 1;
FairCurve_Batten* Bat = new FairCurve_Batten (P1, P2, h);
- Bat->SetAngle1(a1*PI/180);
- Bat->SetAngle2(a2*PI/180);
+ Bat->SetAngle1(a1*M_PI/180);
+ Bat->SetAngle2(a2*M_PI/180);
- Ok = Bat->Compute(Iana);
+ Bat->Compute(Iana);
Handle(DrawFairCurve_Batten) aBatten = new DrawFairCurve_Batten(Bat);
if (aBatten.IsNull()) {
- di << " Batten null "<< "\n";
+ di << " Batten null \n";
return 1;
}
Draw::Set(BattenName,aBatten);
const char *cheigth = argv[5];
const char *MVCName = argv[6];
- Standard_Boolean Ok;
FairCurve_AnalysisCode Iana;
- Standard_Real a1 = atof(cangle1),
- a2 = atof(cangle2),
- h = atof(cheigth);
+ Standard_Real a1 = Draw::Atof(cangle1),
+ a2 = Draw::Atof(cangle2),
+ h = Draw::Atof(cheigth);
gp_Pnt2d P1, P2;
if (! DrawTrSurf::GetPoint2d(cp2, P2) ) return 1;
FairCurve_MinimalVariation* MVC = new FairCurve_MinimalVariation (P1, P2, h);
- MVC->SetAngle1(a1*PI/180);
- MVC->SetAngle2(a2*PI/180);
+ MVC->SetAngle1(a1*M_PI/180);
+ MVC->SetAngle2(a2*M_PI/180);
- Ok = MVC->Compute(Iana);
+ MVC->Compute(Iana);
Handle(DrawFairCurve_MinimalVariation) aMVC = new DrawFairCurve_MinimalVariation(MVC);
if (aMVC.IsNull()) {
- di << " MVC null "<< "\n";
+ di << " MVC null \n";
return 1;
}
Draw::Set(MVCName, aMVC);
const char *PointName = argv[2];
const char *BattenName = argv[3];
- Standard_Integer cote = atoi(side);
+ Standard_Integer cote = Draw::Atoi(side);
Handle(DrawTrSurf_Point)
Pnt = Handle(DrawTrSurf_Point)::DownCast(Draw::Get(PointName));
const char *val = argv[2];
const char *BattenName = argv[3];
- Standard_Real angle = atof(val);
- Standard_Integer cote = atoi(side);
+ Standard_Real angle = Draw::Atof(val);
+ Standard_Integer cote = Draw::Atoi(side);
Handle(DrawFairCurve_Batten)
Bat = Handle(DrawFairCurve_Batten)::DownCast(Draw::Get(BattenName));
const char *val = argv[2];
const char *MVCName = argv[3];
- Standard_Real rho = atof(val);
- Standard_Integer cote = atoi(side);
+ Standard_Real rho = Draw::Atof(val);
+ Standard_Integer cote = Draw::Atoi(side);
Handle(DrawFairCurve_MinimalVariation)
MVC = Handle(DrawFairCurve_MinimalVariation)::DownCast(Draw::Get(MVCName));
const char *val = argv[1];
const char *BattenName = argv[2];
- Standard_Real slide = atof(val);
+ Standard_Real slide = Draw::Atof(val);
Handle(DrawFairCurve_Batten)
Bat = Handle(DrawFairCurve_Batten)::DownCast(Draw::Get(BattenName));
const char *side = argv[1];
const char *BattenName = argv[2];
- Standard_Integer cote = atoi(side);
+ Standard_Integer cote = Draw::Atoi(side);
Handle(DrawFairCurve_Batten)
Bat = Handle(DrawFairCurve_Batten)::DownCast(Draw::Get(BattenName));
const char *side = argv[1];
const char *MVCName = argv[2];
- Standard_Integer cote = atoi(side);
+ Standard_Integer cote = Draw::Atoi(side);
Handle(DrawFairCurve_MinimalVariation)
MVC = Handle(DrawFairCurve_MinimalVariation)::DownCast(Draw::Get(MVCName));
const char *val = argv[1];
const char *BattenName = argv[2];
- Standard_Real Height = atof(val);
+ Standard_Real Height = Draw::Atof(val);
Handle(DrawFairCurve_Batten)
Bat = Handle(DrawFairCurve_Batten)::DownCast(Draw::Get(BattenName));
const char *val = argv[1];
const char *BattenName = argv[2];
- Standard_Real Slope = atof(val);
+ Standard_Real Slope = Draw::Atof(val);
Handle(DrawFairCurve_Batten)
Bat = Handle(DrawFairCurve_Batten)::DownCast(Draw::Get(BattenName));
const char *val = argv[1];
const char *MVCName = argv[2];
- Standard_Real ratio = atof(val);
+ Standard_Real ratio = Draw::Atof(val);
Handle(DrawFairCurve_MinimalVariation)
MVC = Handle(DrawFairCurve_MinimalVariation)::DownCast(Draw::Get(MVCName));