1 // Created on: 1993-08-24
2 // Created by: Bruno DUMORTIER
3 // Copyright (c) 1993-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
19 #include <gp_Circ.hxx>
20 #include <gp_Circ2d.hxx>
21 #include <gp_Cone.hxx>
22 #include <gp_Cylinder.hxx>
23 #include <gp_Elips.hxx>
24 #include <gp_Elips2d.hxx>
25 #include <gp_Hypr.hxx>
26 #include <gp_Hypr2d.hxx>
28 #include <gp_Lin2d.hxx>
29 #include <gp_Parab.hxx>
30 #include <gp_Parab2d.hxx>
33 #include <gp_Pnt2d.hxx>
34 #include <gp_Sphere.hxx>
35 #include <gp_Torus.hxx>
36 #include <ProjLib.hxx>
37 #include <ProjLib_Cone.hxx>
38 #include <ProjLib_Cylinder.hxx>
39 #include <ProjLib_Plane.hxx>
40 #include <ProjLib_Sphere.hxx>
41 #include <ProjLib_Torus.hxx>
43 //=======================================================================
46 //=======================================================================
47 gp_Pnt2d ProjLib::Project(const gp_Pln& Pl, const gp_Pnt& P)
50 ElSLib::Parameters(Pl, P, U, V);
55 //=======================================================================
58 //=======================================================================
60 gp_Lin2d ProjLib::Project(const gp_Pln& Pl, const gp_Lin& L)
62 ProjLib_Plane Proj( Pl, L);
67 //=======================================================================
70 //=======================================================================
72 gp_Circ2d ProjLib::Project(const gp_Pln& Pl, const gp_Circ& C)
74 ProjLib_Plane Proj( Pl, C);
79 //=======================================================================
82 //=======================================================================
84 gp_Elips2d ProjLib::Project(const gp_Pln& Pl, const gp_Elips& E)
86 ProjLib_Plane Proj( Pl, E);
87 return Proj.Ellipse();
91 //=======================================================================
94 //=======================================================================
96 gp_Parab2d ProjLib::Project(const gp_Pln& Pl, const gp_Parab& P)
98 ProjLib_Plane Proj( Pl, P);
99 return Proj.Parabola();
103 //=======================================================================
106 //=======================================================================
108 gp_Hypr2d ProjLib::Project(const gp_Pln& Pl, const gp_Hypr& H)
110 ProjLib_Plane Proj( Pl, H);
111 return Proj.Hyperbola();
115 //=======================================================================
118 //=======================================================================
120 gp_Pnt2d ProjLib::Project(const gp_Cylinder& Cy, const gp_Pnt& P)
123 ElSLib::Parameters(Cy, P, U, V);
124 return gp_Pnt2d(U,V);
128 //=======================================================================
131 //=======================================================================
133 gp_Lin2d ProjLib::Project(const gp_Cylinder& Cy, const gp_Lin& L)
135 ProjLib_Cylinder Proj( Cy, L);
140 //=======================================================================
143 //=======================================================================
145 gp_Lin2d ProjLib::Project(const gp_Cylinder& Cy, const gp_Circ& Ci)
147 ProjLib_Cylinder Proj( Cy, Ci);
152 //=======================================================================
155 //=======================================================================
157 gp_Pnt2d ProjLib::Project(const gp_Cone& Co, const gp_Pnt& P)
160 ElSLib::Parameters(Co, P, U, V);
161 return gp_Pnt2d(U,V);
165 //=======================================================================
168 //=======================================================================
170 gp_Lin2d ProjLib::Project(const gp_Cone& Co, const gp_Lin& L)
172 ProjLib_Cone Proj( Co, L);
177 //=======================================================================
180 //=======================================================================
182 gp_Lin2d ProjLib::Project(const gp_Cone& Co, const gp_Circ& Ci)
184 ProjLib_Cone Proj( Co, Ci);
189 //=======================================================================
192 //=======================================================================
194 gp_Pnt2d ProjLib::Project(const gp_Sphere& Sp, const gp_Pnt& P)
197 ElSLib::Parameters(Sp, P, U, V);
198 return gp_Pnt2d(U,V);
202 //=======================================================================
205 //=======================================================================
207 gp_Lin2d ProjLib::Project(const gp_Sphere& Sp, const gp_Circ& Ci)
209 ProjLib_Sphere Proj( Sp, Ci);
214 //=======================================================================
217 //=======================================================================
219 gp_Pnt2d ProjLib::Project(const gp_Torus& To, const gp_Pnt& P)
222 ElSLib::Parameters(To, P, U, V);
223 return gp_Pnt2d(U,V);
227 //=======================================================================
230 //=======================================================================
232 gp_Lin2d ProjLib::Project(const gp_Torus& To, const gp_Circ& Ci)
234 ProjLib_Torus Proj( To, Ci);