b311480e |
1 | -- Created on: 1993-08-11 |
2 | -- Created by: Bruno DUMORTIER |
3 | -- Copyright (c) 1993-1999 Matra Datavision |
4 | -- Copyright (c) 1999-2012 OPEN CASCADE SAS |
5 | -- |
6 | -- The content of this file is subject to the Open CASCADE Technology Public |
7 | -- License Version 6.5 (the "License"). You may not use the content of this file |
8 | -- except in compliance with the License. Please obtain a copy of the License |
9 | -- at http://www.opencascade.org and read it completely before using this file. |
10 | -- |
11 | -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
12 | -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
13 | -- |
14 | -- The Original Code and all software distributed under the License is |
15 | -- distributed on an "AS IS" basis, without warranty of any kind, and the |
16 | -- Initial Developer hereby disclaims all such warranties, including without |
17 | -- limitation, any warranties of merchantability, fitness for a particular |
18 | -- purpose or non-infringement. Please see the License for the specific terms |
19 | -- and conditions governing the rights and limitations under the License. |
20 | |
7fd59977 |
21 | |
22 | |
23 | |
24 | package ProjLib |
25 | |
26 | |
27 | ---Purpose: The projLib package first provides projection of |
28 | -- curves on a plane along a given Direction. The |
29 | -- result will be a 3D curve. |
30 | |
31 | |
32 | ---Purpose: The ProjLib package provides projection of curves |
33 | -- on surfaces to compute the curve in the parametric |
34 | -- space. |
35 | -- |
36 | -- It is assumed that the curve is on the surface. |
37 | -- |
38 | -- It provides : |
39 | -- |
40 | -- * Package methods to handle the easiest cases : |
41 | -- |
42 | -- - Line, Circle, Ellipse, Parabola, Hyperbola on plane. |
43 | -- |
44 | -- - Line, Circle on cylinder. |
45 | -- |
46 | -- - Line, Circle on cone. |
47 | -- |
48 | -- * Classes to handle the general cases : |
49 | -- |
50 | -- - Plane. |
51 | -- |
52 | -- - Cylinder. |
53 | -- |
54 | -- - Cone. |
55 | -- |
56 | -- - Sphere. |
57 | -- |
58 | -- - Torus. |
59 | -- |
60 | -- |
61 | -- * A generic class to handle a Curve from Adaptor3d |
62 | -- on a Surface from Adaptor3d. |
63 | -- |
64 | |
65 | uses |
66 | GeomAbs, -- Geometry enumeration |
67 | gp, -- Elementary geometry |
68 | Geom, |
69 | Geom2d, |
70 | Adaptor2d, -- Curve and Surface interface. |
71 | Adaptor3d, -- Curve and Surface interface. |
72 | Extrema, -- for projection of points on surface. |
73 | GeomAdaptor, |
74 | TColgp, |
75 | TColStd, |
76 | TCollection, |
77 | math |
78 | |
79 | is |
80 | |
81 | -- --------------------------------------------------------------- |
82 | -- Classes computing the projection of a 3d curve on a surface. |
83 | -- The result will be a 3d curve. |
84 | -- |
85 | -- Make an approximation if necessary |
86 | -- --------------------------------------------------------------- |
87 | |
88 | |
89 | class ProjectOnPlane ; |
90 | ---Purpose: Project a curve on a plane. |
91 | |
92 | |
93 | class ProjectOnSurface ; |
94 | ---Purpose: Project a curve on a surface. The result ( a 3D |
95 | -- Curve) will be an approximation |
96 | |
97 | |
98 | |
99 | |
100 | -- --------------------------------------------------------------- |
101 | -- Classes computing the PCurves of curves lying on a surface |
102 | -- |
103 | -- Make an approximation if necessary |
104 | -- --------------------------------------------------------------- |
105 | |
106 | |
107 | class ComputeApprox; |
108 | ---Purpose: Approximate the projection of a 3d curve on an |
109 | -- analytic surface and stores the result in Approx. |
110 | -- The result is a 2d curve. |
111 | |
112 | |
113 | class ComputeApproxOnPolarSurface ; |
114 | ---Purpose: Approximate the projection of a 3d curve on an |
115 | -- polar surface and stores the result in Approx. |
116 | -- The result is a 2d curve. The evaluation of the |
117 | -- current point of the 2d curve is done with the |
118 | -- evaluation of the extrema P3d - Surface. |
119 | |
120 | |
121 | class ProjectedCurve ; |
122 | ---Purpose: Compute the 2d-curve. Try to solve the particular |
123 | -- case if possible. Otherwize, an approximation is |
124 | -- done. |
125 | |
126 | |
127 | class HProjectedCurve instantiates |
128 | GenHCurve2d from Adaptor2d (ProjectedCurve); |
129 | |
130 | --------------------------------------------- |
131 | -- Normal projection of a curve on a surface |
132 | -- Computes the different parts |
133 | ----------------------------------------------- |
134 | class SequenceOfHSequenceOfPnt |
135 | instantiates Sequence from TCollection (HSequenceOfPnt from TColgp); |
136 | |
137 | class HSequenceOfHSequenceOfPnt |
138 | instantiates HSequence from TCollection (HSequenceOfPnt from TColgp,SequenceOfHSequenceOfPnt from ProjLib); |
139 | class CompProjectedCurve; |
140 | class HCompProjectedCurve |
141 | instantiates GenHCurve2d from Adaptor2d (CompProjectedCurve); |
142 | |
143 | private class PrjResolve; |
144 | private class PrjFunc; |
145 | |
146 | |
147 | -- ------------------------------------------------------------ |
148 | -- Projection of Curves on Surfaces. |
149 | -- |
150 | -- This classes evaluate the 2d curve of a curve lying on a |
151 | -- surface in some particular case. See the description of this |
152 | -- classes to have more informations. |
153 | -- |
154 | -- ------------------------------------------------------------ |
155 | |
156 | class Projector; |
157 | ---Purpose: Root class for projections. Stores the result. |
158 | |
159 | class Plane; |
160 | ---Purpose: Projection on a plane. |
161 | |
162 | class Cylinder; |
163 | ---Purpose: Projection on a cylinder. |
164 | |
165 | class Cone; |
166 | ---Purpose: Projection on a cone. |
167 | |
168 | class Sphere; |
169 | ---Purpose: Projection on a sphere. |
170 | |
171 | class Torus; |
172 | ---Purpose: Projection on a torus. |
173 | |
174 | |
175 | -- methods |
176 | |
177 | Project(Pl : Pln from gp; |
178 | P : Pnt from gp ) returns Pnt2d from gp; |
179 | |
180 | Project(Pl : Pln from gp; |
181 | L : Lin from gp ) returns Lin2d from gp; |
182 | |
183 | Project(Pl : Pln from gp; |
184 | C : Circ from gp ) returns Circ2d from gp; |
185 | |
186 | Project(Pl : Pln from gp; |
187 | E : Elips from gp ) returns Elips2d from gp; |
188 | |
189 | Project(Pl : Pln from gp; |
190 | P : Parab from gp ) returns Parab2d from gp; |
191 | |
192 | Project(Pl : Pln from gp; |
193 | H : Hypr from gp ) returns Hypr2d from gp; |
194 | |
195 | Project(Cy : Cylinder from gp; |
196 | P : Pnt from gp ) returns Pnt2d from gp; |
197 | |
198 | Project(Cy : Cylinder from gp; |
199 | L : Lin from gp ) returns Lin2d from gp; |
200 | |
201 | Project(Cy : Cylinder from gp; |
202 | Ci : Circ from gp ) returns Lin2d from gp; |
203 | |
204 | Project(Co : Cone from gp; |
205 | P : Pnt from gp ) returns Pnt2d from gp; |
206 | |
207 | Project(Co : Cone from gp; |
208 | L : Lin from gp ) returns Lin2d from gp; |
209 | |
210 | Project(Co : Cone from gp; |
211 | Ci : Circ from gp ) returns Lin2d from gp; |
212 | |
213 | Project(Sp : Sphere from gp; |
214 | P : Pnt from gp ) returns Pnt2d from gp; |
215 | |
216 | Project(Sp : Sphere from gp; |
217 | Ci : Circ from gp ) returns Lin2d from gp; |
218 | |
219 | Project(To : Torus from gp; |
220 | P : Pnt from gp ) returns Pnt2d from gp; |
221 | |
222 | Project(To : Torus from gp; |
223 | Ci : Circ from gp ) returns Lin2d from gp; |
224 | |
225 | end ProjLib; |
226 | |
227 | |
228 | |
229 | |
230 | |