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 Circ2dBisec
18
19from GccAna
20
21 ---Purpose: This class describes functions for building bisecting curves between two 2D circles.
22 -- A bisecting curve between two circles is a curve such
23 -- that each of its points is at the same distance from the
24 -- two circles. It can be an ellipse, hyperbola, circle or line,
25 -- depending on the relative position of the two circles.
26 -- The algorithm computes all the elementary curves which
27 -- are solutions. There is no solution if the two circles are coincident.
28 -- A Circ2dBisec object provides a framework for:
29 -- - defining the construction of the bisecting curves,
30 -- - implementing the construction algorithm, and consulting the result.
31
32uses Circ2d from gp,
33 Bisec from GccInt
34
35raises OutOfRange from Standard,
36 NotDone from StdFail
37
38is
39
40Create(Circ1,Circ2 : Circ2d from gp) returns Circ2dBisec;
41
42 ---Purpose: Constructs bisecting curves between the two circles Circ1 and Circ2.
43
44IsDone(me) returns Boolean from Standard
45is static;
46 ---Purpose: This method returns True if the construction algorithm succeeded.
47
48NbSolutions(me) returns Integer from Standard
49 ---Purpose: This method returns the number of solutions.
50 -- Raises NotDone if the construction algorithm didn't succeed.
51raises NotDone
52is static;
53
54
55ThisSolution(me ;
56 Index : Integer from Standard) returns Bisec from GccInt
57 ---Purpose: Returns the solution number Index
58 -- Raises OutOfRange exception if Index is greater than
59 -- the number of solutions.
60 -- It raises NotDone if the construction algorithm
61 -- didn't succeed.
62raises OutOfRange, NotDone
63is static;
64
65fields
66
67 WellDone : Boolean from Standard;
68 ---Purpose: True if the algorithm succeeded.
69
70 NbrSol : Integer from Standard;
71 ---Purpose: The number of possible solutions.
72
73 intersection : Integer from Standard;
74 ---Purpose: c is the circle which has the lowest radius among Circ1 and
75 -- Circ2, and C is the other one.
76 -- intersection = 0 if c is completly inside C.
77 -- intersection = 1 if c is tangent to C and c is inside C.
78 -- intersection = 2 if c intersects C.
79 -- intersection = 3 if c is tangent to C and c is outside C.
80 -- intersection = 4 if c is completly outside C.
81
82 sameradius : Boolean from Standard;
83 ---Purpose: sameradius is true is Circ1 has the same radius as Circ2.
84
85 circle1 : Circ2d from gp;
86 ---Purpose: The first argument used for ThisSolution. It is the circle
87 -- which has the greatest radius or Circ1 if Circ1 and Circ2
88 -- has the same radius.
89
90 circle2 : Circ2d from gp;
91 ---Purpose: The second argument used for ThisSolution. It is the other
92 -- circle.
93
94end Circ2dBisec;