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