0022048: Visualization, AIS_InteractiveContext - single object selection should alway...
[occt.git] / src / Geom2d / Geom2d_Conic.hxx
CommitLineData
42cf5bc1 1// Created on: 1993-03-24
2// Created by: JCV
3// Copyright (c) 1993-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 _Geom2d_Conic_HeaderFile
18#define _Geom2d_Conic_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_Type.hxx>
22
23#include <gp_Ax22d.hxx>
24#include <Geom2d_Curve.hxx>
25#include <Standard_Real.hxx>
26#include <GeomAbs_Shape.hxx>
27#include <Standard_Boolean.hxx>
28#include <Standard_Integer.hxx>
29class Standard_ConstructionError;
30class Standard_DomainError;
31class gp_Ax22d;
32class gp_Ax2d;
33class gp_Pnt2d;
34
35
36class Geom2d_Conic;
37DEFINE_STANDARD_HANDLE(Geom2d_Conic, Geom2d_Curve)
38
39//! The abstract class Conic describes the common
40//! behavior of conic curves in 2D space and, in
41//! particular, their general characteristics. The Geom2d
42//! package provides four specific classes of conics:
43//! Geom2d_Circle, Geom2d_Ellipse,
44//! Geom2d_Hyperbola and Geom2d_Parabola.
45//! A conic is positioned in the plane with a coordinate
46//! system (gp_Ax22d object), where the origin is the
47//! center of the conic (or the apex in case of a parabola).
48//! This coordinate system is the local coordinate
49//! system of the conic. It gives the conic an explicit
50//! orientation, determining the direction in which the
51//! parameter increases along the conic. The "X Axis" of
52//! the local coordinate system also defines the origin of
53//! the parameter of the conic.
54class Geom2d_Conic : public Geom2d_Curve
55{
56
57public:
58
59
60 //! Modifies this conic, redefining its local coordinate system
61 //! partially, by assigning P as its origin
62 Standard_EXPORT void SetAxis (const gp_Ax22d& A);
63
64 Standard_EXPORT void SetXAxis (const gp_Ax2d& A);
65
66 //! Assigns the origin and unit vector of axis A to the
67 //! origin of the local coordinate system of this conic and either:
68 //! - its "X Direction", or
69 //! - its "Y Direction".
70 //! The other unit vector of the local coordinate system
71 //! of this conic is recomputed normal to A, without
72 //! changing the orientation of the local coordinate
73 //! system (right-handed or left-handed).
74 Standard_EXPORT void SetYAxis (const gp_Ax2d& A);
75
76 //! Modifies this conic, redefining its local coordinate
77 //! system fully, by assigning A as this coordinate system.
78 Standard_EXPORT void SetLocation (const gp_Pnt2d& P);
79
80
81 //! Returns the "XAxis" of the conic.
82 //! This axis defines the origin of parametrization of the conic.
83 //! This axis and the "Yaxis" define the local coordinate system
84 //! of the conic.
85 //! -C++: return const&
86 Standard_EXPORT gp_Ax2d XAxis() const;
87
88
89 //! Returns the "YAxis" of the conic.
90 //! The "YAxis" is perpendicular to the "Xaxis".
91 Standard_EXPORT gp_Ax2d YAxis() const;
92
93
94 //! returns the eccentricity value of the conic e.
95 //! e = 0 for a circle
96 //! 0 < e < 1 for an ellipse (e = 0 if MajorRadius = MinorRadius)
97 //! e > 1 for a hyperbola
98 //! e = 1 for a parabola
99 Standard_EXPORT virtual Standard_Real Eccentricity() const = 0;
100
101
102 //! Returns the location point of the conic.
103 //! For the circle, the ellipse and the hyperbola it is the center of
104 //! the conic. For the parabola it is the vertex of the parabola.
105 Standard_EXPORT gp_Pnt2d Location() const;
106
107
108 //! Returns the local coordinates system of the conic.
109 Standard_EXPORT const gp_Ax22d& Position() const;
110
111
112 //! Reverses the direction of parameterization of <me>.
113 //! The local coordinate system of the conic is modified.
79104795 114 Standard_EXPORT void Reverse() Standard_OVERRIDE;
42cf5bc1 115
116 //! Returns the parameter on the reversed curve for
117 //! the point of parameter U on <me>.
79104795 118 Standard_EXPORT virtual Standard_Real ReversedParameter (const Standard_Real U) const Standard_OVERRIDE = 0;
42cf5bc1 119
120 //! Returns GeomAbs_CN which is the global continuity of any conic.
79104795 121 Standard_EXPORT GeomAbs_Shape Continuity() const Standard_OVERRIDE;
42cf5bc1 122
123
124 //! Returns True, the order of continuity of a conic is infinite.
79104795 125 Standard_EXPORT Standard_Boolean IsCN (const Standard_Integer N) const Standard_OVERRIDE;
42cf5bc1 126
127
128
129
92efcf78 130 DEFINE_STANDARD_RTTIEXT(Geom2d_Conic,Geom2d_Curve)
42cf5bc1 131
132protected:
133
134
135 gp_Ax22d pos;
136
137
138private:
139
140
141
142
143};
144
145
146
147
148
149
150
151#endif // _Geom2d_Conic_HeaderFile