b311480e |
1 | -- Created on: 1991-04-03 |
2 | -- Created by: Remi GILET |
3 | -- Copyright (c) 1991-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 | |
23 | class CircPnt2dBisec |
24 | |
25 | from GccAna |
26 | |
27 | ---Purpose: Describes functions for building a bisecting curve |
28 | -- between a 2D circle and a point. |
29 | -- A bisecting curve between a circle and a point is such a |
30 | -- curve that each of its points is at the same distance from |
31 | -- the circle and the point. It can be an ellipse, hyperbola, |
32 | -- circle or line, depending on the relative position of the |
33 | -- point and the circle. The algorithm computes all the |
34 | -- elementary curves which are solutions. |
35 | -- A CircPnt2dBisec object provides a framework for: |
36 | -- - defining the construction of the bisecting curves, |
37 | -- - implementing the construction algorithm, and |
38 | -- - consulting the result. |
39 | |
40 | |
41 | uses Circ2d from gp, |
42 | Pnt2d from gp, |
43 | Bisec from GccInt |
44 | |
45 | raises OutOfRange from Standard, |
46 | NotDone from StdFail |
47 | |
48 | is |
49 | |
50 | Create(Circle1 : Circ2d from gp; |
51 | Point2 : Pnt2d from gp) returns CircPnt2dBisec; |
52 | |
53 | ---Purpose: Constructs bisecting curves between the circle Circle1 and the point Point2. |
54 | |
55 | IsDone(me) returns Boolean from Standard |
56 | is static; |
57 | ---Purpose: Returns true (this construction algorithm never fails). |
58 | |
59 | NbSolutions(me) returns Integer from Standard |
60 | raises NotDone |
61 | is static; |
62 | ---Purpose: Returns the number of curves, representing solutions computed by this algorithm. |
63 | |
64 | ThisSolution(me ; |
65 | Index : Integer from Standard) returns Bisec from GccInt |
66 | raises OutOfRange, NotDone |
67 | is static; |
68 | ---Purpose: Returns the solution number Index and raises OutOfRange |
69 | -- exception if Index is greater than the number of solutions. |
70 | -- Exceptions |
71 | -- Standard_OutOfRange if Index is less than zero or |
72 | -- greater than the number of solutions computed by this algorithm. |
73 | fields |
74 | |
75 | WellDone : Boolean from Standard; |
76 | ---Purpose: True if the algorithm succeeded. |
77 | |
78 | NbrSol : Integer from Standard; |
79 | ---Purpose: The number of possible solutions. We have to decide about the |
80 | -- status of the multiple solutions... |
81 | |
82 | circle : Circ2d from gp; |
83 | ---Purpose: The first argument used for ThisSolution. |
84 | |
85 | point : Pnt2d from gp; |
86 | ---Purpose: The second argument used for ThisSolution. |
87 | |
88 | theposition : Integer from Standard; |
89 | ---Purpose: theposition = 1 when the point is outside the circle. |
90 | -- theposition = 0 when the point is on the circle. |
91 | -- theposition = -1 when the point is inside the circle. |
92 | |
93 | end CircPnt2dBisec; |