1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
14 #include <GeomToStep_MakeParabola.ixx>
16 #include <StepGeom_Parabola.hxx>
17 #include <gp_Parab.hxx>
18 #include <gp_Parab2d.hxx>
19 #include <Geom_Parabola.hxx>
20 #include <GeomToStep_MakeAxis2Placement2d.hxx>
21 #include <GeomToStep_MakeAxis2Placement3d.hxx>
22 #include <StdFail_NotDone.hxx>
23 #include <TCollection_HAsciiString.hxx>
24 #include <UnitsMethods.hxx>
27 //=============================================================================
28 // Creation d'une Parabola de prostep a partir d'une Parabola de
30 //=============================================================================
32 GeomToStep_MakeParabola::GeomToStep_MakeParabola(const Handle(Geom2d_Parabola)& C)
37 Handle(StepGeom_Parabola) PStep = new StepGeom_Parabola;
38 StepGeom_Axis2Placement Ax2;
39 Handle(StepGeom_Axis2Placement2d) Ax2Step;
42 GeomToStep_MakeAxis2Placement2d MkAxis2(gpPar.Axis());
43 Ax2Step = MkAxis2.Value();
44 focal = gpPar.Focal();
45 Ax2.SetValue(Ax2Step);
46 Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
47 PStep->Init(name, Ax2, focal);
52 //=============================================================================
53 // Creation d'une Parabola de prostep a partir d'une Parabola de
55 //=============================================================================
57 GeomToStep_MakeParabola::GeomToStep_MakeParabola(const Handle(Geom_Parabola)& C)
62 Handle(StepGeom_Parabola) PStep = new StepGeom_Parabola;
63 StepGeom_Axis2Placement Ax2;
64 Handle(StepGeom_Axis2Placement3d) Ax2Step;
67 GeomToStep_MakeAxis2Placement3d MkAxis2(gpPar.Position());
68 Ax2Step = MkAxis2.Value();
69 focal = gpPar.Focal();
70 Ax2.SetValue(Ax2Step);
71 Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
72 PStep->Init(name, Ax2, focal / UnitsMethods::LengthFactor());
77 //=============================================================================
79 //=============================================================================
81 const Handle(StepGeom_Parabola)& GeomToStep_MakeParabola::Value() const
83 StdFail_NotDone_Raise_if(!done, "");