Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1994-07-06
0002 // Created by: Laurent PAINNOT
0003 // Copyright (c) 1994-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_ExtCC2d_HeaderFile
0018 #define _Extrema_ExtCC2d_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <Extrema_SequenceOfPOnCurv2d.hxx>
0024 #include <TColStd_SequenceOfReal.hxx>
0025 #include <Standard_Integer.hxx>
0026 #include <gp_Pnt2d.hxx>
0027 
0028 class Adaptor2d_Curve2d;
0029 class Extrema_POnCurv2d;
0030 class Extrema_ExtElC2d;
0031 class Extrema_ECC2d;
0032 
0033 
0034 //! It calculates all the distance between two curves.
0035 //! These distances can be maximum or minimum.
0036 class Extrema_ExtCC2d 
0037 {
0038 public:
0039 
0040   DEFINE_STANDARD_ALLOC
0041 
0042   
0043   Standard_EXPORT Extrema_ExtCC2d();
0044   
0045   //! It calculates all the distances.
0046   Standard_EXPORT Extrema_ExtCC2d(const Adaptor2d_Curve2d& C1, const Adaptor2d_Curve2d& C2, const Standard_Real TolC1 = 1.0e-10, const Standard_Real TolC2 = 1.0e-10);
0047   
0048   //! It calculates all the distances.
0049   Standard_EXPORT Extrema_ExtCC2d(const Adaptor2d_Curve2d& C1, const Adaptor2d_Curve2d& C2, const Standard_Real U1, const Standard_Real U2, const Standard_Real V1, const Standard_Real V2, const Standard_Real TolC1 = 1.0e-10, const Standard_Real TolC2 = 1.0e-10);
0050   
0051   //! initializes the fields.
0052   Standard_EXPORT void Initialize (const Adaptor2d_Curve2d& C2, const Standard_Real V1, const Standard_Real V2, const Standard_Real TolC1 = 1.0e-10, const Standard_Real TolC2 = 1.0e-10);
0053   
0054   Standard_EXPORT void Perform (const Adaptor2d_Curve2d& C1, const Standard_Real U1, const Standard_Real U2);
0055   
0056   //! Returns True if the distances are found.
0057   Standard_EXPORT Standard_Boolean IsDone() const;
0058   
0059   //! Returns the number of extremum distances.
0060   Standard_EXPORT Standard_Integer NbExt() const;
0061   
0062   //! Returns True if the two curves are parallel.
0063   Standard_EXPORT Standard_Boolean IsParallel() const;
0064   
0065   //! Returns the value of the Nth extremum square distance.
0066   Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N = 1) const;
0067   
0068   //! Returns the points of the Nth extremum distance.
0069   //! P1 is on the first curve, P2 on the second one.
0070   Standard_EXPORT void Points (const Standard_Integer N, Extrema_POnCurv2d& P1, Extrema_POnCurv2d& P2) const;
0071   
0072   //! if the curve is a trimmed curve,
0073   //! dist11 is a square distance between the point on C1
0074   //! of parameter FirstParameter and the point of
0075   //! parameter FirstParameter on C2.
0076   Standard_EXPORT void TrimmedSquareDistances (Standard_Real& dist11, Standard_Real& distP12, Standard_Real& distP21, Standard_Real& distP22, gp_Pnt2d& P11, gp_Pnt2d& P12, gp_Pnt2d& P21, gp_Pnt2d& P22) const;
0077 
0078   //! Set flag for single extrema computation. Works on parametric solver only.
0079   Standard_EXPORT void SetSingleSolutionFlag (const Standard_Boolean theSingleSolutionFlag);
0080 
0081   //! Get flag for single extrema computation. Works on parametric solver only.
0082   Standard_EXPORT Standard_Boolean GetSingleSolutionFlag () const;
0083 
0084 
0085 protected:
0086 
0087   
0088   Standard_EXPORT void Results (const Extrema_ExtElC2d& AlgExt, const Standard_Real Ut11, const Standard_Real Ut12, const Standard_Real Ut21, const Standard_Real Ut22, const Standard_Real Period1 = 0.0, const Standard_Real Period2 = 0.0);
0089   
0090   Standard_EXPORT void Results (const Extrema_ECC2d& AlgExt, const Standard_Real Ut11, const Standard_Real Ut12, const Standard_Real Ut21, const Standard_Real Ut22, const Standard_Real Period1 = 0.0, const Standard_Real Period2 = 0.0);
0091 
0092 
0093 
0094 
0095 private:
0096 
0097 
0098   Standard_Boolean myIsFindSingleSolution; // Default value is false.
0099   Standard_Boolean myDone;
0100   Standard_Boolean myIsPar;
0101   Extrema_SequenceOfPOnCurv2d mypoints;
0102   TColStd_SequenceOfReal mySqDist;
0103   Standard_Integer mynbext;
0104   Standard_Boolean inverse;
0105   const Adaptor2d_Curve2d* myC;
0106   Standard_Real myv1;
0107   Standard_Real myv2;
0108   Standard_Real mytolc1;
0109   Standard_Real mytolc2;
0110   gp_Pnt2d P1f;
0111   gp_Pnt2d P1l;
0112   gp_Pnt2d P2f;
0113   gp_Pnt2d P2l;
0114   Standard_Real mydist11;
0115   Standard_Real mydist12;
0116   Standard_Real mydist21;
0117   Standard_Real mydist22;
0118 
0119 
0120 };
0121 
0122 
0123 
0124 
0125 
0126 
0127 
0128 #endif // _Extrema_ExtCC2d_HeaderFile