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_ECC2d_HeaderFile
0018 #define _Extrema_ECC2d_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <math_Vector.hxx>
0024 #include <TColStd_SequenceOfReal.hxx>
0025 
0026 class Adaptor2d_Curve2d;
0027 class Extrema_Curve2dTool;
0028 class Extrema_POnCurv2d;
0029 class gp_Pnt2d;
0030 class gp_Vec2d;
0031 
0032 
0033 class Extrema_ECC2d 
0034 {
0035 public:
0036 
0037   DEFINE_STANDARD_ALLOC
0038 
0039   
0040   //! Calculates all the distances as above
0041   //! between Uinf and Usup for C1 and  between Vinf and Vsup
0042   //! for C2.
0043   Standard_EXPORT Extrema_ECC2d();
0044   
0045   //! It calculates all the distances.
0046   //! The function F(u,v)=distance(C1(u),C2(v)) has an
0047   //! extremum when gradient(f)=0. The algorithm uses
0048   //! Evtushenko's global optimization solver.
0049   Standard_EXPORT Extrema_ECC2d(const Adaptor2d_Curve2d& C1, const Adaptor2d_Curve2d& C2);
0050   
0051   //! Calculates all the distances as above
0052   //! between Uinf and Usup for C1 and  between Vinf and Vsup
0053   //! for C2.
0054   Standard_EXPORT Extrema_ECC2d(const Adaptor2d_Curve2d& C1, const Adaptor2d_Curve2d& C2, const Standard_Real Uinf, const Standard_Real Usup, const Standard_Real Vinf, const Standard_Real Vsup);
0055   
0056   //! Set params in case of empty constructor is usage.
0057   Standard_EXPORT void SetParams (const Adaptor2d_Curve2d& C1, const Adaptor2d_Curve2d& C2, const Standard_Real Uinf, const Standard_Real Usup, const Standard_Real Vinf, const Standard_Real Vsup);
0058   
0059   Standard_EXPORT void SetTolerance (const Standard_Real Tol);
0060 
0061   //! Set flag for single extrema computation. Works on parametric solver only.
0062   Standard_EXPORT void SetSingleSolutionFlag (const Standard_Boolean theSingleSolutionFlag);
0063 
0064   //! Get flag for single extrema computation. Works on parametric solver only.
0065   Standard_EXPORT Standard_Boolean GetSingleSolutionFlag () const;
0066 
0067   //! Performs calculations.
0068   Standard_EXPORT void Perform();
0069   
0070   //! Returns True if the distances are found.
0071   Standard_EXPORT Standard_Boolean IsDone() const;
0072   
0073   //! Returns state of myParallel flag.
0074   Standard_EXPORT Standard_Boolean IsParallel() const;
0075   
0076   //! Returns the number of extremum distances.
0077   Standard_EXPORT Standard_Integer NbExt() const;
0078   
0079   //! Returns the value of the Nth square extremum distance.
0080   Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N = 1) const;
0081   
0082   //! Returns the points of the Nth extremum distance.
0083   //! P1 is on the first curve, P2 on the second one.
0084   Standard_EXPORT void Points (const Standard_Integer N, Extrema_POnCurv2d& P1, Extrema_POnCurv2d& P2) const;
0085 
0086 
0087 
0088 
0089 protected:
0090 
0091 
0092 
0093 
0094 
0095 private:
0096 
0097 
0098   Standard_Boolean myIsFindSingleSolution; // Default value is false.
0099   Standard_Boolean myParallel;
0100   Standard_Real myCurveMinTol;
0101   math_Vector myLowBorder;
0102   math_Vector myUppBorder;
0103   TColStd_SequenceOfReal myPoints1;
0104   TColStd_SequenceOfReal myPoints2;
0105   Standard_Address myC[2];
0106   Standard_Boolean myDone;
0107 
0108 
0109 };
0110 
0111 
0112 
0113 
0114 
0115 
0116 
0117 #endif // _Extrema_ECC2d_HeaderFile