b311480e |
1 | -- Created on: 1996-01-23 |
2 | -- Created by: Laurent PAINNOT |
3 | -- Copyright (c) 1996-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 | class GenExtCS from Extrema |
23 | |
24 | ---Purpose: It calculates all the extremum distances |
25 | -- between acurve and a surface. |
26 | -- These distances can be minimum or maximum. |
27 | |
28 | uses POnSurf from Extrema, |
29 | POnCurv from Extrema, |
30 | Pnt from gp, |
31 | HArray1OfPnt from TColgp, |
32 | HArray2OfPnt from TColgp, |
33 | FuncExtCS from Extrema, |
34 | Surface from Adaptor3d, |
35 | SurfacePtr from Adaptor3d, |
36 | Curve from Adaptor3d, |
37 | CurvePtr from Adaptor3d |
38 | |
39 | raises NotDone from StdFail, |
40 | OutOfRange from Standard, |
41 | TypeMismatch from Standard |
42 | |
43 | |
44 | is |
45 | |
46 | Create returns GenExtCS; |
47 | |
48 | Create (C: Curve from Adaptor3d; S: Surface from Adaptor3d; |
49 | NbT: Integer; NbU,NbV: Integer; Tol1,Tol2: Real) |
50 | returns GenExtCS; |
51 | ---Purpose: It calculates all the distances. |
52 | -- The function F(u,v)=distance(S1(u1,v1),S2(u2,v2)) has an |
53 | -- extremum when gradient(F)=0. The algorithm searchs |
54 | -- all the zeros inside the definition ranges of the |
55 | -- surfaces. |
56 | -- NbU and NbV are used to locate the close points on the |
57 | -- surface and NbT on the curve to find the zeros. |
58 | |
59 | Create (C: Curve from Adaptor3d; S: Surface from Adaptor3d; |
60 | NbT,NbU,NbV: Integer; |
61 | tmin, tsup: Real; |
62 | Umin, Usup, Vmin, Vsup: Real; |
63 | Tol1,Tol2: Real) |
64 | returns GenExtCS; |
65 | ---Purpose: It calculates all the distances. |
66 | -- The function F(u,v)=distance(P,S(u,v)) has an |
67 | -- extremum when gradient(F)=0. The algorithm searchs |
68 | -- all the zeros inside the definition ranges of the |
69 | -- surface. |
70 | -- NbT,NbU and NbV are used to locate the close points |
71 | -- to find the zeros. |
72 | |
73 | Initialize(me: in out; S: Surface from Adaptor3d; |
74 | NbU, NbV: Integer; Tol2: Real) |
75 | ---Pupose: sets the fields of the algorithm. |
76 | is static; |
77 | |
78 | |
79 | Initialize(me: in out; S: Surface from Adaptor3d; NbU, NbV: Integer; |
80 | Umin, Usup, Vmin, Vsup: Real; Tol2: Real) |
81 | ---Pupose: sets the fields of the algorithm. |
82 | is static; |
83 | |
84 | |
85 | Perform(me: in out; C: Curve from Adaptor3d; |
86 | NbT: Integer; Tol1: Real) |
87 | ---Purpose: the algorithm is done with S |
88 | -- An exception is raised if the fields have not |
89 | -- been initialized. |
90 | raises TypeMismatch from Standard |
91 | is static; |
92 | |
93 | Perform(me: in out; C: Curve from Adaptor3d; NbT: Integer; |
94 | tmin, tsup: Real; Tol1: Real) |
95 | ---Purpose: the algorithm is done with C |
96 | -- An exception is raised if the fields have not |
97 | -- been initialized. |
98 | raises TypeMismatch from Standard |
99 | is static; |
100 | |
101 | |
102 | IsDone (me) returns Boolean |
103 | ---Purpose: Returns True if the distances are found. |
104 | is static; |
105 | |
106 | NbExt (me) returns Integer |
107 | ---Purpose: Returns the number of extremum distances. |
108 | raises NotDone from StdFail |
109 | -- if IsDone(me)=False. |
110 | is static; |
111 | |
112 | SquareDistance(me; N: Integer) returns Real |
113 | ---Purpose: Returns the value of the Nth resulting square distance. |
114 | raises NotDone from StdFail, |
115 | -- if IsDone(me)=False. |
116 | OutOfRange |
117 | -- if N < 1 or N > NbPoints(me). |
118 | is static; |
119 | |
120 | PointOnCurve (me; N: Integer) returns POnCurv |
121 | ---Purpose: Returns the point of the Nth resulting distance. |
122 | ---C++: return const& |
123 | raises NotDone from StdFail, |
124 | -- if IsDone(me)=False. |
125 | OutOfRange |
126 | -- if N < 1 or N > NbPoints(me). |
127 | is static; |
128 | |
129 | PointOnSurface (me; N: Integer) returns POnSurf |
130 | ---Purpose: Returns the point of the Nth resulting distance. |
131 | ---C++: return const& |
132 | raises NotDone from StdFail, |
133 | -- if IsDone(me)=False. |
134 | OutOfRange |
135 | -- if N < 1 or N > NbPoints(me). |
136 | is static; |
137 | |
138 | BidonCurve(me) returns CurvePtr from Adaptor3d |
139 | is static private; |
140 | |
141 | BidonSurface(me) returns SurfacePtr from Adaptor3d |
142 | is static private; |
143 | |
144 | fields |
145 | myDone : Boolean; |
146 | myInit : Boolean; |
147 | mytmin : Real; |
148 | mytsup : Real; |
149 | myumin : Real; |
150 | myusup : Real; |
151 | myvmin : Real; |
152 | myvsup : Real; |
153 | mytsample : Integer; |
154 | myusample : Integer; |
155 | myvsample : Integer; |
156 | mypoints1 : HArray1OfPnt from TColgp; |
157 | mypoints2 : HArray2OfPnt from TColgp; |
158 | mytol1 : Real; |
159 | mytol2 : Real; |
160 | myF : FuncExtCS from Extrema; |
161 | myC : CurvePtr from Adaptor3d; |
162 | myS : SurfacePtr from Adaptor3d; |
163 | |
164 | end GenExtCS; |