Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:01

0001 // Created on: 1993-01-09
0002 // Created by: CKY / Contract Toubro-Larsen (Kiran)
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 _IGESGeom_ConicArc_HeaderFile
0018 #define _IGESGeom_ConicArc_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <gp_XY.hxx>
0024 #include <IGESData_IGESEntity.hxx>
0025 #include <Standard_Integer.hxx>
0026 class gp_Pnt2d;
0027 class gp_Pnt;
0028 class gp_Dir;
0029 
0030 
0031 class IGESGeom_ConicArc;
0032 DEFINE_STANDARD_HANDLE(IGESGeom_ConicArc, IGESData_IGESEntity)
0033 
0034 //! defines IGESConicArc, Type <104> Form <0-3>  in package IGESGeom
0035 //! A conic arc is a bounded connected portion of a parent
0036 //! conic curve which consists of more than one point. The
0037 //! parent conic curve is either an ellipse, a parabola, or
0038 //! a hyperbola. The definition space coordinate system is
0039 //! always chosen so that the conic arc lies in a plane either
0040 //! coincident with or parallel to XT, YT plane. Within such
0041 //! a plane a conic is defined by the six coefficients in the
0042 //! following equation.
0043 //! A*XT^2 + B*XT*YT + C*YT^2 + D*XT + E*YT + F = 0
0044 class IGESGeom_ConicArc : public IGESData_IGESEntity
0045 {
0046 
0047 public:
0048 
0049   
0050   Standard_EXPORT IGESGeom_ConicArc();
0051   
0052   //! This method is used to set the fields of the class
0053   //! ConicalArc
0054   //! - A, B, C, D, E, F : Coefficients of the equation
0055   //! defining conic arc
0056   //! - ZT               : Parallel ZT displacement of the arc
0057   //! from XT, YT plane.
0058   //! - aStart           : Starting point of the conic arc
0059   //! - anEnd            : End point of the conic arc
0060   Standard_EXPORT void Init (const Standard_Real A, const Standard_Real B, const Standard_Real C, const Standard_Real D, const Standard_Real E, const Standard_Real F, const Standard_Real ZT, const gp_XY& aStart, const gp_XY& anEnd);
0061   
0062   //! sets the Form Number equal to ComputedFormNumber,
0063   //! returns True if changed
0064   Standard_EXPORT Standard_Boolean OwnCorrect();
0065   
0066   //! Computes the Form Number according to the equation
0067   //! 1 for Ellipse, 2 for Hyperbola, 3 for Parabola
0068   Standard_EXPORT Standard_Integer ComputedFormNumber() const;
0069   
0070   Standard_EXPORT void Equation (Standard_Real& A, Standard_Real& B, Standard_Real& C, Standard_Real& D, Standard_Real& E, Standard_Real& F) const;
0071   
0072   //! returns the Z displacement of the arc from XT, YT plane
0073   Standard_EXPORT Standard_Real ZPlane() const;
0074   
0075   //! returns the starting point of the arc
0076   Standard_EXPORT gp_Pnt2d StartPoint() const;
0077   
0078   //! returns the starting point of the arc after applying
0079   //! Transf. Matrix
0080   Standard_EXPORT gp_Pnt TransformedStartPoint() const;
0081   
0082   //! returns the end point of the arc
0083   Standard_EXPORT gp_Pnt2d EndPoint() const;
0084   
0085   //! returns the end point of the arc after applying
0086   //! Transf. Matrix
0087   Standard_EXPORT gp_Pnt TransformedEndPoint() const;
0088   
0089   //! returns True if parent conic curve is an ellipse
0090   Standard_EXPORT Standard_Boolean IsFromEllipse() const;
0091   
0092   //! returns True if parent conic curve is a parabola
0093   Standard_EXPORT Standard_Boolean IsFromParabola() const;
0094   
0095   //! returns True if parent conic curve is a hyperbola
0096   Standard_EXPORT Standard_Boolean IsFromHyperbola() const;
0097   
0098   //! returns True if StartPoint = EndPoint
0099   Standard_EXPORT Standard_Boolean IsClosed() const;
0100   
0101   //! Z-Axis of conic (i.e. [0,0,1])
0102   Standard_EXPORT gp_Dir Axis() const;
0103   
0104   //! Z-Axis after applying Trans. Matrix
0105   Standard_EXPORT gp_Dir TransformedAxis() const;
0106   
0107   //! Returns a Definition computed from equation, easier to use
0108   //! <Center> : the center of the conic (meaningless for
0109   //! a parabola) (defined with Z displacement)
0110   //! <MainAxis> : the Main Axis of the conic (for a Circle,
0111   //! arbitrary the X Axis)
0112   //! <Rmin,Rmax> : Minor and Major Radii of the conic
0113   //! For a Circle, Rmin = Rmax,
0114   //! For a Parabola, Rmin = Rmax = the Focal
0115   //! Warning : the basic definition (by equation) is not very stable,
0116   //! limit cases may be approximative
0117   Standard_EXPORT void Definition (gp_Pnt& Center, gp_Dir& MainAxis, Standard_Real& rmin, Standard_Real& rmax) const;
0118   
0119   //! Same as Definition, but the Location is applied on the
0120   //! Center and the MainAxis
0121   Standard_EXPORT void TransformedDefinition (gp_Pnt& Center, gp_Dir& MainAxis, Standard_Real& rmin, Standard_Real& rmax) const;
0122   
0123   //! Computes and returns the coordinates of the definition of
0124   //! a comic from its equation. Used by Definition &
0125   //! TransformedDefinition, or may be called directly if needed
0126   Standard_EXPORT void ComputedDefinition (Standard_Real& Xcen, Standard_Real& Ycen, Standard_Real& Xax, Standard_Real& Yax, Standard_Real& Rmin, Standard_Real& Rmax) const;
0127 
0128 
0129 
0130 
0131   DEFINE_STANDARD_RTTIEXT(IGESGeom_ConicArc,IGESData_IGESEntity)
0132 
0133 protected:
0134 
0135 
0136 
0137 
0138 private:
0139 
0140 
0141   Standard_Real theA;
0142   Standard_Real theB;
0143   Standard_Real theC;
0144   Standard_Real theD;
0145   Standard_Real theE;
0146   Standard_Real theF;
0147   Standard_Real theZT;
0148   gp_XY theStart;
0149   gp_XY theEnd;
0150 
0151 
0152 };
0153 
0154 
0155 
0156 
0157 
0158 
0159 
0160 #endif // _IGESGeom_ConicArc_HeaderFile