b311480e |
1 | -- Created on: 1991-12-02 |
2 | -- Created by: Laurent PAINNOT |
3 | -- Copyright (c) 1991-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 | |
25 | class MultiPointConstraint from AppDef |
26 | |
27 | inherits MultiPoint from AppParCurves |
28 | |
29 | ---Purpose: Describes a MultiPointConstraint used in a |
30 | -- Multiline. MultiPointConstraints are composed |
31 | -- of several two or three-dimensional points. |
32 | -- The purpose is to define the corresponding |
33 | -- points that share a common constraint in order |
34 | -- to compute the approximation of several lines in parallel. |
35 | -- Notes: |
36 | -- - The order of points of a MultiPointConstraints is very important. |
37 | -- Users must give 3D points first, and then 2D points. |
38 | -- - The constraints for the points included in a |
39 | -- MultiPointConstraint are always identical for |
40 | -- all points, including the parameter. |
41 | -- - If a MultiPointConstraint is a "tangency" |
42 | -- point, the point is also a "passing" point. |
43 | |
44 | |
45 | |
46 | uses Pnt from gp, |
47 | Pnt2d from gp, |
48 | Vec from gp, |
49 | Vec2d from gp, |
50 | Array1OfPnt from TColgp, |
51 | Array1OfPnt2d from TColgp, |
52 | Array1OfVec from TColgp, |
53 | Array1OfVec2d from TColgp, |
54 | Constraint from AppParCurves, |
55 | OStream from Standard, |
56 | TShared from MMgt |
57 | |
58 | raises OutOfRange from Standard, |
59 | ConstructionError from Standard, |
60 | DimensionError from Standard |
61 | |
62 | |
63 | is |
64 | |
65 | Create |
66 | ---Purpose: creates an undefined MultiPointConstraint. |
67 | |
68 | returns MultiPointConstraint from AppDef; |
69 | |
70 | |
71 | Create(NbPoints, NbPoints2d: Integer) |
72 | ---Purpose: constructs a set of Points used to approximate a Multiline. |
73 | -- These Points can be of 2 or 3 dimensions. |
74 | -- Points will be initialized with SetPoint and SetPoint2d. |
75 | |
76 | returns MultiPointConstraint from AppDef; |
77 | |
78 | |
79 | |
80 | Create(tabP: Array1OfPnt) |
81 | ---Purpose: creates a MultiPoint only composed of 3D points. |
82 | |
83 | returns MultiPointConstraint from AppDef; |
84 | |
85 | |
86 | Create(tabP: Array1OfPnt2d) |
87 | ---Purpose: creates a MultiPoint only composed of 2D points. |
88 | |
89 | returns MultiPointConstraint from AppDef; |
90 | |
91 | |
92 | Create(tabP: Array1OfPnt; tabP2d: Array1OfPnt2d) |
93 | ---Purpose: constructs a set of Points used to approximate a Multiline. |
94 | -- These Points can be of 2 or 3 dimensions. |
95 | -- Points will be initialized with SetPoint and SetPoint2d. |
96 | |
97 | returns MultiPointConstraint from AppDef; |
98 | |
99 | |
100 | |
101 | Create(tabP: Array1OfPnt; tabP2d: Array1OfPnt2d; |
102 | tabVec: Array1OfVec; tabVec2d: Array1OfVec2d; |
103 | tabCur: Array1OfVec; tabCur2d: Array1OfVec2d) |
104 | ---Purpose: creates a MultiPointConstraint with a constraint of |
105 | -- Curvature. |
106 | -- An exception is raised if |
107 | -- (length of <tabP> + length of <tabP2d> ) is different |
108 | -- from (length of <tabVec> + length of <tabVec2d> ) or |
109 | -- from (length of <tabCur> + length of <tabCur2d> ) |
110 | |
111 | returns MultiPointConstraint from AppDef |
112 | raises ConstructionError from Standard; |
113 | |
114 | |
115 | |
116 | Create(tabP: Array1OfPnt; tabP2d: Array1OfPnt2d; |
117 | tabVec: Array1OfVec; tabVec2d: Array1OfVec2d) |
118 | ---Purpose: creates a MultiPointConstraint with a constraint of |
119 | -- Tangency. |
120 | -- An exception is raised if |
121 | -- (length of <tabP> + length of <tabP2d> ) is different |
122 | -- from (length of <tabVec> + length of <tabVec2d> ) |
123 | |
124 | returns MultiPointConstraint from AppDef |
125 | raises ConstructionError from Standard; |
126 | |
127 | |
128 | |
129 | |
130 | Create(tabP: Array1OfPnt; tabVec: Array1OfVec; tabCur: Array1OfVec) |
131 | ---Purpose: creates a MultiPointConstraint only composed of 3d points |
132 | -- with constraints of curvature. |
133 | -- An exception is raised if the length of tabP is different |
134 | -- from the length of tabVec or from tabCur. |
135 | |
136 | returns MultiPointConstraint from AppDef |
137 | raises ConstructionError; |
138 | |
139 | |
140 | Create(tabP: Array1OfPnt; tabVec: Array1OfVec) |
141 | ---Purpose: creates a MultiPointConstraint only composed of 3d points |
142 | -- with constraints of tangency. |
143 | -- An exception is raised if the length of tabP is different |
144 | -- from the length of tabVec. |
145 | |
146 | returns MultiPointConstraint |
147 | raises ConstructionError; |
148 | |
149 | |
150 | |
151 | Create(tabP2d: Array1OfPnt2d; tabVec2d: Array1OfVec2d) |
152 | ---Purpose: creates a MultiPointConstraint only composed of 2d points |
153 | -- with constraints of tangency. |
154 | -- An exception is raised if the length of tabP is different |
155 | -- from the length of tabVec2d. |
156 | |
157 | returns MultiPointConstraint from AppDef |
158 | raises ConstructionError from Standard; |
159 | |
160 | |
161 | Create(tabP2d: Array1OfPnt2d; |
162 | tabVec2d: Array1OfVec2d; |
163 | tabCur2d: Array1OfVec2d) |
164 | ---Purpose: creates a MultiPointConstraint only composed of 2d points |
165 | -- with constraints of curvature. |
166 | -- An exception is raised if the length of tabP is different |
167 | -- from the length of tabVec2d or from tabCur2d. |
168 | |
169 | returns MultiPointConstraint from AppDef |
170 | raises ConstructionError from Standard; |
171 | |
172 | |
173 | |
174 | |
175 | SetTang(me: in out; Index: Integer; Tang: Vec) |
176 | ---Purpose: sets the value of the tangency of the point of range |
177 | -- Index. |
178 | -- An exception is raised if Index <0 or if Index > number |
179 | -- of 3d points. |
180 | -- An exception is raised if Tang has an incorrect number of |
181 | -- dimensions. |
182 | |
183 | raises OutOfRange from Standard, |
184 | DimensionError from Standard |
185 | is static; |
186 | |
187 | |
188 | Tang(me; Index: Integer) |
189 | ---Purpose: returns the tangency value of the point of range Index. |
190 | -- An exception is raised if Index < 0 or if Index > number |
191 | -- of 3d points. |
192 | |
193 | returns Vec from gp |
194 | raises OutOfRange from Standard |
195 | is static; |
196 | |
197 | |
198 | SetTang2d(me: in out; Index: Integer; Tang2d: Vec2d) |
199 | ---Purpose: sets the value of the tangency of the point of range |
200 | -- Index. |
201 | -- An exception is raised if Index <number of 3d points or if |
202 | -- Index > total number of Points |
203 | -- An exception is raised if Tang has an incorrect number of |
204 | -- dimensions. |
205 | |
206 | raises OutOfRange from Standard, |
207 | DimensionError from Standard |
208 | is static; |
209 | |
210 | |
211 | Tang2d(me; Index: Integer) |
212 | ---Purpose: returns the tangency value of the point of range Index. |
213 | -- An exception is raised if Index < number of 3d points or |
214 | -- if Index > total number of points. |
215 | |
216 | returns Vec2d from gp |
217 | raises OutOfRange from Standard |
218 | is static; |
219 | |
220 | |
221 | SetCurv(me: in out; Index: Integer; Curv: Vec) |
222 | ---Purpose: Vec sets the value of the normal vector at the |
223 | -- point of index Index. The norm of the normal |
224 | -- vector at the point of position Index is set to the normal curvature. |
225 | -- An exception is raised if Index <0 or if Index > number |
226 | -- of 3d points. |
227 | -- An exception is raised if Curv has an incorrect number of |
228 | -- dimensions. |
229 | |
230 | raises OutOfRange from Standard, |
231 | DimensionError from Standard |
232 | is static; |
233 | |
234 | |
235 | Curv(me; Index: Integer) |
236 | ---Purpose: returns the normal vector at the point of range Index. |
237 | -- An exception is raised if Index < 0 or if Index > number |
238 | -- of 3d points. |
239 | |
240 | returns Vec from gp |
241 | raises OutOfRange from Standard |
242 | is static; |
243 | |
244 | |
245 | |
246 | SetCurv2d(me: in out; Index: Integer; Curv2d: Vec2d) |
247 | ---Purpose: Vec sets the value of the normal vector at the |
248 | -- point of index Index. The norm of the normal |
249 | -- vector at the point of position Index is set to the normal curvature. |
250 | -- An exception is raised if Index <0 or if Index > number |
251 | -- of 3d points. |
252 | -- An exception is raised if Curv has an incorrect number of |
253 | -- dimensions. |
254 | |
255 | raises OutOfRange from Standard, |
256 | DimensionError from Standard |
257 | is static; |
258 | |
259 | |
260 | Curv2d(me; Index: Integer) |
261 | ---Purpose: returns the normal vector at the point of range Index. |
262 | -- An exception is raised if Index < 0 or if Index > number |
263 | -- of 3d points. |
264 | |
265 | returns Vec2d from gp |
266 | is static; |
267 | |
268 | |
269 | IsTangencyPoint(me) |
270 | ---Purpose: returns True if the MultiPoint has a tangency value. |
271 | |
272 | returns Boolean |
273 | raises OutOfRange from Standard |
274 | is static; |
275 | |
276 | IsCurvaturePoint(me) |
277 | ---Purpose: returns True if the MultiPoint has a curvature value. |
278 | |
279 | returns Boolean |
280 | raises OutOfRange from Standard |
281 | is static; |
282 | |
283 | |
284 | Dump(me; o: in out OStream) |
285 | ---Purpose: Prints on the stream o information on the current |
286 | -- state of the object. |
287 | -- Is used to redefine the operator <<. |
288 | |
289 | is redefined; |
290 | |
291 | |
292 | |
293 | fields |
294 | |
295 | ttabTang: TShared from MMgt; |
296 | ttabCurv: TShared from MMgt; |
297 | ttabTang2d: TShared from MMgt; |
298 | ttabCurv2d: TShared from MMgt; |
299 | |
300 | |
301 | end MultiPointConstraint from AppDef; |