|
|
|||
File indexing completed on 2026-10-03 09:15:47
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 //! It calculates all the distances between a point 0033 //! and an elementary curve. 0034 //! These distances can be minimum or maximum. 0035 class Extrema_ExtPElC 0036 { 0037 public: 0038 DEFINE_STANDARD_ALLOC 0039 0040 Standard_EXPORT Extrema_ExtPElC(); 0041 0042 //! Calculates the extremum distance between the 0043 //! point P and the segment [Uinf,Usup] of the line C. 0044 Standard_EXPORT Extrema_ExtPElC(const gp_Pnt& P, 0045 const gp_Lin& C, 0046 const double Tol, 0047 const double Uinf, 0048 const double Usup); 0049 0050 Standard_EXPORT void Perform(const gp_Pnt& P, 0051 const gp_Lin& C, 0052 const double Tol, 0053 const double Uinf, 0054 const double Usup); 0055 0056 //! Calculates the 2 extremum distances between the 0057 //! point P and the segment [Uinf,Usup] of the circle C. 0058 //! Tol is used to determine 0059 //! if P is on the axis of the circle or 0060 //! if an extremum is on an endpoint of the segment. 0061 //! If P is on the axis of the circle, 0062 //! there are infinite solution then IsDone(me)=False. 0063 //! The conditions on the Uinf and Usup are: 0064 //! 0. <= Uinf <= 2.*PI and Usup > Uinf. 0065 //! If Usup > Uinf + 2.*PI, then only the solutions in 0066 //! the range [Uinf,Uinf+2.*PI[ are computed. 0067 Standard_EXPORT Extrema_ExtPElC(const gp_Pnt& P, 0068 const gp_Circ& C, 0069 const double Tol, 0070 const double Uinf, 0071 const double Usup); 0072 0073 Standard_EXPORT void Perform(const gp_Pnt& P, 0074 const gp_Circ& C, 0075 const double Tol, 0076 const double Uinf, 0077 const double Usup); 0078 0079 //! Calculates the 4 extremum distances between the 0080 //! point P and the segment [Uinf,Usup] of the ellipse C. 0081 //! Tol is used to determine 0082 //! if the point is on the axis of the ellipse and 0083 //! if the major radius is equal to the minor radius or 0084 //! if an extremum is on an endpoint of the segment. 0085 //! If P is on the axis of the ellipse, 0086 //! there are infinite solution then IsDone(me)=False. 0087 //! The conditions on the Uinf and Usup are: 0088 //! 0. <= Uinf <= 2.*PI and Usup > Uinf. 0089 //! If Usup > Uinf + 2.*PI, then only the solutions in 0090 //! the range [Uinf,Uinf+2.*PI[ are computed. 0091 Standard_EXPORT Extrema_ExtPElC(const gp_Pnt& P, 0092 const gp_Elips& C, 0093 const double Tol, 0094 const double Uinf, 0095 const double Usup); 0096 0097 Standard_EXPORT void Perform(const gp_Pnt& P, 0098 const gp_Elips& C, 0099 const double Tol, 0100 const double Uinf, 0101 const double Usup); 0102 0103 //! Calculates the extremum distances between the 0104 //! point P and the segment [Uinf,Usup] of the hyperbola 0105 //! C. 0106 //! Tol is used to determine if two solutions u and v 0107 //! are identical; the condition is: 0108 //! dist(C(u),C(v)) < Tol. 0109 Standard_EXPORT Extrema_ExtPElC(const gp_Pnt& P, 0110 const gp_Hypr& C, 0111 const double Tol, 0112 const double Uinf, 0113 const double Usup); 0114 0115 Standard_EXPORT void Perform(const gp_Pnt& P, 0116 const gp_Hypr& C, 0117 const double Tol, 0118 const double Uinf, 0119 const double Usup); 0120 0121 //! Calculates the 4 extremum distances between the 0122 //! point P and the segment [Uinf,Usup] of the parabola 0123 //! C. 0124 //! Tol is used to determine if two solutions u and v 0125 //! are identical; the condition is: 0126 //! dist(C(u),C(v)) < Tol. 0127 Standard_EXPORT Extrema_ExtPElC(const gp_Pnt& P, 0128 const gp_Parab& C, 0129 const double Tol, 0130 const double Uinf, 0131 const double Usup); 0132 0133 Standard_EXPORT void Perform(const gp_Pnt& P, 0134 const gp_Parab& C, 0135 const double Tol, 0136 const double Uinf, 0137 const double Usup); 0138 0139 //! True if the distances are found. 0140 Standard_EXPORT bool IsDone() const; 0141 0142 //! Returns the number of extremum distances. 0143 Standard_EXPORT int NbExt() const; 0144 0145 //! Returns the value of the Nth extremum square distance. 0146 Standard_EXPORT double SquareDistance(const int N) const; 0147 0148 //! Returns True if the Nth extremum distance is a 0149 //! minimum. 0150 Standard_EXPORT bool IsMin(const int N) const; 0151 0152 //! Returns the point of the Nth extremum distance. 0153 Standard_EXPORT const Extrema_POnCurv& Point(const int N) const; 0154 0155 private: 0156 bool myDone; 0157 int myNbExt; 0158 double mySqDist[4]; 0159 bool myIsMin[4]; 0160 Extrema_POnCurv myPoint[4]; 0161 }; 0162 0163 #endif // _Extrema_ExtPElC_HeaderFile
| [ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
|
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
|