Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-25 08:29:32

0001 // Created on: 1993-03-10
0002 // Created by: JCV
0003 // Copyright (c) 1993-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _Geom_Conic_HeaderFile
0018 #define _Geom_Conic_HeaderFile
0019 
0020 #include <gp_Ax2.hxx>
0021 #include <Geom_Curve.hxx>
0022 
0023 class Geom_Conic;
0024 DEFINE_STANDARD_HANDLE(Geom_Conic, Geom_Curve)
0025 
0026 //! The abstract class Conic describes the common
0027 //! behavior of conic curves in 3D space and, in
0028 //! particular, their general characteristics. The Geom
0029 //! package provides four concrete classes of conics:
0030 //! Geom_Circle, Geom_Ellipse, Geom_Hyperbola and Geom_Parabola.
0031 //! A conic is positioned in space with a right-handed
0032 //! coordinate system (gp_Ax2 object), where:
0033 //! - the origin is the center of the conic (or the apex in
0034 //! the case of a parabola),
0035 //! - the origin, "X Direction" and "Y Direction" define the
0036 //! plane of the conic.
0037 //! This coordinate system is the local coordinate
0038 //! system of the conic.
0039 //! The "main Direction" of this coordinate system is the
0040 //! vector normal to the plane of the conic. The axis, of
0041 //! which the origin and unit vector are respectively the
0042 //! origin and "main Direction" of the local coordinate
0043 //! system, is termed the "Axis" or "main Axis" of the conic.
0044 //! The "main Direction" of the local coordinate system
0045 //! gives an explicit orientation to the conic, determining
0046 //! the direction in which the parameter increases along
0047 //! the conic. The "X Axis" of the local coordinate system
0048 //! also defines the origin of the parameter of the conic.
0049 class Geom_Conic : public Geom_Curve
0050 {
0051 public:
0052   //! Changes the orientation of the conic's plane. The normal
0053   //! axis to the plane is A1. The XAxis and the YAxis are recomputed.
0054   //!
0055   //! raised if the A1 is parallel to the XAxis of the conic.
0056   void SetAxis(const gp_Ax1& theA1) { pos.SetAxis(theA1); }
0057 
0058   //! changes the location point of the conic.
0059   void SetLocation(const gp_Pnt& theP) { pos.SetLocation(theP); }
0060 
0061   //! changes the local coordinate system of the conic.
0062   void SetPosition(const gp_Ax2& theA2) { pos = theA2; }
0063 
0064   //! Returns the "main Axis" of this conic. This axis is
0065   //! normal to the plane of the conic.
0066   const gp_Ax1& Axis() const { return pos.Axis(); }
0067 
0068   //! Returns the location point of the conic.
0069   //! For the circle, the ellipse and the hyperbola it is the center of
0070   //! the conic. For the parabola it is the Apex of the parabola.
0071   const gp_Pnt& Location() const { return pos.Location(); }
0072 
0073   //! Returns the local coordinates system of the conic.
0074   //! The main direction of the Axis2Placement is normal to the
0075   //! plane of the conic. The X direction of the Axis2placement
0076   //! is in the plane of the conic and corresponds to the origin
0077   //! for the conic's parametric value u.
0078   const gp_Ax2& Position() const { return pos; }
0079 
0080   //! Returns the eccentricity value of the conic e.
0081   //! e = 0 for a circle
0082   //! 0 < e < 1 for an ellipse  (e = 0 if MajorRadius = MinorRadius)
0083   //! e > 1 for a hyperbola
0084   //! e = 1 for a parabola
0085   //! Exceptions
0086   //! Standard_DomainError in the case of a hyperbola if
0087   //! its major radius is null.
0088   virtual Standard_Real Eccentricity() const = 0;
0089 
0090   //! Returns the XAxis of the conic.
0091   //! This axis defines the origin of parametrization of the conic.
0092   //! This axis is perpendicular to the Axis of the conic.
0093   //! This axis and the Yaxis define the plane of the conic.
0094   Standard_EXPORT gp_Ax1 XAxis() const;
0095 
0096   //! Returns the YAxis of the conic.
0097   //! The YAxis is perpendicular to the Xaxis.
0098   //! This axis and the Xaxis define the plane of the conic.
0099   Standard_EXPORT gp_Ax1 YAxis() const;
0100 
0101   //! Reverses the direction of parameterization of <me>.
0102   //! The local coordinate system of the conic is modified.
0103   Standard_EXPORT void Reverse() Standard_OVERRIDE;
0104 
0105   //! Returns the  parameter on the  reversed  curve for
0106   //! the point of parameter U on <me>.
0107   Standard_EXPORT virtual Standard_Real ReversedParameter(const Standard_Real U) const
0108     Standard_OVERRIDE = 0;
0109 
0110   //! The continuity of the conic is Cn.
0111   Standard_EXPORT GeomAbs_Shape Continuity() const Standard_OVERRIDE;
0112 
0113   //! Returns True.
0114   //! Raised if N < 0.
0115   Standard_EXPORT Standard_Boolean IsCN(const Standard_Integer N) const Standard_OVERRIDE;
0116 
0117   //! Dumps the content of me into the stream
0118   Standard_EXPORT virtual void DumpJson(Standard_OStream& theOStream,
0119                                         Standard_Integer  theDepth = -1) const Standard_OVERRIDE;
0120 
0121   DEFINE_STANDARD_RTTIEXT(Geom_Conic, Geom_Curve)
0122 
0123 protected:
0124   gp_Ax2 pos;
0125 };
0126 
0127 #endif // _Geom_Conic_HeaderFile