0026747: Some constructors of gp_Parab2d class contain redundant parameters
[occt.git] / src / gce / gce_MakeElips2d.hxx
CommitLineData
42cf5bc1 1// Created on: 1992-08-26
2// Created by: Remi GILET
3// Copyright (c) 1992-1999 Matra Datavision
4// Copyright (c) 1999-2014 OPEN CASCADE SAS
5//
6// This file is part of Open CASCADE Technology software library.
7//
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.
13//
14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
16
17#ifndef _gce_MakeElips2d_HeaderFile
18#define _gce_MakeElips2d_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_DefineAlloc.hxx>
22#include <Standard_Handle.hxx>
23
24#include <gp_Elips2d.hxx>
25#include <gce_Root.hxx>
26#include <Standard_Real.hxx>
27#include <Standard_Boolean.hxx>
28class StdFail_NotDone;
29class gp_Ax2d;
30class gp_Ax22d;
31class gp_Pnt2d;
32class gp_Elips2d;
33
34
35//! This class implements the following algorithms used to
36//! create Elips2d from gp.
37//!
38//! * Create an ellipse from its center, and two points:
39//! one on the ciconference giving the major radius, the
40//! other giving the value of the small radius.
41//! * Create an ellipse from its major axis and its major
42//! radius and its minor radius.
43class gce_MakeElips2d : public gce_Root
44{
45public:
46
47 DEFINE_STANDARD_ALLOC
48
49
50
51 //! Creates an ellipse with the major axis, the major and the
52 //! minor radius. The location of the MajorAxis is the center
53 //! of the ellipse.
54 //! The sense of parametrization is given by Sense.
55 //! It is possible to create an ellipse with MajorRadius = MinorRadius.
56 //! the status is "InvertRadius" if MajorRadius < MinorRadius or
57 //! "NegativeRadius" if MinorRadius < 0.0
58 Standard_EXPORT gce_MakeElips2d(const gp_Ax2d& MajorAxis, const Standard_Real MajorRadius, const Standard_Real MinorRadius, const Standard_Boolean Sense = Standard_True);
59
60
61 //! Axis defines the Xaxis and Yaxis of the ellipse which defines
62 //! the origin and the sense of parametrization.
63 //! Creates an ellipse with the AxisPlacement the major and the
64 //! minor radius. The location of Axis is the center
65 //! of the ellipse.
66 //! It is possible to create an ellipse with MajorRadius = MinorRadius.
67 //! the status is "InvertRadius" if MajorRadius < MinorRadius or
68 //! "NegativeRadius" if MinorRadius < 0.0
69 Standard_EXPORT gce_MakeElips2d(const gp_Ax22d& A, const Standard_Real MajorRadius, const Standard_Real MinorRadius);
70
71 //! Makes an Elips2d with its center and two points.
72 //! The sense of parametrization is given by S1, S2,
73 //! and Center.
74 //! Depending on the constructor, the implicit orientation of the ellipse is:
75 //! - the sense defined by A,
76 //! - the sense defined by points Center, S1 and S2,
77 //! - the trigonometric sense if Sense is not given or is true, or
78 //! - the opposite if Sense is false.
79 //! It is possible to construct an ellipse where the major
80 //! and minor radii are equal.
81 //! Warning
82 //! If an error occurs (that is, when IsDone returns
83 //! false), the Status function returns:
84 //! - gce_InvertRadius if MajorRadius is less than MinorRadius,
85 //! - gce_NegativeRadius if MajorRadius or
86 //! MinorRadius is less than 0.0,
87 //! - gce_NullAxis if points S1, S2 and Center are collinear, or
88 //! - gce_InvertAxis if the major radius computed with
89 //! Center and S1 is less than the minor radius
90 //! computed with Center, S1 and S2.
91 Standard_EXPORT gce_MakeElips2d(const gp_Pnt2d& S1, const gp_Pnt2d& S2, const gp_Pnt2d& Center);
92
93 //! Returns the constructed ellipse.
94 //! Exceptions StdFail_NotDone if no ellipse is constructed.
95 Standard_EXPORT const gp_Elips2d& Value() const;
96
97 Standard_EXPORT const gp_Elips2d& Operator() const;
98Standard_EXPORT operator gp_Elips2d() const;
99
100
101
102
103protected:
104
105
106
107
108
109private:
110
111
112
113 gp_Elips2d TheElips2d;
114
115
116};
117
118
119
120
121
122
123
124#endif // _gce_MakeElips2d_HeaderFile