b311480e |
1 | -- Created on: 1991-04-03 |
2 | -- Created by: Remi GILET |
3 | -- Copyright (c) 1991-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 | -- |
d5f74e42 |
8 | -- This library is free software; you can redistribute it and/or modify it under |
9 | -- the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
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 Lin2dTanObl |
18 | |
19 | from GccAna |
20 | |
21 | ---Purpose: This class implements the algorithms used to |
22 | -- create 2d line tangent to a circle or a point and |
23 | -- making an angle with a line. |
24 | -- The angle is in radians. |
25 | -- The origin of the solution is the tangency point |
26 | -- with the first argument. |
27 | -- Its direction is making an angle Angle with the |
28 | -- second argument. |
29 | |
30 | --inherits Storable from Standard |
31 | |
32 | uses Lin2d from gp, |
33 | Pnt2d from gp, |
34 | QualifiedCirc from GccEnt, |
35 | Array1OfReal from TColStd, |
36 | Array1OfLin2d from TColgp, |
37 | Array1OfPnt2d from TColgp, |
38 | Position from GccEnt, |
39 | Array1OfPosition from GccEnt |
40 | |
41 | raises OutOfRange from Standard, |
42 | BadQualifier from GccEnt, |
43 | NotDone from StdFail |
44 | |
45 | is |
46 | |
47 | --------------------------------------------------------------------------- |
48 | |
49 | Create (ThePoint : Pnt2d from gp ; |
50 | TheLine : Lin2d from gp ; |
51 | TheAngle : Real from Standard) returns Lin2dTanObl; |
52 | ---Purpose: This class implements the algorithms used to |
53 | -- create 2d line passing through a point and |
54 | -- making an angle with a line. |
55 | |
56 | Create (Qualified1 : QualifiedCirc from GccEnt ; |
57 | TheLine : Lin2d from gp ; |
58 | TheAngle : Real from Standard) returns Lin2dTanObl |
59 | raises BadQualifier; |
60 | ---Purpose: This class implements the algorithms used to |
61 | -- create 2d line tangent to a circle and |
62 | -- making an angle with a line. |
63 | -- Exceptions |
64 | -- GccEnt_BadQualifier if a qualifier is inconsistent with |
65 | -- the argument it qualifies (for example, enclosed for a circle). |
66 | |
67 | IsDone(me) returns Boolean from Standard |
68 | is static; |
69 | ---Purpose : Returns True if the algorithm succeeded. |
70 | -- Note: IsDone protects against a failure arising from a |
71 | -- more internal intersection algorithm, which has reached |
72 | -- its numeric limits. |
73 | |
74 | NbSolutions(me) returns Integer from Standard |
75 | ---Purpose : Returns the number of of lines, representing solutions computed by this algorithm. |
76 | -- Raises NotDone if the construction algorithm didn't succeed. |
77 | |
78 | raises NotDone |
79 | is static; |
80 | |
81 | ThisSolution(me ; |
82 | Index : Integer from Standard) returns Lin2d |
83 | ---Purpose: Returns the solution number Index. |
84 | -- Be careful: the Index is only a way to get all the |
85 | -- solutions, but is not associated to theses outside the |
86 | -- context of the algorithm-object. |
87 | -- raises NotDone if the construction algorithm didn't succeed. |
88 | -- It raises OutOfRange if Index is greater than the number of solutions. |
89 | raises OutOfRange, NotDone |
90 | is static; |
91 | |
92 | WhichQualifier(me ; |
93 | Index : Integer from Standard; |
94 | Qualif1 : out Position from GccEnt ) |
95 | raises OutOfRange, NotDone |
96 | is static; |
97 | ---Purpose: Returns the qualifier Qualif1 of the tangency argument |
98 | -- for the solution of index Index computed by this algorithm. |
99 | -- The returned qualifier is: |
100 | -- - that specified at the start of construction when the |
101 | -- solutions are defined as enclosing or outside with |
102 | -- respect to the argument, or |
103 | -- - that computed during construction (i.e. enclosing or |
104 | -- outside) when the solutions are defined as unqualified |
105 | -- with respect to the argument, or |
106 | -- - GccEnt_noqualifier if the tangency argument is a point. |
107 | -- Exceptions |
108 | -- Standard_OutOfRange if Index is less than zero or |
109 | -- greater than the number of solutions computed by this algorithm. |
110 | -- StdFail_NotDone if the construction fails. |
111 | |
112 | Tangency1(me ; |
113 | Index : Integer from Standard; |
114 | ParSol,ParArg : out Real from Standard; |
115 | PntSol : out Pnt2d from gp ) |
116 | ---Purpose : Returns informations about the tangency point between the |
117 | -- result number Index and the first argument. |
118 | -- ParSol is the intrinsic parameter of the point ParSol on |
119 | -- the solution curv. |
120 | -- ParArg is the intrinsic parameter of the point ParArg on |
121 | -- the argument curv. Raises NotDone if the construction algorithm |
122 | -- didn't succeed. |
123 | -- It raises OutOfRange if Index is greater than the number of solutions. |
124 | raises OutOfRange, NotDone |
125 | is static; |
126 | |
127 | |
128 | Intersection2 (me ; |
129 | Index : Integer from Standard; |
130 | ParSol,ParArg : out Real from Standard; |
131 | PntSol : out Pnt2d from gp ) |
132 | ---Purpose : Returns informations about the intersection between the |
133 | -- result number Index and the third argument. |
134 | -- Raises NotDone if the construction algorithm didn't succeed. |
135 | -- It raises OutOfRange if Index is greater than the number of solutions. |
136 | raises OutOfRange, NotDone |
137 | is static; |
138 | |
139 | fields |
140 | |
141 | WellDone : Boolean from Standard; |
142 | ---Purpose : True if the algorithm succeeded. |
143 | |
144 | NbrSol : Integer from Standard; |
145 | ---Purpose : The number of possible solutions. We have to decide about the |
146 | -- status of the multiple solutions... |
147 | |
148 | linsol : Array1OfLin2d from TColgp; |
149 | ---Purpose : The solutions. |
150 | |
151 | qualifier1 : Array1OfPosition from GccEnt; |
152 | ---Purpose: The qualifiers of the first argument. |
153 | |
154 | pnttg1sol : Array1OfPnt2d from TColgp; |
155 | ---Purpose: The tangency point between the solution and the first argument on |
156 | -- the solution. |
157 | |
158 | pntint2sol : Array1OfPnt2d from TColgp; |
159 | ---Purpose: The tangency point between the solution and the second argument on |
160 | -- the solution. |
161 | |
162 | par1sol : Array1OfReal from TColStd; |
163 | ---Purpose: The parameter of the tangency point between the solution and the |
164 | -- first argument on the solution. |
165 | |
166 | par2sol : Array1OfReal from TColStd; |
167 | ---Purpose: The parameter of the tangency point between the solution and the |
168 | -- second argument on the solution. |
169 | |
170 | pararg1 : Array1OfReal from TColStd; |
171 | ---Purpose: The parameter of the tangency point between the solution and the first |
172 | -- argument on the first argument. |
173 | |
174 | pararg2 : Array1OfReal from TColStd; |
175 | ---Purpose: The parameter of the tangency point between the solution and the second |
176 | -- argument on the second argument. |
177 | |
178 | end Lin2dTanObl; |
179 | |