Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1991-02-26
0002 // Created by: Isabelle GRIGNON
0003 // Copyright (c) 1991-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 _Extrema_CCLocFOfLocECC2d_HeaderFile
0018 #define _Extrema_CCLocFOfLocECC2d_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <gp_Pnt2d.hxx>
0025 #include <gp_Vec2d.hxx>
0026 #include <TColStd_SequenceOfReal.hxx>
0027 #include <Extrema_SequenceOfPOnCurv2d.hxx>
0028 #include <math_FunctionSetWithDerivatives.hxx>
0029 #include <Standard_Boolean.hxx>
0030 #include <math_Vector.hxx>
0031 class Standard_OutOfRange;
0032 class Adaptor2d_Curve2d;
0033 class Extrema_Curve2dTool;
0034 class Extrema_POnCurv2d;
0035 class gp_Pnt2d;
0036 class gp_Vec2d;
0037 class math_Matrix;
0038 
0039 
0040 
0041 class Extrema_CCLocFOfLocECC2d  : public math_FunctionSetWithDerivatives
0042 {
0043 public:
0044 
0045   DEFINE_STANDARD_ALLOC
0046 
0047   
0048   Standard_EXPORT Extrema_CCLocFOfLocECC2d(const Standard_Real thetol = 1.0e-10);
0049   
0050   Standard_EXPORT Extrema_CCLocFOfLocECC2d(const Adaptor2d_Curve2d& C1, const Adaptor2d_Curve2d& C2, const Standard_Real thetol = 1.0e-10);
0051   
0052   Standard_EXPORT void SetCurve (const Standard_Integer theRank, const Adaptor2d_Curve2d& C1);
0053   
0054     void SetTolerance (const Standard_Real theTol);
0055   
0056     virtual Standard_Integer NbVariables() const Standard_OVERRIDE;
0057   
0058     virtual Standard_Integer NbEquations() const Standard_OVERRIDE;
0059   
0060   //! Calculate Fi(U,V).
0061   Standard_EXPORT virtual Standard_Boolean Value (const math_Vector& UV, math_Vector& F) Standard_OVERRIDE;
0062   
0063   //! Calculate Fi'(U,V).
0064   Standard_EXPORT Standard_Boolean Derivatives (const math_Vector& UV, math_Matrix& DF) Standard_OVERRIDE;
0065   
0066   //! Calculate Fi(U,V) and Fi'(U,V).
0067   Standard_EXPORT Standard_Boolean Values (const math_Vector& UV, math_Vector& F, math_Matrix& DF) Standard_OVERRIDE;
0068   
0069   //! Save the found extremum.
0070   Standard_EXPORT virtual Standard_Integer GetStateNumber() Standard_OVERRIDE;
0071   
0072   //! Return the number of found extrema.
0073     Standard_Integer NbExt() const;
0074   
0075   //! Return the value of the Nth distance.
0076     Standard_Real SquareDistance (const Standard_Integer N) const;
0077   
0078   //! Return the points of the Nth extreme distance.
0079   Standard_EXPORT void Points (const Standard_Integer N, Extrema_POnCurv2d& P1, Extrema_POnCurv2d& P2) const;
0080   
0081   //! Returns a pointer to the curve specified in the constructor
0082   //! or in SetCurve() method.
0083     Standard_Address CurvePtr (const Standard_Integer theRank) const;
0084   
0085   //! Returns a tolerance specified in the constructor
0086   //! or in SetTolerance() method.
0087     Standard_Real Tolerance() const;
0088   
0089   //! Determines of boundaries of subinterval for find of root.
0090   Standard_EXPORT void SubIntervalInitialize (const math_Vector& theUfirst, const math_Vector& theUlast);
0091   
0092   //! Computes a Tol value. If 1st derivative of curve
0093   //! |D1|<Tol, it is considered D1=0.
0094   Standard_EXPORT Standard_Real SearchOfTolerance (const Standard_Address C);
0095 
0096 
0097 
0098 
0099 protected:
0100 
0101 
0102 
0103 
0104 
0105 private:
0106 
0107 
0108 
0109   Standard_Address myC1;
0110   Standard_Address myC2;
0111   Standard_Real myTol;
0112   Standard_Real myU;
0113   Standard_Real myV;
0114   gp_Pnt2d myP1;
0115   gp_Pnt2d myP2;
0116   gp_Vec2d myDu;
0117   gp_Vec2d myDv;
0118   TColStd_SequenceOfReal mySqDist;
0119   Extrema_SequenceOfPOnCurv2d myPoints;
0120   Standard_Real myTolC1;
0121   Standard_Real myTolC2;
0122   Standard_Integer myMaxDerivOrderC1;
0123   Standard_Integer myMaxDerivOrderC2;
0124   Standard_Real myUinfium;
0125   Standard_Real myUsupremum;
0126   Standard_Real myVinfium;
0127   Standard_Real myVsupremum;
0128 
0129 
0130 };
0131 
0132 #define Curve1 Adaptor2d_Curve2d
0133 #define Curve1_hxx <Adaptor2d_Curve2d.hxx>
0134 #define Tool1 Extrema_Curve2dTool
0135 #define Tool1_hxx <Extrema_Curve2dTool.hxx>
0136 #define Curve2 Adaptor2d_Curve2d
0137 #define Curve2_hxx <Adaptor2d_Curve2d.hxx>
0138 #define Tool2 Extrema_Curve2dTool
0139 #define Tool2_hxx <Extrema_Curve2dTool.hxx>
0140 #define POnC Extrema_POnCurv2d
0141 #define POnC_hxx <Extrema_POnCurv2d.hxx>
0142 #define Pnt gp_Pnt2d
0143 #define Pnt_hxx <gp_Pnt2d.hxx>
0144 #define Vec gp_Vec2d
0145 #define Vec_hxx <gp_Vec2d.hxx>
0146 #define Extrema_SeqPOnC Extrema_SequenceOfPOnCurv2d
0147 #define Extrema_SeqPOnC_hxx <Extrema_SequenceOfPOnCurv2d.hxx>
0148 #define Extrema_FuncExtCC Extrema_CCLocFOfLocECC2d
0149 #define Extrema_FuncExtCC_hxx <Extrema_CCLocFOfLocECC2d.hxx>
0150 
0151 #include <Extrema_FuncExtCC.lxx>
0152 
0153 #undef Curve1
0154 #undef Curve1_hxx
0155 #undef Tool1
0156 #undef Tool1_hxx
0157 #undef Curve2
0158 #undef Curve2_hxx
0159 #undef Tool2
0160 #undef Tool2_hxx
0161 #undef POnC
0162 #undef POnC_hxx
0163 #undef Pnt
0164 #undef Pnt_hxx
0165 #undef Vec
0166 #undef Vec_hxx
0167 #undef Extrema_SeqPOnC
0168 #undef Extrema_SeqPOnC_hxx
0169 #undef Extrema_FuncExtCC
0170 #undef Extrema_FuncExtCC_hxx
0171 
0172 
0173 
0174 
0175 #endif // _Extrema_CCLocFOfLocECC2d_HeaderFile