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