1 -- Created on: 1991-04-03
2 -- Created by: Remi GILET
3 -- Copyright (c) 1991-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
6 -- This file is part of Open CASCADE Technology software library.
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
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.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
21 ---Purpose: This class implements the algorithms used to
22 -- create 2d lines tangent to a circle or a point and
23 -- perpendicular to a line or a circle.
24 -- Describes functions for building a 2D line perpendicular
26 -- - tangential to a circle, or
27 -- - passing through a point.
28 -- A Lin2dTanPer object provides a framework for:
29 -- - defining the construction of 2D line(s),
30 -- - implementing the construction algorithm, and
31 -- - consulting the result(s).
33 --inherits Storable from Standard
38 QualifiedCirc from GccEnt,
39 Array1OfReal from TColStd,
40 Array1OfLin2d from TColgp,
41 Array1OfPnt2d from TColgp,
43 Array1OfPosition from GccEnt
45 raises BadQualifier from GccEnt,
46 OutOfRange from Standard,
47 ConstructionError from Standard,
52 Create(ThePnt : Pnt2d from gp;
53 TheLin : Lin2d from gp) returns Lin2dTanPer;
54 ---Purpose: This method implements the algorithms used to
55 -- create 2d lines passing through a point and
56 -- perpendicular to a line.
58 Create(ThePnt : Pnt2d from gp;
59 TheCircle : Circ2d from gp) returns Lin2dTanPer
60 raises ConstructionError;
61 ---Purpose: This method implements the algorithms used to
62 -- create 2d lines passing through a point and
63 -- perpendicular to a circle.
65 Create(Qualified1 : QualifiedCirc from GccEnt;
66 TheLin : Lin2d from gp ) returns Lin2dTanPer
68 -- Raises BadQualifier in case of EnclosedCirc.
69 ---Purpose: This method implements the algorithms used to
70 -- create 2d lines tangent to a circle and
71 -- perpendicular to a line.
73 Create(Qualified1 : QualifiedCirc from GccEnt;
74 TheCircle : Circ2d from gp ) returns Lin2dTanPer
75 raises BadQualifier,ConstructionError;
76 -- Raises BadQualifier in case of EnclosedCirc.
77 ---Purpose: This method implements the algorithms used to
78 -- create 2d lines tangent to a circle and
79 -- perpendicular to a circle.
81 -- .........................................................................
83 IsDone(me) returns Boolean from Standard
85 ---Purpose : Returns True if the algorithm succeeded.
87 NbSolutions(me) returns Integer from Standard
88 ---Purpose : Returns the number of solutions.
89 -- Raises NotDone if the construction algorithm didn't succeed.
95 Index : Integer from Standard;
96 Qualif1 : out Position from GccEnt )
97 raises OutOfRange, NotDone
99 ---Purpose: Returns the qualifier Qualif1 of the tangency argument
100 -- for the solution of index Index computed by this algorithm.
101 -- The returned qualifier is:
102 -- - that specified at the start of construction when the
103 -- solutions are defined as enclosing or outside with
104 -- respect to the argument, or
105 -- - that computed during construction (i.e. enclosing or
106 -- outside) when the solutions are defined as unqualified
107 -- with respect to the argument, or
108 -- - GccEnt_noqualifier if the tangency argument is a point.
110 -- Standard_OutOfRange if Index is less than zero or
111 -- greater than the number of solutions computed by this algorithm.
112 -- StdFail_NotDone if the construction fails.
115 Index : Integer from Standard) returns Lin2d from gp
116 ---Purpose : Returns the solution number Index and raises OutOfRange
117 -- exception if Index is greater than the number of solutions.
118 -- Be careful: the Index is only a way to get all the
119 -- solutions, but is not associated to those outside the
120 -- context of the algorithm-object.
121 -- Raises NotDone if the construction algorithm
123 -- It raises OutOfRange if Index is greater than the
124 -- number of solutions.
125 raises OutOfRange, NotDone
129 Index : Integer from Standard;
130 ParSol,ParArg : out Real from Standard;
131 Pnt : out Pnt2d from gp )
132 ---Purpose : Returns informations about the tangency point between the
133 -- result number Index and the first argument.
134 -- ParSol is the intrinsic parameter of the point on the
136 -- ParArg is the intrinsic parameter of the point on the
138 -- If the first argument is a point ParArg is equal zero.
139 -- raises NotDone if the construction algorithm didn't succeed.
140 -- It raises OutOfRange if Index is greater than the
141 -- number of solutions.
142 raises OutOfRange, NotDone
147 Index : Integer from Standard;
148 ParSol,ParArg : out Real from Standard;
149 PntSol : out Pnt2d from gp )
150 ---Purpose : Returns informations about the intersection between the
151 -- solution number Index and the second argument.
152 -- It returns the first intersection in a case of
153 -- Lin2dTanPer which is perpendicular to a circle .
154 -- ParSol is the intrinsic parameter of the point on the
156 -- ParArg is the intrinsic parameter of the point on the
157 -- argument curv. Raises NotDone if the construction algorithm
159 -- It raises OutOfRange if Index is greater than the
160 -- number of solutions.
162 raises OutOfRange, NotDone
168 WellDone : Boolean from Standard;
169 ---Purpose: True if the algorithm succeeded.
171 NbrSol : Integer from Standard;
172 ---Purpose: The number of possible solutions. We have to decide
173 -- about the status of the multiple solutions...
175 linsol : Array1OfLin2d from TColgp;
176 ---Purpose: The solutions.
178 qualifier1 : Array1OfPosition from GccEnt;
179 ---Purpose: The qualifiers of the first argument.
181 pnttg1sol : Array1OfPnt2d from TColgp;
182 ---Purpose: The tangency point between the solution and the first
183 -- argument on the solution.
185 pntint2sol : Array1OfPnt2d from TColgp;
186 ---Purpose: The tangency point between the solution and the second
187 -- argument on the solution.
189 par1sol : Array1OfReal from TColStd;
190 ---Purpose: The parameter of the tangency point between the solution
191 -- and the first argument on the solution.
193 par2sol : Array1OfReal from TColStd;
194 ---Purpose: The parameter of the tangency point between the solution
195 -- and the second argument on the solution.
197 pararg1 : Array1OfReal from TColStd;
198 ---Purpose: The parameter of the tangency point between the solution
199 -- and the first argument on the first argument.
201 pararg2 : Array1OfReal from TColStd;
202 ---Purpose: The parameter of the tangency point between the solution
203 -- and the second argument on the second argument.