b311480e |
1 | // Created on: 1992-10-02 |
2 | // Created by: Remi GILET |
3 | // Copyright (c) 1992-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 | // |
d5f74e42 |
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 |
973c2be1 |
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 | |
17 | #include <GC_MakeCircle.ixx> |
18 | #include <gce_MakeCirc.hxx> |
19 | #include <StdFail_NotDone.hxx> |
20 | |
21 | GC_MakeCircle::GC_MakeCircle(const gp_Circ& C) |
22 | { |
23 | TheError = gce_Done; |
24 | TheCircle = new Geom_Circle(C); |
25 | } |
26 | |
27 | GC_MakeCircle::GC_MakeCircle(const gp_Ax2& A2 , |
28 | const Standard_Real Radius) |
29 | { |
30 | if (Radius < 0.) { TheError = gce_NegativeRadius; } |
31 | else { |
32 | TheError = gce_Done; |
33 | TheCircle = new Geom_Circle(gp_Circ(A2,Radius)); |
34 | } |
35 | } |
36 | |
37 | GC_MakeCircle::GC_MakeCircle(const gp_Circ& Circ , |
38 | const gp_Pnt& Point ) |
39 | { |
40 | gp_Circ C = gce_MakeCirc(Circ,Point); |
41 | TheCircle = new Geom_Circle(C); |
42 | TheError = gce_Done; |
43 | } |
44 | |
45 | GC_MakeCircle::GC_MakeCircle(const gp_Circ& Circ , |
46 | const Standard_Real Dist ) |
47 | { |
48 | gce_MakeCirc C = gce_MakeCirc(Circ,Dist); |
49 | TheError = C.Status(); |
50 | if (TheError == gce_Done) { |
51 | TheCircle = new Geom_Circle(C.Value()); |
52 | } |
53 | } |
54 | |
55 | GC_MakeCircle::GC_MakeCircle(const gp_Pnt& P1 , |
56 | const gp_Pnt& P2 , |
57 | const gp_Pnt& P3 ) |
58 | { |
59 | gce_MakeCirc C = gce_MakeCirc(P1,P2,P3); |
60 | TheError = C.Status(); |
61 | if (TheError == gce_Done) { |
62 | TheCircle = new Geom_Circle(C.Value()); |
63 | } |
64 | } |
65 | |
66 | GC_MakeCircle::GC_MakeCircle(const gp_Pnt& Point , |
67 | const gp_Dir& Norm , |
68 | const Standard_Real Radius ) |
69 | { |
70 | gce_MakeCirc C = gce_MakeCirc(Point,Norm,Radius); |
71 | TheError = C.Status(); |
72 | if (TheError == gce_Done) { |
73 | TheCircle = new Geom_Circle(C.Value()); |
74 | } |
75 | } |
76 | |
77 | GC_MakeCircle::GC_MakeCircle(const gp_Pnt& Point , |
78 | const gp_Pnt& PtAxis , |
79 | const Standard_Real Radius ) |
80 | { |
81 | gce_MakeCirc C = gce_MakeCirc(Point,PtAxis,Radius); |
82 | TheError = C.Status(); |
83 | if (TheError == gce_Done) { |
84 | TheCircle = new Geom_Circle(C.Value()); |
85 | } |
86 | } |
87 | |
88 | GC_MakeCircle::GC_MakeCircle(const gp_Ax1& Axis , |
89 | const Standard_Real Radius ) |
90 | { |
91 | gce_MakeCirc C = gce_MakeCirc(Axis,Radius); |
92 | TheError = C.Status(); |
93 | if (TheError == gce_Done) { |
94 | TheCircle = new Geom_Circle(C.Value()); |
95 | } |
96 | } |
97 | |
98 | const Handle(Geom_Circle)& GC_MakeCircle::Value() const |
99 | { |
82fc327c |
100 | StdFail_NotDone_Raise_if(TheError != gce_Done,""); |
7fd59977 |
101 | return TheCircle; |
102 | } |
103 | |
104 | const Handle(Geom_Circle)& GC_MakeCircle::Operator() const |
105 | { |
106 | return Value(); |
107 | } |
108 | |
109 | GC_MakeCircle::operator Handle(Geom_Circle) () const |
110 | { |
111 | return Value(); |
112 | } |
113 | |