Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:33

0001 // Created on: 1993-03-24
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 _Geom2d_Conic_HeaderFile
0018 #define _Geom2d_Conic_HeaderFile
0019 
0020 #include <gp_Ax22d.hxx>
0021 #include <Geom2d_Curve.hxx>
0022 
0023 class Geom2d_Conic;
0024 DEFINE_STANDARD_HANDLE(Geom2d_Conic, Geom2d_Curve)
0025 
0026 //! The abstract class Conic describes the common
0027 //! behavior of conic curves in 2D space and, in
0028 //! particular, their general characteristics. The Geom2d
0029 //! package provides four specific classes of conics:
0030 //! Geom2d_Circle, Geom2d_Ellipse,
0031 //! Geom2d_Hyperbola and Geom2d_Parabola.
0032 //! A conic is positioned in the plane with a coordinate
0033 //! system (gp_Ax22d object), where the origin is the
0034 //! center of the conic (or the apex in case of a parabola).
0035 //! This coordinate system is the local coordinate
0036 //! system of the conic. It gives the conic an explicit
0037 //! orientation, determining the direction in which the
0038 //! parameter increases along the conic. The "X Axis" of
0039 //! the local coordinate system also defines the origin of
0040 //! the parameter of the conic.
0041 class Geom2d_Conic : public Geom2d_Curve
0042 {
0043 public:
0044 
0045   //! Modifies this conic, redefining its local coordinate system
0046   //! partially, by assigning theA as its axis
0047   void SetAxis (const gp_Ax22d& theA) { pos.SetAxis(theA); }
0048   
0049   //! Assigns the origin and unit vector of axis theA to the
0050   //! origin of the local coordinate system of this conic and X Direction.
0051   //! The other unit vector of the local coordinate system
0052   //! of this conic is recomputed normal to theA, without
0053   //! changing the orientation of the local coordinate
0054   //! system (right-handed or left-handed).
0055   void SetXAxis (const gp_Ax2d& theAX) { pos.SetXAxis(theAX); }
0056   
0057   //! Assigns the origin and unit vector of axis theA to the
0058   //! origin of the local coordinate system of this conic and Y Direction.
0059   //! The other unit vector of the local coordinate system
0060   //! of this conic is recomputed normal to theA, without
0061   //! changing the orientation of the local coordinate
0062   //! system (right-handed or left-handed).
0063   void SetYAxis (const gp_Ax2d& theAY) { pos.SetYAxis(theAY); }
0064   
0065   //! Modifies this conic, redefining its local coordinate
0066   //! system partially, by assigning theP as its origin.
0067   void SetLocation (const gp_Pnt2d& theP) { pos.SetLocation(theP); }
0068 
0069   //! Returns the "XAxis" of the conic.
0070   //! This axis defines the origin of parametrization of the conic.
0071   //! This axis and the "Yaxis" define the local coordinate system
0072   //! of the conic.
0073   //! -C++: return const&
0074   Standard_EXPORT gp_Ax2d XAxis() const;
0075   
0076 
0077   //! Returns the "YAxis" of the conic.
0078   //! The "YAxis" is perpendicular to the "Xaxis".
0079   Standard_EXPORT gp_Ax2d YAxis() const;
0080   
0081 
0082   //! returns the eccentricity value of the conic e.
0083   //! e = 0 for a circle
0084   //! 0 < e < 1 for an ellipse  (e = 0 if MajorRadius = MinorRadius)
0085   //! e > 1 for a hyperbola
0086   //! e = 1 for a parabola
0087   Standard_EXPORT virtual Standard_Real Eccentricity() const = 0;
0088   
0089 
0090   //! Returns the location point of the conic.
0091   //! For the circle, the ellipse and the hyperbola it is the center of
0092   //! the conic. For the parabola it is the vertex of the parabola.
0093   const gp_Pnt2d& Location() const { return pos.Location(); }
0094   
0095   //! Returns the local coordinates system of the conic.
0096   const gp_Ax22d& Position() const { return pos; }
0097 
0098   //! Reverses the direction of parameterization of <me>.
0099   //! The local coordinate system of the conic is modified.
0100   Standard_EXPORT void Reverse() Standard_OVERRIDE;
0101   
0102   //! Returns the  parameter on the  reversed  curve for
0103   //! the point of parameter U on <me>.
0104   Standard_EXPORT virtual Standard_Real ReversedParameter (const Standard_Real U) const Standard_OVERRIDE = 0;
0105   
0106   //! Returns GeomAbs_CN which is the global continuity of any conic.
0107   Standard_EXPORT GeomAbs_Shape Continuity() const Standard_OVERRIDE;
0108   
0109   //! Returns True, the order of continuity of a conic is infinite.
0110   Standard_EXPORT Standard_Boolean IsCN (const Standard_Integer N) const Standard_OVERRIDE;
0111 
0112   //! Dumps the content of me into the stream
0113   Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
0114 
0115   DEFINE_STANDARD_RTTIEXT(Geom2d_Conic,Geom2d_Curve)
0116 
0117 protected:
0118   gp_Ax22d pos;
0119 };
0120 
0121 #endif // _Geom2d_Conic_HeaderFile