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 <StepGeom_Axis2Placement2d.hxx>
18 #include <StepGeom_Axis2Placement3d.hxx>
19 #include <gp_Parab.hxx>
20 #include <gp_Parab2d.hxx>
21 #include <Geom_Parabola.hxx>
22 #include <GeomToStep_MakeAxis2Placement2d.hxx>
23 #include <GeomToStep_MakeAxis2Placement3d.hxx>
24 #include <StdFail_NotDone.hxx>
25 #include <TCollection_HAsciiString.hxx>
26 #include <UnitsMethods.hxx>
29 //=============================================================================
30 // Creation d'une Parabola de prostep a partir d'une Parabola de
32 //=============================================================================
34 GeomToStep_MakeParabola::GeomToStep_MakeParabola(const Handle(Geom2d_Parabola)& C)
39 Handle(StepGeom_Parabola) PStep = new StepGeom_Parabola;
40 StepGeom_Axis2Placement Ax2;
41 Handle(StepGeom_Axis2Placement2d) Ax2Step;
44 GeomToStep_MakeAxis2Placement2d MkAxis2(gpPar.Axis());
45 Ax2Step = MkAxis2.Value();
46 focal = gpPar.Focal();
47 Ax2.SetValue(Ax2Step);
48 Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
49 PStep->Init(name, Ax2, focal);
54 //=============================================================================
55 // Creation d'une Parabola de prostep a partir d'une Parabola de
57 //=============================================================================
59 GeomToStep_MakeParabola::GeomToStep_MakeParabola(const Handle(Geom_Parabola)& C)
64 Handle(StepGeom_Parabola) PStep = new StepGeom_Parabola;
65 StepGeom_Axis2Placement Ax2;
66 Handle(StepGeom_Axis2Placement3d) Ax2Step;
69 GeomToStep_MakeAxis2Placement3d MkAxis2(gpPar.Position());
70 Ax2Step = MkAxis2.Value();
71 focal = gpPar.Focal();
72 Ax2.SetValue(Ax2Step);
73 Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
74 PStep->Init(name, Ax2, focal / UnitsMethods::LengthFactor());
79 //=============================================================================
81 //=============================================================================
83 const Handle(StepGeom_Parabola)& GeomToStep_MakeParabola::Value() const
85 StdFail_NotDone_Raise_if(!done, "");