1 // Created on: 1992-06-30
2 // Created by: Laurent BUCHARD
3 // Copyright (c) 1992-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _IntAna_Curve_HeaderFile
18 #define _IntAna_Curve_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <GeomAbs_SurfaceType.hxx>
26 #include <TColStd_ListOfReal.hxx>
28 //! Definition of a parametric Curve which is the result
29 //! of the intersection between two quadrics.
38 Standard_EXPORT IntAna_Curve();
40 //! Sets the parameters used to compute Points and Derivative
42 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);
44 //! Sets the parameters used to compute Points and
45 //! Derivative on the curve.
46 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);
48 //! Returns TRUE if the curve is not infinite at the
49 //! last parameter or at the first parameter of the domain.
50 Standard_EXPORT Standard_Boolean IsOpen() const;
52 //! Returns the paramatric domain of the curve.
53 Standard_EXPORT void Domain(Standard_Real& theFirst, Standard_Real& theLast) const;
55 //! Returns TRUE if the function is constant.
56 Standard_EXPORT Standard_Boolean IsConstant() const;
58 //! Returns TRUE if the domain is open at the beginning.
59 Standard_EXPORT Standard_Boolean IsFirstOpen() const;
61 //! Returns TRUE if the domain is open at the end.
62 Standard_EXPORT Standard_Boolean IsLastOpen() const;
64 //! Returns the point at parameter Theta on the curve.
65 Standard_EXPORT gp_Pnt Value (const Standard_Real Theta);
67 //! Returns the point and the first derivative at parameter
68 //! Theta on the curve.
69 Standard_EXPORT Standard_Boolean D1u (const Standard_Real Theta, gp_Pnt& P, gp_Vec& V);
71 //! Tries to find the parameter of the point P on the curve.
72 //! If the method returns False, the "projection" is
74 //! If the method returns True at least one parameter has been found.
75 //! theParams is always sorted in ascending order.
76 Standard_EXPORT void FindParameter(const gp_Pnt& P,
77 TColStd_ListOfReal& theParams) const;
79 //! If flag is True, the Curve is not defined at the
80 //! first parameter of its domain.
81 Standard_EXPORT void SetIsFirstOpen (const Standard_Boolean Flag);
83 //! If flag is True, the Curve is not defined at the
84 //! first parameter of its domain.
85 Standard_EXPORT void SetIsLastOpen (const Standard_Boolean Flag);
88 Standard_EXPORT void SetDomain(const Standard_Real theFirst, const Standard_Real theLast);
96 //! Protected function.
97 Standard_EXPORT gp_Pnt InternalValue (const Standard_Real Theta1, const Standard_Real Theta2) const;
99 //! Protected function.
100 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;
111 Standard_Real Z0SinSin;
112 Standard_Real Z0CosCos;
113 Standard_Real Z0CosSin;
117 Standard_Real Z1SinSin;
118 Standard_Real Z1CosCos;
119 Standard_Real Z1CosSin;
123 Standard_Real Z2SinSin;
124 Standard_Real Z2CosCos;
125 Standard_Real Z2CosSin;
126 Standard_Boolean TwoCurves;
127 Standard_Boolean TakeZPositive;
128 Standard_Real Tolerance;
130 //! Internal fields defining the default domain
131 Standard_Real DomainInf, DomainSup;
132 Standard_Boolean RestrictedInf;
133 Standard_Boolean RestrictedSup;
134 Standard_Boolean firstbounded;
135 Standard_Boolean lastbounded;
136 GeomAbs_SurfaceType typequadric;
142 Standard_Real myFirstParameter, myLastParameter;
153 #endif // _IntAna_Curve_HeaderFile