Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1991-02-21
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_ExtPElC_HeaderFile
0018 #define _Extrema_ExtPElC_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <Standard_Integer.hxx>
0024 #include <Extrema_POnCurv.hxx>
0025 class gp_Pnt;
0026 class gp_Lin;
0027 class gp_Circ;
0028 class gp_Elips;
0029 class gp_Hypr;
0030 class gp_Parab;
0031 
0032 
0033 //! It calculates all the distances between a point
0034 //! and an elementary curve.
0035 //! These distances can be minimum or maximum.
0036 class Extrema_ExtPElC 
0037 {
0038 public:
0039 
0040   DEFINE_STANDARD_ALLOC
0041 
0042   
0043   Standard_EXPORT Extrema_ExtPElC();
0044   
0045   //! Calculates the extremum distance between the
0046   //! point P and the segment [Uinf,Usup] of the line C.
0047   Standard_EXPORT Extrema_ExtPElC(const gp_Pnt& P, const gp_Lin& C, const Standard_Real Tol, const Standard_Real Uinf, const Standard_Real Usup);
0048   
0049   Standard_EXPORT void Perform (const gp_Pnt& P, const gp_Lin& C, const Standard_Real Tol, const Standard_Real Uinf, const Standard_Real Usup);
0050   
0051   //! Calculates the 2 extremum distances between the
0052   //! point P and the segment [Uinf,Usup] of the circle C.
0053   //! Tol is used to determine
0054   //! if P is on the axis of the circle or
0055   //! if an extremum is on an endpoint of the segment.
0056   //! If P is on the axis of the circle,
0057   //! there are infinite solution then IsDone(me)=False.
0058   //! The conditions on the Uinf and Usup are:
0059   //! 0. <= Uinf <= 2.*PI and Usup > Uinf.
0060   //! If Usup > Uinf + 2.*PI, then only the solutions in
0061   //! the range [Uinf,Uinf+2.*PI[ are computed.
0062   Standard_EXPORT Extrema_ExtPElC(const gp_Pnt& P, const gp_Circ& C, const Standard_Real Tol, const Standard_Real Uinf, const Standard_Real Usup);
0063   
0064   Standard_EXPORT void Perform (const gp_Pnt& P, const gp_Circ& C, const Standard_Real Tol, const Standard_Real Uinf, const Standard_Real Usup);
0065   
0066   //! Calculates the 4 extremum distances between the
0067   //! point P and the segment [Uinf,Usup] of the ellipse C.
0068   //! Tol is used to determine
0069   //! if the point is on the axis of the ellipse and
0070   //! if the major radius is equal to the minor radius or
0071   //! if an extremum is on an endpoint of the segment.
0072   //! If P is on the axis of the ellipse,
0073   //! there are infinite solution then IsDone(me)=False.
0074   //! The conditions on the Uinf and Usup are:
0075   //! 0. <= Uinf <= 2.*PI and Usup > Uinf.
0076   //! If Usup > Uinf + 2.*PI, then only the solutions in
0077   //! the range [Uinf,Uinf+2.*PI[ are computed.
0078   Standard_EXPORT Extrema_ExtPElC(const gp_Pnt& P, const gp_Elips& C, const Standard_Real Tol, const Standard_Real Uinf, const Standard_Real Usup);
0079   
0080   Standard_EXPORT void Perform (const gp_Pnt& P, const gp_Elips& C, const Standard_Real Tol, const Standard_Real Uinf, const Standard_Real Usup);
0081   
0082   //! Calculates the extremum distances between the
0083   //! point P and the segment [Uinf,Usup] of the hyperbola
0084   //! C.
0085   //! Tol is used to determine if two solutions u and v
0086   //! are identical; the condition is:
0087   //! dist(C(u),C(v)) < Tol.
0088   Standard_EXPORT Extrema_ExtPElC(const gp_Pnt& P, const gp_Hypr& C, const Standard_Real Tol, const Standard_Real Uinf, const Standard_Real Usup);
0089   
0090   Standard_EXPORT void Perform (const gp_Pnt& P, const gp_Hypr& C, const Standard_Real Tol, const Standard_Real Uinf, const Standard_Real Usup);
0091   
0092   //! Calculates the 4 extremum distances between the
0093   //! point P and the segment [Uinf,Usup] of the parabola
0094   //! C.
0095   //! Tol is used to determine if two solutions u and v
0096   //! are identical; the condition is:
0097   //! dist(C(u),C(v)) < Tol.
0098   Standard_EXPORT Extrema_ExtPElC(const gp_Pnt& P, const gp_Parab& C, const Standard_Real Tol, const Standard_Real Uinf, const Standard_Real Usup);
0099   
0100   Standard_EXPORT void Perform (const gp_Pnt& P, const gp_Parab& C, const Standard_Real Tol, const Standard_Real Uinf, const Standard_Real Usup);
0101   
0102   //! True if the distances are found.
0103   Standard_EXPORT Standard_Boolean IsDone() const;
0104   
0105   //! Returns the number of extremum distances.
0106   Standard_EXPORT Standard_Integer NbExt() const;
0107   
0108   //! Returns the value of the Nth extremum square distance.
0109   Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const;
0110   
0111   //! Returns True if the Nth extremum distance is a
0112   //! minimum.
0113   Standard_EXPORT Standard_Boolean IsMin (const Standard_Integer N) const;
0114   
0115   //! Returns the point of the Nth extremum distance.
0116   Standard_EXPORT const Extrema_POnCurv& Point (const Standard_Integer N) const;
0117 
0118 
0119 
0120 
0121 protected:
0122 
0123 
0124 
0125 
0126 
0127 private:
0128 
0129 
0130 
0131   Standard_Boolean myDone;
0132   Standard_Integer myNbExt;
0133   Standard_Real mySqDist[4];
0134   Standard_Boolean myIsMin[4];
0135   Extrema_POnCurv myPoint[4];
0136 
0137 
0138 };
0139 
0140 
0141 
0142 
0143 
0144 
0145 
0146 #endif // _Extrema_ExtPElC_HeaderFile