Back to home page

EIC code displayed by LXR

 
 

    


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

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   
0053   //! Changes the orientation of the conic's plane. The normal
0054   //! axis to the plane is A1. The XAxis and the YAxis are recomputed.
0055   //!
0056   //! raised if the A1 is parallel to the XAxis of the conic.
0057   void SetAxis (const gp_Ax1& theA1) { pos.SetAxis(theA1); }
0058   
0059   //! changes the location point of the conic.
0060   void SetLocation (const gp_Pnt& theP) { pos.SetLocation(theP); }
0061   
0062   //! changes the local coordinate system of the conic.
0063   void SetPosition (const gp_Ax2& theA2) { pos = theA2; }
0064   
0065   //! Returns the "main Axis" of this conic. This axis is
0066   //! normal to the plane of the conic.
0067   const gp_Ax1& Axis() const { return pos.Axis(); }  
0068 
0069   //! Returns the location point of the conic.
0070   //! For the circle, the ellipse and the hyperbola it is the center of
0071   //! the conic. For the parabola it is the Apex of the parabola.
0072   const gp_Pnt& Location() const { return pos.Location(); }
0073   
0074   //! Returns the local coordinates system of the conic.
0075   //! The main direction of the Axis2Placement is normal to the
0076   //! plane of the conic. The X direction of the Axis2placement
0077   //! is in the plane of the conic and corresponds to the origin
0078   //! for the conic's parametric value u.
0079   const gp_Ax2& Position() const { return pos; }
0080   
0081   //! Returns the eccentricity value of the conic e.
0082   //! e = 0 for a circle
0083   //! 0 < e < 1 for an ellipse  (e = 0 if MajorRadius = MinorRadius)
0084   //! e > 1 for a hyperbola
0085   //! e = 1 for a parabola
0086   //! Exceptions
0087   //! Standard_DomainError in the case of a hyperbola if
0088   //! its major radius is null.
0089   virtual Standard_Real Eccentricity() const = 0;
0090 
0091   //! Returns the XAxis of the conic.
0092   //! This axis defines the origin of parametrization of the conic.
0093   //! This axis is perpendicular to the Axis of the conic.
0094   //! This axis and the Yaxis define the plane of the conic.
0095   Standard_EXPORT gp_Ax1 XAxis() const;
0096   
0097 
0098   //! Returns the YAxis of the conic.
0099   //! The YAxis is perpendicular to the Xaxis.
0100   //! This axis and the Xaxis define the plane of the conic.
0101   Standard_EXPORT gp_Ax1 YAxis() const;
0102   
0103 
0104   //! Reverses the direction of parameterization of <me>.
0105   //! The local coordinate system of the conic is modified.
0106   Standard_EXPORT void Reverse() Standard_OVERRIDE;
0107   
0108   //! Returns the  parameter on the  reversed  curve for
0109   //! the point of parameter U on <me>.
0110   Standard_EXPORT virtual Standard_Real ReversedParameter (const Standard_Real U) const Standard_OVERRIDE = 0;
0111   
0112   //! The continuity of the conic is Cn.
0113   Standard_EXPORT GeomAbs_Shape Continuity() const Standard_OVERRIDE;
0114   
0115   //! Returns True.
0116   //! Raised if N < 0.
0117   Standard_EXPORT Standard_Boolean IsCN (const Standard_Integer N) const Standard_OVERRIDE;
0118 
0119   //! Dumps the content of me into the stream
0120   Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
0121 
0122   DEFINE_STANDARD_RTTIEXT(Geom_Conic,Geom_Curve)
0123 
0124 protected:
0125   gp_Ax2 pos;
0126 };
0127 
0128 #endif // _Geom_Conic_HeaderFile