0031642: Visualization - crash in Graphic3d_Structure::SetVisual() on redisplaying...
[occt.git] / src / Geom2dToIGES / Geom2dToIGES_Geom2dCurve.cxx
1 // Created on: 1995-02-01
2 // Created by: Marie Jose MARTZ
3 // Copyright (c) 1995-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 //#53 rln 24.12.98 CCI60005
18 //#57 rln 25.12.98 avoid code duplication
19
20 #include <Geom2d_BoundedCurve.hxx>
21 #include <Geom2d_BSplineCurve.hxx>
22 #include <Geom2d_Circle.hxx>
23 #include <Geom2d_Conic.hxx>
24 #include <Geom2d_Curve.hxx>
25 #include <Geom2d_Ellipse.hxx>
26 #include <Geom2d_Hyperbola.hxx>
27 #include <Geom2d_Line.hxx>
28 #include <Geom2d_OffsetCurve.hxx>
29 #include <Geom2d_Parabola.hxx>
30 #include <Geom2d_TrimmedCurve.hxx>
31 #include <Geom2dToIGES_Geom2dCurve.hxx>
32 #include <Geom2dToIGES_Geom2dEntity.hxx>
33 #include <Geom_Curve.hxx>
34 #include <GeomAPI.hxx>
35 #include <GeomToIGES_GeomCurve.hxx>
36 #include <gp.hxx>
37 #include <gp_Ax2.hxx>
38 #include <gp_Ax22d.hxx>
39 #include <gp_Circ.hxx>
40 #include <gp_Circ2d.hxx>
41 #include <gp_Dir.hxx>
42 #include <gp_Elips.hxx>
43 #include <gp_Elips2d.hxx>
44 #include <gp_Hypr.hxx>
45 #include <gp_Hypr2d.hxx>
46 #include <gp_Parab.hxx>
47 #include <gp_Parab2d.hxx>
48 #include <gp_Pln.hxx>
49 #include <gp_Pnt.hxx>
50 #include <gp_XY.hxx>
51 #include <gp_XYZ.hxx>
52 #include <IGESData_IGESEntity.hxx>
53 #include <IGESData_ToolLocation.hxx>
54 #include <IGESGeom_BSplineCurve.hxx>
55 #include <IGESGeom_CircularArc.hxx>
56 #include <IGESGeom_CompositeCurve.hxx>
57 #include <IGESGeom_ConicArc.hxx>
58 #include <IGESGeom_CopiousData.hxx>
59 #include <IGESGeom_CurveOnSurface.hxx>
60 #include <IGESGeom_Line.hxx>
61 #include <IGESGeom_OffsetCurve.hxx>
62 #include <IGESGeom_Point.hxx>
63 #include <IGESGeom_TransformationMatrix.hxx>
64 #include <Interface_Macros.hxx>
65 #include <Precision.hxx>
66
67 //#include <Geom2dConvert.hxx>
68 //=============================================================================
69 // Geom2dToIGES_Geom2dCurve
70 //=============================================================================
71 Geom2dToIGES_Geom2dCurve::Geom2dToIGES_Geom2dCurve()
72 :Geom2dToIGES_Geom2dEntity()
73 {
74 }
75
76
77 //=============================================================================
78 // Geom2dToIGES_Geom2dCurve
79 //=============================================================================
80
81 Geom2dToIGES_Geom2dCurve::Geom2dToIGES_Geom2dCurve
82 (const Geom2dToIGES_Geom2dEntity& G2dE)
83 :Geom2dToIGES_Geom2dEntity(G2dE)
84 {
85 }
86
87
88 //=============================================================================
89 // Transfer des Entites Curve de Geom2d vers IGES
90 // Transfer2dCurve
91 //=============================================================================
92
93 Handle(IGESData_IGESEntity) Geom2dToIGES_Geom2dCurve::Transfer2dCurve
94 (const Handle(Geom2d_Curve)& start, const Standard_Real Udeb, const Standard_Real Ufin)
95 {
96   Handle(IGESData_IGESEntity) res;
97   if (start.IsNull()) {
98     return res;
99   }
100
101   //#57 rln 25.12.98 avoid code duplication
102   GeomToIGES_GeomCurve GC;
103   GC.SetModel (GetModel());
104   GC.SetUnit (1.); //not scale 2D curves
105   return GC.TransferCurve (GeomAPI::To3d (start, gp_Pln (0, 0, 1, 0)), Udeb, Ufin);
106 }
107