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