b311480e |
1 | -- Created on: 1992-03-05 |
2 | -- Created by: Laurent BUCHARD |
3 | -- Copyright (c) 1992-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 | class Domain from IntRes2d |
24 | |
25 | |
26 | ---Purpose: Definition of the domain of parameter on a 2d-curve. |
27 | -- Most of the time, a domain is defined by two extremities. |
28 | -- An extremity is made of : |
29 | -- - a point in 2d-space (Pnt2d from gp), |
30 | -- - a parameter on the curve, |
31 | -- - a tolerance in the 2d-space. |
32 | -- Sometimes, it can be made of 0 or 1 point ( for an infinite |
33 | -- or semi-infinite line for example). |
34 | -- |
35 | -- For Intersection algorithms, Ellipses and Circles |
36 | -- Domains must be closed. |
37 | -- So, SetEquivalentParameters(.,.) method must be called |
38 | -- after initializing the first and the last bounds. |
39 | |
40 | |
41 | |
42 | uses Pnt2d from gp |
43 | |
44 | raises DomainError from Standard |
45 | |
46 | is |
47 | |
48 | |
49 | Create |
50 | |
51 | ---Purpose: Creates an infinite Domain (HasFirstPoint = False |
52 | -- and HasLastPoint = False). |
53 | |
54 | returns Domain from IntRes2d; |
55 | |
56 | |
57 | Create(Pnt1: Pnt2d from gp; |
58 | Par1: Real from Standard; |
59 | Tol1: Real from Standard; |
60 | Pnt2: Pnt2d from gp; |
61 | Par2: Real from Standard; |
62 | Tol2: Real from Standard) |
63 | |
64 | ---Purpose: Creates a bounded Domain. |
65 | |
66 | returns Domain from IntRes2d; |
67 | |
68 | |
69 | Create(Pnt: Pnt2d from gp; |
70 | Par: Real from Standard; |
71 | Tol: Real from Standard; |
72 | First: Boolean from Standard) |
73 | |
74 | ---Purpose: Creates a semi-infinite Domain. If First is set to |
75 | -- True, the given point is the first point of the domain, |
76 | -- otherwise it is the last point. |
77 | |
78 | returns Domain from IntRes2d; |
79 | |
80 | |
81 | SetValues(me: in out; |
82 | Pnt1: Pnt2d from gp; |
83 | Par1: Real from Standard; |
84 | Tol1: Real from Standard; |
85 | Pnt2: Pnt2d from gp; |
86 | Par2: Real from Standard; |
87 | Tol2: Real from Standard) |
88 | |
89 | ---Purpose: Sets the values for a bounded domain. |
90 | |
91 | is static; |
92 | |
93 | |
94 | SetValues(me: in out) |
95 | |
96 | ---Purpose : Sets the values for an infinite domain. |
97 | |
98 | is static; |
99 | |
100 | |
101 | SetValues(me: in out; |
102 | Pnt: Pnt2d from gp; |
103 | Par: Real from Standard; |
104 | Tol: Real from Standard; |
105 | First: Boolean from Standard) |
106 | |
107 | ---Purpose: Sets the values for a semi-infinite domain. |
108 | |
109 | is static; |
110 | |
111 | |
112 | SetEquivalentParameters(me: in out; zero,period: Real from Standard) |
113 | |
114 | ---Purpose: Defines a closed domain. |
115 | |
116 | ---C++: inline |
117 | |
118 | is static; |
119 | |
120 | |
121 | HasFirstPoint(me) |
122 | |
123 | ---Purpose: Returns True if the domain has a first point, i-e |
124 | -- a point defining the lowest admitted parameter on the |
125 | -- curve. |
126 | |
127 | ---C++: inline |
128 | |
129 | returns Boolean from Standard |
130 | is static; |
131 | |
132 | |
133 | FirstParameter(me) |
134 | |
135 | ---Purpose: Returns the parameter of the first point of the domain |
136 | -- The exception DomainError is raised if HasFirstPoint |
137 | -- returns False. |
138 | |
139 | ---C++: inline |
140 | |
141 | returns Real from Standard |
142 | raises DomainError from Standard |
143 | is static; |
144 | |
145 | |
146 | FirstPoint(me) |
147 | |
148 | ---Purpose: Returns the first point of the domain. |
149 | -- The exception DomainError is raised if HasFirstPoint |
150 | -- returns False. |
151 | |
152 | ---C++: inline |
153 | ---C++: return const & |
154 | |
155 | returns Pnt2d from gp |
156 | raises DomainError from Standard |
157 | is static; |
158 | |
159 | |
160 | FirstTolerance(me) |
161 | |
162 | ---Purpose: Returns the tolerance of the first (left) bound. |
163 | -- The exception DomainError is raised if HasFirstPoint |
164 | -- returns False. |
165 | |
166 | ---C++: inline |
167 | |
168 | returns Real from Standard |
169 | raises DomainError from Standard |
170 | is static; |
171 | |
172 | |
173 | HasLastPoint(me) |
174 | |
175 | ---Purpose: Returns True if the domain has a last point, i-e |
176 | -- a point defining the highest admitted parameter on the |
177 | -- curve. |
178 | |
179 | ---C++: inline |
180 | |
181 | returns Boolean from Standard |
182 | is static; |
183 | |
184 | |
185 | LastParameter(me) |
186 | |
187 | ---Purpose: Returns the parameter of the last point of the domain. |
188 | -- The exception DomainError is raised if HasLastPoint |
189 | -- returns False. |
190 | |
191 | ---C++: inline |
192 | |
193 | returns Real from Standard |
194 | raises DomainError from Standard |
195 | is static; |
196 | |
197 | |
198 | LastPoint(me) |
199 | |
200 | ---Purpose: Returns the last point of the domain. |
201 | -- The exception DomainError is raised if HasLastPoint |
202 | -- returns False. |
203 | |
204 | ---C++: inline |
205 | ---C++: return const & |
206 | |
207 | returns Pnt2d from gp |
208 | raises DomainError from Standard |
209 | is static; |
210 | |
211 | |
212 | LastTolerance(me) |
213 | |
214 | ---Purpose: Returns the tolerance of the last (right) bound. |
215 | -- The exception DomainError is raised if HasLastPoint |
216 | -- returns False. |
217 | |
218 | ---C++: inline |
219 | |
220 | returns Real from Standard |
221 | raises DomainError from Standard |
222 | is static; |
223 | |
224 | |
225 | IsClosed(me) |
226 | |
227 | ---Purpose: Returns True if the domain is closed. |
228 | |
229 | ---C++: inline |
230 | |
231 | returns Boolean from Standard |
232 | is static; |
233 | |
234 | |
235 | EquivalentParameters(me; zero,zeroplusperiod:out Real from Standard) |
236 | |
237 | ---Purpose: Returns Equivalent parameters if the domain is closed. |
238 | -- Otherwise, the exception DomainError is raised. |
239 | |
240 | ---C++: inline |
241 | |
242 | raises DomainError from Standard |
243 | is static; |
244 | |
245 | |
246 | fields |
247 | |
248 | status : Integer from Standard; |
249 | ---------------------------------------- |
250 | -- Bit 0 : HasFist |
251 | -- Bit 1 : HasLast |
252 | -- Bit 2 : Closed |
253 | ---------------------------------------- |
254 | |
255 | first_param : Real from Standard; |
256 | last_param : Real from Standard; |
257 | |
258 | first_tol : Real from Standard; |
259 | last_tol : Real from Standard; |
260 | |
261 | first_point : Pnt2d from gp; |
262 | last_point : Pnt2d from gp; |
263 | |
264 | periodfirst : Real from Standard; |
265 | periodlast : Real from Standard; |
266 | |
267 | end Domain; |
268 | |
269 | |
270 | |
271 | |
272 | |