b311480e |
1 | -- Created on: 1992-09-28 |
2 | -- Created by: Remi GILET |
3 | -- Copyright (c) 1992-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 | class MakeArcOfCircle from GC inherits Root from GC |
23 | ---Purpose: Implements construction algorithms for an |
24 | -- arc of circle in 3D space. The result is a Geom_TrimmedCurve curve. |
25 | -- A MakeArcOfCircle object provides a framework for: |
26 | -- - defining the construction of the arc of circle, |
27 | -- - implementing the construction algorithm, and |
28 | -- - consulting the results. In particular, the |
29 | -- Value function returns the constructed arc of circle. |
30 | |
31 | uses Pnt from gp, |
32 | Circ from gp, |
33 | Dir from gp, |
34 | Ax1 from gp, |
35 | Vec from gp, |
36 | Real from Standard, |
37 | TrimmedCurve from Geom |
38 | |
39 | raises NotDone from StdFail |
40 | |
41 | is |
42 | |
43 | Create(Circ : Circ from gp ; |
44 | Alpha1, Alpha2 : Real from Standard ; |
45 | Sense : Boolean from Standard ) returns MakeArcOfCircle; |
46 | ---Purpose: Make an arc of circle (TrimmedCurve from Geom) from |
47 | -- a circle between two angles Alpha1 and Alpha2 |
48 | -- given in radiians. |
49 | |
50 | Create(Circ : Circ from gp ; |
51 | P : Pnt from gp ; |
52 | Alpha : Real from Standard ; |
53 | Sense : Boolean from Standard ) returns MakeArcOfCircle; |
54 | ---Purpose: Make an arc of circle (TrimmedCurve from Geom) from |
55 | -- a circle between point <P> and the angle Alpha |
56 | -- given in radians. |
57 | |
58 | Create(Circ : Circ from gp ; |
59 | P1 : Pnt from gp ; |
60 | P2 : Pnt from gp ; |
61 | Sense : Boolean from Standard ) returns MakeArcOfCircle; |
62 | ---Purpose: Make an arc of circle (TrimmedCurve from Geom) from |
63 | -- a circle between two points P1 and P2. |
64 | |
65 | Create(P1 : Pnt from gp ; |
66 | P2 : Pnt from gp ; |
67 | P3 : Pnt from gp ) |
68 | returns MakeArcOfCircle; |
69 | ---Purpose: Make an arc of circle (TrimmedCurve from Geom) from |
70 | -- three points P1,P2,P3 between two points P1 and P2. |
71 | |
72 | Create(P1 : Pnt from gp ; |
73 | V : Vec from gp ; |
74 | P2 : Pnt from gp ) |
75 | returns MakeArcOfCircle; |
76 | ---Purpose: Make an arc of circle (TrimmedCurve from Geom) from |
77 | -- two points P1,P2 and the tangente to the solution at |
78 | -- the point P1. |
79 | -- The orientation of the arc is: |
80 | -- - the sense determined by the order of the points P1, P3 and P2; |
81 | -- - the sense defined by the vector V; or |
82 | -- - for other syntaxes: |
83 | -- - the sense of Circ if Sense is true, or |
84 | -- - the opposite sense if Sense is false. |
85 | -- Note: Alpha1, Alpha2 and Alpha are angle values, given in radians. |
86 | -- Warning |
87 | -- If an error occurs (that is, when IsDone returns |
88 | -- false), the Status function returns: |
89 | -- - gce_ConfusedPoints if: |
90 | -- - any 2 of the 3 points P1, P2 and P3 are coincident, or |
91 | -- - P1 and P2 are coincident; or |
92 | -- - gce_IntersectionError if: |
93 | -- - P1, P2 and P3 are collinear and not coincident, or |
94 | -- - the vector defined by the points P1 and |
95 | -- P2 is collinear with the vector V. |
96 | |
97 | Value(me) returns TrimmedCurve from Geom |
98 | raises NotDone |
99 | is static; |
100 | ---Purpose: Returns the constructed arc of circle. |
101 | -- Exceptions StdFail_NotDone if no arc of circle is constructed. |
102 | ---C++: return const& |
103 | |
104 | Operator(me) returns TrimmedCurve from Geom |
105 | is static; |
106 | ---C++: return const& |
107 | ---C++: alias "Standard_EXPORT operator Handle_Geom_TrimmedCurve() const;" |
108 | |
109 | fields |
110 | |
111 | TheArc : TrimmedCurve from Geom; |
112 | --The solution from Geom. |
113 | |
114 | end MakeArcOfCircle; |