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