b311480e |
1 | -- Created on: 1993-07-12 |
2 | -- Created by: Yves FRICAUD |
3 | -- Copyright (c) 1993-1999 Matra Datavision |
973c2be1 |
4 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | -- |
973c2be1 |
6 | -- This file is part of Open CASCADE Technology software library. |
b311480e |
7 | -- |
973c2be1 |
8 | -- This library is free software; you can redistribute it and / or modify it |
9 | -- under the terms of the GNU Lesser General Public 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. |
b311480e |
13 | -- |
973c2be1 |
14 | -- Alternatively, this file may be used under the terms of Open CASCADE |
15 | -- commercial license or contractual agreement. |
7fd59977 |
16 | |
17 | class Tool2d from MAT2d |
18 | |
19 | ---Purpose: Set of the methods useful for the MAT's computation. |
20 | -- Tool2d contains the geometry of the bisecting locus. |
21 | |
22 | |
23 | uses |
24 | |
25 | Bisec from Bisector, |
26 | Side from MAT, |
27 | Bisector from MAT, |
28 | Connexion from MAT2d, |
29 | Circuit from MAT2d, |
30 | DataMapOfIntegerBisec from MAT2d, |
31 | DataMapOfIntegerPnt2d from MAT2d, |
32 | DataMapOfIntegerVec2d from MAT2d, |
33 | SequenceOfInteger from TColStd, |
34 | Pnt2d from gp, |
35 | Vec2d from gp, |
36 | TrimmedCurve from Geom2d, |
37 | Curve from Geom2d, |
38 | Geometry from Geom2d |
39 | |
40 | is |
41 | Create returns Tool2d from MAT2d; |
42 | --- Purpose : Empty Constructor. |
43 | |
44 | --- Category : Initialisation. |
45 | |
46 | Sense(me : in out ; aside : Side from MAT) |
47 | --- Purpose :<aSide> defines the side of the computation of the map. |
48 | is static; |
49 | |
50 | InitItems(me : in out ; |
51 | aCircuit : Circuit from MAT2d ) |
52 | --- Purpose : InitItems cuts the line in Items. |
53 | -- this Items are the geometrics representations of |
54 | -- the BasicElts from MAT. |
55 | is static; |
56 | |
57 | --- Category : Set of the methods used by the algorithm MAT from MAT. |
58 | |
59 | NumberOfItems(me) |
60 | --- Purpose : Returns the Number of Items . |
61 | returns Integer is static; |
62 | |
63 | ToleranceOfConfusion(me) returns Real |
64 | ---Purpose: Returns tolerance to test the confusion of two points. |
65 | is static; |
66 | |
67 | FirstPoint(me : in out ; anitem : Integer; |
68 | dist : out Real ) |
69 | --- Purpose : Creates the point at the origin of the bisector between |
70 | -- anitem and the previous item. |
71 | -- dist is the distance from the FirstPoint to <anitem>. |
72 | -- Returns the index of this point in <theGeomPnts>. |
73 | returns Integer is static; |
74 | |
75 | TangentBefore(me : in out ; anitem : Integer) |
76 | --- Purpose : Creates the Tangent at the end of the Item defined |
77 | -- by <anitem>. Returns the index of this vector in |
78 | -- <theGeomVecs> |
79 | returns Integer is static; |
80 | |
81 | TangentAfter(me : in out ; anitem : Integer) |
82 | --- Purpose : Creates the Reversed Tangent at the origin of the Item |
83 | -- defined by <anitem>. Returns the index of this vector in |
84 | -- <theGeomVecs> |
85 | returns Integer is static; |
86 | |
87 | Tangent(me : in out ; bisector : Integer) |
88 | --- Purpose : Creates the Tangent at the end of the bisector defined |
89 | -- by <bisector>. Returns the index of this vector in |
90 | -- <theGeomVecs> |
91 | returns Integer is static; |
92 | |
93 | CreateBisector(me : in out ; abisector : mutable Bisector from MAT) |
94 | --- Purpose : Creates the geometric bisector defined by <abisector>. |
95 | is static; |
96 | |
97 | TrimBisector(me : in out ; abisector : mutable Bisector from MAT) |
98 | --- Purpose : Trims the geometric bisector by the <firstparameter> |
99 | -- of <abisector>. |
100 | -- If the parameter is out of the bisector, Return FALSE. |
101 | -- else Return True. |
102 | returns Boolean is static; |
103 | |
104 | TrimBisector(me : in out ; |
105 | abisector : mutable Bisector from MAT ; |
106 | apoint : Integer) |
107 | --- Purpose : Trims the geometric bisector by the point of index |
108 | -- <apoint> in <theGeomPnts>. |
109 | -- If the point is out of the bisector, Return FALSE. |
110 | -- else Return True. |
111 | returns Boolean is static; |
112 | |
113 | IntersectBisector(me : in out ; |
114 | bisectorone : mutable Bisector from MAT ; |
115 | bisectortwo : mutable Bisector from MAT ; |
116 | intpnt : in out Integer) |
117 | --- Purpose : Computes the point of intersection between the |
118 | -- bisectors defined by <bisectorone> and |
119 | -- <bisectortwo> . |
120 | -- If this point exists, <intpnt> is its index |
121 | -- in <theGeomPnts> and Return the distance of the point |
122 | -- from the bisector else Return <RealLast>. |
123 | returns Real is static; |
124 | |
125 | Distance(me; |
126 | abisector : Bisector from MAT; |
127 | param1 : Real; |
128 | param2 : Real) |
129 | ---Purpose: Returns the distance between the two points designed |
130 | -- by their parameters on <abisector>. |
131 | returns Real is static; |
132 | |
133 | Dump(me ; bisector , erease : Integer) is static; |
134 | --- Purpose : displays informations about the bisector defined by |
135 | -- <bisector>. |
136 | |
137 | --- Category : Querying. |
138 | |
139 | GeomBis(me ; Index: Integer) |
140 | --- Purpose : Returns the <Bisec> of index <Index> in |
141 | -- <theGeomBisectors>. |
142 | -- |
143 | ---C++: return const & |
144 | returns Bisec from Bisector |
145 | is static; |
146 | |
147 | GeomElt(me ; Index: Integer) |
148 | --- Purpose : Returns the Geometry of index <Index> in <theGeomElts>. |
149 | returns Geometry from Geom2d |
150 | is static; |
151 | |
152 | GeomPnt(me ; Index: Integer) |
153 | --- Purpose : Returns the point of index <Index> in the <theGeomPnts>. |
154 | -- |
155 | ---C++: return const & |
156 | returns Pnt2d from gp |
157 | is static; |
158 | |
159 | GeomVec(me ; Index: Integer) |
160 | --- Purpose : Returns the vector of index <Index> in the |
161 | -- <theGeomVecs>. |
162 | -- |
163 | ---C++: return const & |
164 | returns Vec2d from gp |
165 | is static; |
166 | |
167 | Circuit(me) |
168 | ---Purpose: |
169 | -- |
170 | returns Circuit from MAT2d |
171 | is static; |
172 | |
173 | ---Category: Modification |
174 | |
175 | BisecFusion(me : in out; |
176 | Index1 : Integer; |
177 | Index2 : Integer) |
178 | is static; |
179 | |
180 | ChangeGeomBis(me : in out ; Index: Integer) |
181 | --- Purpose : Returns the <Bisec> of index <Index> in |
182 | -- <theGeomBisectors>. |
183 | -- |
184 | ---C++: return & |
185 | returns Bisec from Bisector |
186 | is static; |
187 | |
188 | ---Category: Private |
189 | |
190 | IsSameDistance(me ; |
191 | bisectorone , bisectortwo : any Bisector from MAT ; |
192 | apoint : Pnt2d from gp; |
193 | adistance : out Real) |
194 | --- Purpose : Returns True if the point <apoint> is equidistant to |
195 | -- the elements separated by bisectors <bisectorone> and |
196 | -- <bisectortwo>. |
197 | -- In this case <adistance> is the distance of the point |
198 | -- from the bisectors. |
199 | returns Boolean |
200 | is static private; |
201 | |
202 | Projection (me ; |
203 | IndexElt : Integer from Standard; |
204 | Point : Pnt2d from gp ; |
205 | Distance : out Real from Standard) |
206 | ---Purpose: Return <True> if the Point can be projected |
207 | -- on the element designed by <IndexElt>. |
208 | -- In this case <Distance> is the minimum of distance |
209 | -- between Point and its projections. |
210 | returns Boolean |
211 | is static private; |
212 | |
213 | TrimBisec (me ; |
214 | Bis : in out Bisec from Bisector ; |
215 | IndexEdge : Integer from Standard ; |
216 | OnLine : Boolean from Standard ; |
217 | StartOrEnd : Integer from Standard ) |
218 | is static private; |
219 | |
220 | fields |
221 | |
222 | theDirection : Real; |
223 | theNumberOfBisectors : Integer; |
224 | theNumberOfPnts : Integer; |
225 | theNumberOfVecs : Integer; |
226 | theCircuit : Circuit from MAT2d; |
227 | theGeomBisectors : DataMapOfIntegerBisec from MAT2d; |
228 | theGeomPnts : DataMapOfIntegerPnt2d from MAT2d; |
229 | theGeomVecs : DataMapOfIntegerVec2d from MAT2d; |
230 | theLinesLength : SequenceOfInteger from TColStd; |
231 | |
232 | end Tool2d; |
233 | |
234 | |
235 | |