0028838: Configuration - undefine macros coming from X11 headers in place of collision
[occt.git] / src / GCE2d / GCE2d_MakeCircle.cxx
CommitLineData
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
42cf5bc1 17
18#include <GCE2d_MakeCircle.hxx>
7fd59977 19#include <gce_MakeCirc2d.hxx>
20#include <Geom2d_Circle.hxx>
42cf5bc1 21#include <gp_Ax2d.hxx>
22#include <gp_Ax22d.hxx>
23#include <gp_Circ2d.hxx>
24#include <gp_Pnt2d.hxx>
7fd59977 25#include <StdFail_NotDone.hxx>
26
27GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Circ2d& C)
28{
29 TheError = gce_Done;
30 TheCircle = new Geom2d_Circle(C);
31}
32
33GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Ax2d& A ,
34 const Standard_Real Radius,
35 const Standard_Boolean Sense )
36{
37 if (Radius < 0.0) { TheError = gce_NegativeRadius; }
38 else {
39 TheError = gce_Done;
40 TheCircle = new Geom2d_Circle(A,Radius,Sense);
41 }
42}
43
44GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Ax22d& A ,
45 const Standard_Real Radius)
46{
47 if (Radius < 0.0) { TheError = gce_NegativeRadius; }
48 else {
49 TheError = gce_Done;
50 TheCircle = new Geom2d_Circle(A,Radius);
51 }
52}
53
54GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Circ2d& Circ ,
55 const gp_Pnt2d& Point )
56{
57 gp_Circ2d C = gce_MakeCirc2d(Circ,Point);
58 TheCircle = new Geom2d_Circle(C);
59 TheError = gce_Done;
60}
61
62GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Circ2d& Circ ,
63 const Standard_Real Dist )
64{
65 gce_MakeCirc2d C = gce_MakeCirc2d(Circ,Dist);
66 TheError = C.Status();
67 if (TheError == gce_Done) {
68 TheCircle = new Geom2d_Circle(C.Value());
69 }
70}
71
72GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Pnt2d& P1 ,
73 const gp_Pnt2d& P2 ,
74 const gp_Pnt2d& P3 )
75{
76 gce_MakeCirc2d C = gce_MakeCirc2d(P1,P2,P3);
77 TheError = C.Status();
78 if (TheError == gce_Done) {
79 TheCircle = new Geom2d_Circle(C.Value());
80 }
81
82}
83
84GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Pnt2d& Point ,
85 const Standard_Real Radius ,
86 const Standard_Boolean Sense )
87{
88 gce_MakeCirc2d C = gce_MakeCirc2d(Point,Radius,Sense);
89 TheError = C.Status();
90 if (TheError == gce_Done) {
91 TheCircle = new Geom2d_Circle(C.Value());
92 }
93}
94
95GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Pnt2d& Center ,
96 const gp_Pnt2d& Point ,
97 const Standard_Boolean Sense )
98{
99 gce_MakeCirc2d C = gce_MakeCirc2d(Center,Point,Sense);
100 TheError = C.Status();
101 if (TheError == gce_Done) {
102 TheCircle = new Geom2d_Circle(C.Value());
103 }
104}
105
106const Handle(Geom2d_Circle)& GCE2d_MakeCircle::Value() const
107{
2d2b3d53 108 StdFail_NotDone_Raise_if (TheError != gce_Done,
109 "GCE2d_MakeCircle::Value() - no result");
7fd59977 110 return TheCircle;
111}