0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / src / GC / GC_MakeEllipse.hxx
CommitLineData
42cf5bc1 1// Created on: 1992-09-28
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 _GC_MakeEllipse_HeaderFile
18#define _GC_MakeEllipse_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_DefineAlloc.hxx>
22#include <Standard_Handle.hxx>
23
24#include <GC_Root.hxx>
d1a67b9d 25#include <Geom_Ellipse.hxx>
26
42cf5bc1 27class gp_Elips;
28class gp_Ax2;
29class gp_Pnt;
30
31
32//! This class implements construction algorithms for an ellipse in
33//! 3D space. The result is a Geom_Ellipse ellipse.
34//! A MakeEllipse object provides a framework for:
35//! - defining the construction of the ellipse,
36//! - implementing the construction algorithm, and
37//! - consulting the results. In particular, the Value
38//! function returns the constructed ellipse.
39class GC_MakeEllipse : public GC_Root
40{
41public:
42
43 DEFINE_STANDARD_ALLOC
44
45
46
47 //! Creates an ellipse from a non persistent ellipse E from package gp by its conversion.
48 Standard_EXPORT GC_MakeEllipse(const gp_Elips& E);
49
50 //! Constructs an ellipse with major and minor radii MajorRadius and
51 //! MinorRadius, and located in the plane defined by
52 //! the "X Axis" and "Y Axis" of the coordinate system A2, where:
53 //! - its center is the origin of A2, and
54 //! - its major axis is the "X Axis" of A2;
55 //! Warnings :
56 //! The MakeEllipse class does not prevent the
57 //! construction of an ellipse where MajorRadius is equal to MinorRadius.
58 //! If an error occurs (that is, when IsDone returns
59 //! false), the Status function returns:
60 //! - gce_InvertRadius if MajorRadius is less than MinorRadius;
61 //! - gce_NegativeRadius if MinorRadius is less than 0.0;
62 //! - gce_NullAxis if the points S1 and Center are coincident; or
63 //! - gce_InvertAxis if:
64 //! - the major radius computed with Center and S1
65 //! is less than the minor radius computed with Center, S1 and S2, or
66 //! - Center, S1 and S2 are collinear.
67 Standard_EXPORT GC_MakeEllipse(const gp_Ax2& A2, const Standard_Real MajorRadius, const Standard_Real MinorRadius);
68
69 //! Constructs an ellipse centered on the point Center, where
70 //! - the plane of the ellipse is defined by Center, S1 and S2,
71 //! - its major axis is defined by Center and S1,
72 //! - its major radius is the distance between Center and S1, and
73 //! - its minor radius is the distance between S2 and the major axis.
74 Standard_EXPORT GC_MakeEllipse(const gp_Pnt& S1, const gp_Pnt& S2, const gp_Pnt& Center);
75
76 //! Returns the constructed ellipse.
77 //! Exceptions StdFail_NotDone if no ellipse is constructed.
78 Standard_EXPORT const Handle(Geom_Ellipse)& Value() const;
42cf5bc1 79
d1a67b9d 80 operator const Handle(Geom_Ellipse)& () const { return Value(); }
42cf5bc1 81
82private:
42cf5bc1 83 Handle(Geom_Ellipse) TheEllipse;
42cf5bc1 84};
85
42cf5bc1 86#endif // _GC_MakeEllipse_HeaderFile