-// File: QANewDBRepNaming_PrimitiveCommands.cxx
-// Created: Thu Dec 23 11:25:57 1999
-// Author: Vladislav ROMASHKO
-// <vro@flox.nnov.matra-dtv.fr>
+// Created on: 1999-12-23
+// Created by: Vladislav ROMASHKO
+// Copyright (c) 1999-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 <QANewDBRepNaming.ixx>
-
-#include <Draw.hxx>
-#include <Draw_Interpretor.hxx>
-
+#include <BRep_Tool.hxx>
+#include <BRepAdaptor_Surface.hxx>
+#include <BRepFilletAPI_MakeChamfer.hxx>
+#include <BRepFilletAPI_MakeFillet.hxx>
+#include <BRepPrimAPI_MakeBox.hxx>
+#include <BRepPrimAPI_MakeCylinder.hxx>
+#include <BRepPrimAPI_MakePrism.hxx>
+#include <BRepPrimAPI_MakeRevol.hxx>
+#include <BRepPrimAPI_MakeSphere.hxx>
#include <DBRep.hxx>
-
#include <DDF.hxx>
-
-#include <TNaming_NamedShape.hxx>
-#include <TNaming_Tool.hxx>
-#include <TNaming_Builder.hxx>
-
-#include <TopoDS.hxx>
-#include <TopoDS_Shape.hxx>
-#include <TopoDS_Face.hxx>
-#include <TopoDS_Wire.hxx>
-#include <TopoDS_Edge.hxx>
+#include <Draw.hxx>
+#include <Draw_Interpretor.hxx>
#include <gp_Pln.hxx>
-
+#include <QADNaming.hxx>
#include <QANewBRepNaming_Box.hxx>
+#include <QANewBRepNaming_Chamfer.hxx>
#include <QANewBRepNaming_Cylinder.hxx>
-#include <QANewBRepNaming_Sphere.hxx>
+#include <QANewBRepNaming_Fillet.hxx>
+#include <QANewBRepNaming_ImportShape.hxx>
#include <QANewBRepNaming_Prism.hxx>
#include <QANewBRepNaming_Revol.hxx>
-#include <QANewBRepNaming_ImportShape.hxx>
-
-#include <BRepPrimAPI_MakeCylinder.hxx>
-#include <BRepPrimAPI_MakeSphere.hxx>
-
-#include <BRepPrimAPI_MakePrism.hxx>
-#include <BRepPrimAPI_MakeRevol.hxx>
-#include <BRepPrimAPI_MakeBox.hxx>
-
-#include <BRepAdaptor_Surface.hxx>
-
+#include <QANewBRepNaming_Sphere.hxx>
+#include <QANewDBRepNaming.hxx>
#include <TDataXtd_Geometry.hxx>
-
+#include <TNaming_Builder.hxx>
+#include <TNaming_NamedShape.hxx>
+#include <TNaming_Tool.hxx>
#include <TopExp.hxx>
-
-#include <BRep_Tool.hxx>
-
#include <TopExp_Explorer.hxx>
-
-#include <QADNaming.hxx>
-#include <BRepFilletAPI_MakeFillet.hxx>
-#include <QANewBRepNaming_Fillet.hxx>
-#include <BRepFilletAPI_MakeChamfer.hxx>
-#include <QANewBRepNaming_Chamfer.hxx>
+#include <TopoDS.hxx>
+#include <TopoDS_Edge.hxx>
+#include <TopoDS_Face.hxx>
+#include <TopoDS_Shape.hxx>
+#include <TopoDS_Wire.hxx>
//=======================================================================
//function : QANewDBRepNaming_NameBox
//purpose : NameCylinder Doc Label dx dy dz
//=======================================================================
-
static Standard_Integer QANewDBRepNaming_NameBox (Draw_Interpretor& di,
Standard_Integer nb,
const char ** arg)
TDF_Label L;
if (!QADNaming::Entry(arg, L)) return 1;
- BRepPrimAPI_MakeBox mkBox(atof(arg[3]), atof(arg[4]), atof(arg[5]));
+ BRepPrimAPI_MakeBox mkBox(Draw::Atof(arg[3]), Draw::Atof(arg[4]), Draw::Atof(arg[5]));
mkBox.Build();
if(!mkBox.IsDone()) {
TDF_Label L;
if (!QADNaming::Entry(arg, L)) return 1;
- BRepPrimAPI_MakeCylinder mkCylinder(atof(arg[3]), atof(arg[4]));
- if (atof(arg[5]) != 0.) {
- // for Mandrake-10 - mkv,02.06.06 - mkCylinder = BRepPrimAPI_MakeCylinder(atof(arg[3]), atof(arg[4]), atof(arg[5]));
- BRepPrimAPI_MakeCylinder MakeCylinder(atof(arg[3]), atof(arg[4]), atof(arg[5]));
+ BRepPrimAPI_MakeCylinder mkCylinder(Draw::Atof(arg[3]), Draw::Atof(arg[4]));
+ if (Draw::Atof(arg[5]) != 0.) {
+ // for Mandrake-10 - mkv,02.06.06 - mkCylinder = BRepPrimAPI_MakeCylinder(Draw::Atof(arg[3]), Draw::Atof(arg[4]), Draw::Atof(arg[5]));
+ BRepPrimAPI_MakeCylinder MakeCylinder(Draw::Atof(arg[3]), Draw::Atof(arg[4]), Draw::Atof(arg[5]));
mkCylinder = MakeCylinder;
}
mkCylinder.Build();
QANewBRepNaming_Cylinder nameCylinder(L);
if (nb == 6) nameCylinder.Load(mkCylinder, QANewBRepNaming_SHELL);
- else if (atoi(arg[6]) == 0) nameCylinder.Load(mkCylinder, QANewBRepNaming_SHELL);
+ else if (Draw::Atoi(arg[6]) == 0) nameCylinder.Load(mkCylinder, QANewBRepNaming_SHELL);
else nameCylinder.Load(mkCylinder, QANewBRepNaming_SOLID);
return 0;
{
TDF_Label L;
if (!QADNaming::Entry(arg, L)) return 1;
- Standard_Real R = atof(arg[3]);
- Standard_Real X = atof(arg[4]);
- Standard_Real Y = atof(arg[5]);
- Standard_Real Z = atof(arg[6]);
- Standard_Real DX = atof(arg[7]);
- Standard_Real DY = atof(arg[8]);
- Standard_Real DZ = atof(arg[9]);
+ Standard_Real R = Draw::Atof(arg[3]);
+ Standard_Real X = Draw::Atof(arg[4]);
+ Standard_Real Y = Draw::Atof(arg[5]);
+ Standard_Real Z = Draw::Atof(arg[6]);
+ Standard_Real DX = Draw::Atof(arg[7]);
+ Standard_Real DY = Draw::Atof(arg[8]);
+ Standard_Real DZ = Draw::Atof(arg[9]);
QANewBRepNaming_TypeOfPrimitive3D type = QANewBRepNaming_SHELL;
- if (nb == 11) type = (QANewBRepNaming_TypeOfPrimitive3D) atoi(arg[10]);
+ if (nb == 11) type = (QANewBRepNaming_TypeOfPrimitive3D) Draw::Atoi(arg[10]);
QANewBRepNaming_Sphere nameSphere(L);
BRepPrimAPI_MakeSphere mkSphere(R);
if (!QADNaming::Entry(arg, L)) return 1;
if (!DDF::AddLabel(L.Data(), arg[3], BL)) return 1;
- Standard_Real H = atof(arg[4]);
+ Standard_Real H = Draw::Atof(arg[4]);
Handle(TNaming_NamedShape) BasisNS;
if (!BL.FindAttribute(TNaming_NamedShape::GetID(), BasisNS)) return 1;
QANewBRepNaming_Prism namePrism(L);
if (nb >= 8) {
- gp_Dir Direction(atof(arg[5]), atof(arg[6]), atof(arg[7]));
+ gp_Dir Direction(Draw::Atof(arg[5]), Draw::Atof(arg[6]), Draw::Atof(arg[7]));
gp_Vec Vector(Direction);
Vector.Normalize();
Vector *= H;
namePrism.Load(mkPrism, Basis);
}
else if (nb == 9) {
- BRepPrimAPI_MakePrism mkPrism(Basis, Direction, (Standard_Boolean)atoi(arg[8]));
+ BRepPrimAPI_MakePrism mkPrism(Basis, Direction, Draw::Atoi(arg[8]) != 0);
mkPrism.Build();
if(!mkPrism.IsDone()) {
}
else if (nb == 6) {
- Standard_Real Angle = atof(arg[5]);
+ Standard_Real Angle = Draw::Atof(arg[5]);
BRepPrimAPI_MakeRevol mkRevol(Basis, axis, Angle);
mkRevol.Build();
if (!DDF::AddLabel(L.Data(), arg[3], BL)) return 1;
if (!DDF::AddLabel(L.Data(), arg[4], PL)) return 1;
- Standard_Real aRadius = atoi(arg[5]);
+ Standard_Real aRadius = Draw::Atoi(arg[5]);
Handle(TNaming_NamedShape) BasisNS, PathNS;
if (!BL.FindAttribute(TNaming_NamedShape::GetID(), BasisNS)) return 1;
if (!PL.FindAttribute(TNaming_NamedShape::GetID(), PathNS)) return 1;
if (!DDF::AddLabel(L.Data(), arg[3], BL)) return 1;
if (!DDF::AddLabel(L.Data(), arg[4], EL)) return 1;
if (!DDF::AddLabel(L.Data(), arg[5], FL)) return 1;
- aDist1 = atoi(arg[6]);
- aDist2 = atoi(arg[7]);
+ aDist1 = Draw::Atoi(arg[6]);
+ aDist2 = Draw::Atoi(arg[7]);
Handle(TNaming_NamedShape) BasisNS, EdgeNS, FaceNS;
if (!BL.FindAttribute(TNaming_NamedShape::GetID(), BasisNS)) return 1;