1 // Created on: 1992-10-02
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 #include <GCE2d_MakeCircle.ixx>
18 #include <gce_MakeCirc2d.hxx>
19 #include <Geom2d_Circle.hxx>
20 #include <StdFail_NotDone.hxx>
22 GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Circ2d& C)
25 TheCircle = new Geom2d_Circle(C);
28 GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Ax2d& A ,
29 const Standard_Real Radius,
30 const Standard_Boolean Sense )
32 if (Radius < 0.0) { TheError = gce_NegativeRadius; }
35 TheCircle = new Geom2d_Circle(A,Radius,Sense);
39 GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Ax22d& A ,
40 const Standard_Real Radius)
42 if (Radius < 0.0) { TheError = gce_NegativeRadius; }
45 TheCircle = new Geom2d_Circle(A,Radius);
49 GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Circ2d& Circ ,
50 const gp_Pnt2d& Point )
52 gp_Circ2d C = gce_MakeCirc2d(Circ,Point);
53 TheCircle = new Geom2d_Circle(C);
57 GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Circ2d& Circ ,
58 const Standard_Real Dist )
60 gce_MakeCirc2d C = gce_MakeCirc2d(Circ,Dist);
61 TheError = C.Status();
62 if (TheError == gce_Done) {
63 TheCircle = new Geom2d_Circle(C.Value());
67 GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Pnt2d& P1 ,
71 gce_MakeCirc2d C = gce_MakeCirc2d(P1,P2,P3);
72 TheError = C.Status();
73 if (TheError == gce_Done) {
74 TheCircle = new Geom2d_Circle(C.Value());
79 GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Pnt2d& Point ,
80 const Standard_Real Radius ,
81 const Standard_Boolean Sense )
83 gce_MakeCirc2d C = gce_MakeCirc2d(Point,Radius,Sense);
84 TheError = C.Status();
85 if (TheError == gce_Done) {
86 TheCircle = new Geom2d_Circle(C.Value());
90 GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Pnt2d& Center ,
91 const gp_Pnt2d& Point ,
92 const Standard_Boolean Sense )
94 gce_MakeCirc2d C = gce_MakeCirc2d(Center,Point,Sense);
95 TheError = C.Status();
96 if (TheError == gce_Done) {
97 TheCircle = new Geom2d_Circle(C.Value());
101 const Handle(Geom2d_Circle)& GCE2d_MakeCircle::Value() const
103 StdFail_NotDone_Raise_if(TheError != gce_Done,"");
107 const Handle(Geom2d_Circle)& GCE2d_MakeCircle::Operator() const
112 GCE2d_MakeCircle::operator Handle(Geom2d_Circle) () const