Back to home page

EIC code displayed by LXR

 
 

    


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

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