1 -- Created on: 1992-08-26
2 -- Created by: Remi GILET
3 -- Copyright (c) 1992-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.
17 class MakeCirc from gce inherits Root from gce
19 ---Purpose : This class implements the following algorithms used
20 -- to create Circ from gp.
22 -- * Create a Circ coaxial to another and passing
24 -- * Create a Circ coaxial to another at the distance
26 -- * Create a Circ passing through 3 points.
27 -- * Create a Circ with its center and the normal of its
28 -- plane and its radius.
29 -- * Create a Circ with its center and its plane and its
31 -- * Create a Circ with its axis and radius.
32 -- * Create a Circ with two points giving its axis and
34 -- * Create a Circ with is Ax2 and its Radius.
44 raises NotDone from StdFail
48 Create (A2 : Ax2 from gp ;
49 Radius : Real from Standard) returns MakeCirc;
51 -- A2 locates the circle and gives its orientation in 3D space.
53 -- It is not forbidden to create a circle with Radius = 0.0
54 --- The status is "NegativeRadius" if Radius < 0.0
56 Create(Circ : Circ from gp ;
57 Dist : Real from Standard) returns MakeCirc;
58 ---Purpose : Makes a Circ from gp <TheCirc> coaxial to another
59 -- Circ <Circ> at a distance <Dist>.
60 -- If Dist is greater than zero the result is encloses
61 -- the circle <Circ>, else the result is enclosed by the
64 Create(Circ : Circ from gp;
65 Point : Pnt from gp) returns MakeCirc;
66 ---Purpose : Makes a Circ from gp <TheCirc> coaxial to another
67 -- Circ <Circ> and passing through a Pnt2d <Point>.
69 Create(P1,P2,P3 : Pnt from gp) returns MakeCirc;
70 ---Purpose : Makes a Circ from gp <TheCirc> passing through 3
71 -- Pnt2d <P1>,<P2>,<P3>.
73 Create(Center : Pnt from gp ;
75 Radius : Real from Standard) returns MakeCirc;
76 ---Purpose : Makes a Circ from gp <TheCirc> with its center
77 -- <Center> and the normal of its plane <Norm> and
78 -- its radius <Radius>.
80 Create(Center : Pnt from gp ;
82 Radius : Real from Standard) returns MakeCirc;
83 ---Purpose : Makes a Circ from gp <TheCirc> with its center
84 -- <Center> and the normal of its plane <Plane> and
85 -- its radius <Radius>.
87 Create(Center : Pnt from gp ;
88 Ptaxis : Pnt from gp ;
89 Radius : Real from Standard) returns MakeCirc;
90 ---Purpose : Makes a Circ from gp <TheCirc> with its center
91 -- <Center> and a point <Ptaxis> giving the normal
92 -- of its plane <Plane> and its radius <Radius>.
94 Create(Axis : Ax1 from gp ;
95 Radius : Real from Standard) returns MakeCirc;
96 ---Purpose : Makes a Circ from gp <TheCirc> with its center
97 -- <Center> and its radius <Radius>.
99 -- The MakeCirc class does not prevent the
100 -- construction of a circle with a null radius.
101 -- If an error occurs (that is, when IsDone returns
102 -- false), the Status function returns:
103 -- - gce_Negative Radius if:
104 -- - Radius is less than 0.0, or
105 -- - Dist is less than 0.0 and the absolute value of
106 -- Dist is greater than the radius of Circ;
107 -- - gce_IntersectionError if the points P1, P2 and
108 -- P3 are collinear, and the three are not coincident;
109 -- - gce_ConfusedPoints if two of the three points
110 -- P1, P2 and P3 are coincident; or
111 -- - gce_NullAxis if Center and Ptaxis are coincident.
113 Value(me) returns Circ from gp
116 ---C++: return const&
117 ---Purpose: Returns the constructed circle.
118 -- Exceptions StdFail_NotDone if no circle is constructed.
120 Operator(me) returns Circ from gp
122 ---C++: return const&
123 ---C++: alias "Standard_EXPORT operator gp_Circ() const;"
127 TheCirc : Circ from gp;
128 --The solution from gp.