Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-26 09:03:45

0001 // Created on: 1992-06-30
0002 // Created by: Laurent BUCHARD
0003 // Copyright (c) 1992-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 _IntAna_Curve_HeaderFile
0018 #define _IntAna_Curve_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <GeomAbs_SurfaceType.hxx>
0024 #include <gp_Ax3.hxx>
0025 #include <NCollection_List.hxx>
0026 
0027 class gp_Cone;
0028 class gp_Cylinder;
0029 
0030 //! Definition of a parametric Curve which is the result
0031 //! of the intersection between two quadrics.
0032 class IntAna_Curve
0033 {
0034 public:
0035   DEFINE_STANDARD_ALLOC
0036 
0037   //! Empty Constructor
0038   Standard_EXPORT IntAna_Curve();
0039 
0040   //! Sets the parameters used to compute Points and Derivative
0041   //! on the curve.
0042   Standard_EXPORT void SetCylinderQuadValues(const gp_Cylinder& Cylinder,
0043                                              const double       Qxx,
0044                                              const double       Qyy,
0045                                              const double       Qzz,
0046                                              const double       Qxy,
0047                                              const double       Qxz,
0048                                              const double       Qyz,
0049                                              const double       Qx,
0050                                              const double       Qy,
0051                                              const double       Qz,
0052                                              const double       Q1,
0053                                              const double       Tol,
0054                                              const double       DomInf,
0055                                              const double       DomSup,
0056                                              const bool         TwoZForATheta,
0057                                              const bool         ZIsPositive);
0058 
0059   //! Sets the parameters used to compute Points and
0060   //! Derivative on the curve.
0061   Standard_EXPORT void SetConeQuadValues(const gp_Cone& Cone,
0062                                          const double   Qxx,
0063                                          const double   Qyy,
0064                                          const double   Qzz,
0065                                          const double   Qxy,
0066                                          const double   Qxz,
0067                                          const double   Qyz,
0068                                          const double   Qx,
0069                                          const double   Qy,
0070                                          const double   Qz,
0071                                          const double   Q1,
0072                                          const double   Tol,
0073                                          const double   DomInf,
0074                                          const double   DomSup,
0075                                          const bool     TwoZForATheta,
0076                                          const bool     ZIsPositive);
0077 
0078   //! Returns TRUE if the curve is not infinite at the
0079   //! last parameter or at the first parameter of the domain.
0080   Standard_EXPORT bool IsOpen() const;
0081 
0082   //! Returns the parametric domain of the curve.
0083   Standard_EXPORT void Domain(double& theFirst, double& theLast) const;
0084 
0085   //! Returns TRUE if the function is constant.
0086   Standard_EXPORT bool IsConstant() const;
0087 
0088   //! Returns TRUE if the domain is open at the beginning.
0089   Standard_EXPORT bool IsFirstOpen() const;
0090 
0091   //! Returns TRUE if the domain is open at the end.
0092   Standard_EXPORT bool IsLastOpen() const;
0093 
0094   //! Returns the point at parameter Theta on the curve.
0095   Standard_EXPORT gp_Pnt Value(const double Theta);
0096 
0097   //! Returns the point and the first derivative at parameter
0098   //! Theta on the curve.
0099   Standard_EXPORT bool D1u(const double Theta, gp_Pnt& P, gp_Vec& V);
0100 
0101   //! Tries to find the parameter of the point P on the curve.
0102   //! If the method returns False, the "projection" is
0103   //! impossible.
0104   //! If the method returns True at least one parameter has been found.
0105   //! theParams is always sorted in ascending order.
0106   Standard_EXPORT void FindParameter(const gp_Pnt& P, NCollection_List<double>& theParams) const;
0107 
0108   //! If flag is True, the Curve is not defined at the
0109   //! first parameter of its domain.
0110   Standard_EXPORT void SetIsFirstOpen(const bool Flag);
0111 
0112   //! If flag is True, the Curve is not defined at the
0113   //! first parameter of its domain.
0114   Standard_EXPORT void SetIsLastOpen(const bool Flag);
0115 
0116   //! Trims this curve
0117   Standard_EXPORT void SetDomain(const double theFirst, const double theLast);
0118 
0119 protected:
0120   //! Protected function.
0121   Standard_EXPORT gp_Pnt InternalValue(const double Theta1, const double Theta2) const;
0122 
0123   //! Protected function.
0124   Standard_EXPORT void InternalUVValue(const double Param,
0125                                        double&      U,
0126                                        double&      V,
0127                                        double&      A,
0128                                        double&      B,
0129                                        double&      C,
0130                                        double&      Co,
0131                                        double&      Si,
0132                                        double&      Di) const;
0133 
0134 private:
0135   double Z0Cte;
0136   double Z0Sin;
0137   double Z0Cos;
0138   double Z0SinSin;
0139   double Z0CosCos;
0140   double Z0CosSin;
0141   double Z1Cte;
0142   double Z1Sin;
0143   double Z1Cos;
0144   double Z1SinSin;
0145   double Z1CosCos;
0146   double Z1CosSin;
0147   double Z2Cte;
0148   double Z2Sin;
0149   double Z2Cos;
0150   double Z2SinSin;
0151   double Z2CosCos;
0152   double Z2CosSin;
0153   bool   TwoCurves;
0154   bool   TakeZPositive;
0155   double Tolerance;
0156 
0157   //! Internal fields defining the default domain
0158   double              DomainInf, DomainSup;
0159   bool                RestrictedInf;
0160   bool                RestrictedSup;
0161   bool                firstbounded;
0162   bool                lastbounded;
0163   GeomAbs_SurfaceType typequadric;
0164   double              RCyl;
0165   double              Angle;
0166   gp_Ax3              Ax3;
0167 
0168   //! Trim boundaries
0169   double myFirstParameter, myLastParameter;
0170 };
0171 
0172 #endif // _IntAna_Curve_HeaderFile