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.
15 #include <Geom2d_Parabola.hxx>
16 #include <Geom_Parabola.hxx>
17 #include <GeomToStep_MakeAxis2Placement2d.hxx>
18 #include <GeomToStep_MakeAxis2Placement3d.hxx>
19 #include <GeomToStep_MakeParabola.hxx>
20 #include <gp_Parab.hxx>
21 #include <gp_Parab2d.hxx>
22 #include <StdFail_NotDone.hxx>
23 #include <StepGeom_Axis2Placement2d.hxx>
24 #include <StepGeom_Axis2Placement3d.hxx>
25 #include <StepGeom_Parabola.hxx>
26 #include <TCollection_HAsciiString.hxx>
27 #include <UnitsMethods.hxx>
29 //=============================================================================
30 // Creation d'une Parabola de prostep a partir d'une Parabola de
32 //=============================================================================
33 GeomToStep_MakeParabola::GeomToStep_MakeParabola(const Handle(Geom2d_Parabola)& C)
38 Handle(StepGeom_Parabola) PStep = new StepGeom_Parabola;
39 StepGeom_Axis2Placement Ax2;
40 Handle(StepGeom_Axis2Placement2d) Ax2Step;
43 GeomToStep_MakeAxis2Placement2d MkAxis2(gpPar.Axis());
44 Ax2Step = MkAxis2.Value();
45 focal = gpPar.Focal();
46 Ax2.SetValue(Ax2Step);
47 Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
48 PStep->Init(name, Ax2, focal);
53 //=============================================================================
54 // Creation d'une Parabola de prostep a partir d'une Parabola de
56 //=============================================================================
58 GeomToStep_MakeParabola::GeomToStep_MakeParabola(const Handle(Geom_Parabola)& C)
63 Handle(StepGeom_Parabola) PStep = new StepGeom_Parabola;
64 StepGeom_Axis2Placement Ax2;
65 Handle(StepGeom_Axis2Placement3d) Ax2Step;
68 GeomToStep_MakeAxis2Placement3d MkAxis2(gpPar.Position());
69 Ax2Step = MkAxis2.Value();
70 focal = gpPar.Focal();
71 Ax2.SetValue(Ax2Step);
72 Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
73 PStep->Init(name, Ax2, focal / UnitsMethods::LengthFactor());
78 //=============================================================================
80 //=============================================================================
82 const Handle(StepGeom_Parabola)& GeomToStep_MakeParabola::Value() const
84 StdFail_NotDone_Raise_if (!done, "GeomToStep_MakeParabola::Value() - no result");