1 // Created on: 1991-02-21 2 // Created by: Isabelle GRIGNON 3 // Copyright (c) 1991-1999 Matra Datavision 4 // Copyright (c) 1999-2014 OPEN CASCADE SAS 5 // 6 // This file is part of Open CASCADE Technology software library. 7 // 8 // This library is free software; you can redistribute it and/or modify it under 9 // the terms of the GNU Lesser General Public License version 2.1 as published 10 // by the Free Software Foundation, with special exception defined in the file 11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT 12 // distribution for complete text of the license and disclaimer of any warranty. 13 // 14 // Alternatively, this file may be used under the terms of Open CASCADE 15 // commercial license or contractual agreement. 16 17 #ifndef _Extrema_ExtCS_HeaderFile 18 #define _Extrema_ExtCS_HeaderFile 19 20 #include <Standard.hxx> 21 #include <Standard_DefineAlloc.hxx> 22 #include <Standard_Handle.hxx> 23 24 #include <Adaptor3d_SurfacePtr.hxx> 25 #include <Standard_Boolean.hxx> 26 #include <Extrema_ExtElCS.hxx> 27 #include <Extrema_SequenceOfPOnSurf.hxx> 28 #include <Extrema_SequenceOfPOnCurv.hxx> 29 #include <Standard_Real.hxx> 30 #include <TColStd_SequenceOfReal.hxx> 31 #include <GeomAbs_SurfaceType.hxx> 32 #include <Standard_Integer.hxx> 33 class StdFail_NotDone; 34 class Standard_OutOfRange; 35 class Standard_TypeMismatch; 36 class Adaptor3d_Curve; 37 class Adaptor3d_Surface; 38 class Extrema_POnCurv; 39 class Extrema_POnSurf; 40 class gp_Pnt; 41 42 43 //! It calculates all the extremum distances 44 //! between a curve and a surface. 45 //! These distances can be minimum or maximum. 46 class Extrema_ExtCS 47 { 48 public: 49 50 DEFINE_STANDARD_ALLOC 51 52 53 Standard_EXPORT Extrema_ExtCS(); 54 55 //! It calculates all the distances between C and S. 56 Standard_EXPORT Extrema_ExtCS(const Adaptor3d_Curve& C, const Adaptor3d_Surface& S, const Standard_Real TolC, const Standard_Real TolS); 57 58 //! It calculates all the distances between C and S. 59 //! UCinf and UCmax are the start and end parameters 60 //! of the curve. 61 Standard_EXPORT Extrema_ExtCS(const Adaptor3d_Curve& C, const Adaptor3d_Surface& S, const Standard_Real UCinf, const Standard_Real UCsup, const Standard_Real Uinf, const Standard_Real Usup, const Standard_Real Vinf, const Standard_Real Vsup, const Standard_Real TolC, const Standard_Real TolS); 62 63 //! Initializes the fields of the algorithm. 64 Standard_EXPORT void Initialize (const Adaptor3d_Surface& S, const Standard_Real Uinf, const Standard_Real Usup, const Standard_Real Vinf, const Standard_Real Vsup, const Standard_Real TolC, const Standard_Real TolS); 65 66 //! Computes the distances. 67 //! An exception is raised if the fieds have not been 68 //! initialized. 69 Standard_EXPORT void Perform (const Adaptor3d_Curve& C, const Standard_Real Uinf, const Standard_Real Usup); 70 71 //! Returns True if the distances are found. 72 Standard_EXPORT Standard_Boolean IsDone() const; 73 74 //! Returns True if the curve is on a parallel surface. 75 Standard_EXPORT Standard_Boolean IsParallel() const; 76 77 //! Returns the number of extremum distances. 78 Standard_EXPORT Standard_Integer NbExt() const; 79 80 //! Returns the value of the Nth resulting square distance. 81 Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const; 82 83 //! Returns the point of the Nth resulting distance. 84 Standard_EXPORT void Points (const Standard_Integer N, Extrema_POnCurv& P1, Extrema_POnSurf& P2) const; 85 86 87 88 89 protected: 90 91 92 93 94 95 private: 96 97 98 Standard_EXPORT Standard_Boolean AddSolution (const Adaptor3d_Curve& Curve, const Standard_Real T, const Standard_Real U, const Standard_Real V, const gp_Pnt& PointOnCurve, const gp_Pnt& PointOnSurf, const Standard_Real SquareDist); 99 100 Standard_EXPORT Adaptor3d_SurfacePtr Bidon() const; 101 102 103 Adaptor3d_SurfacePtr myS; 104 Standard_Boolean myDone; 105 Standard_Boolean myIsPar; 106 Extrema_ExtElCS myExtElCS; 107 Extrema_SequenceOfPOnSurf myPOnS; 108 Extrema_SequenceOfPOnCurv myPOnC; 109 Standard_Real myuinf; 110 Standard_Real myusup; 111 Standard_Real myvinf; 112 Standard_Real myvsup; 113 Standard_Real mytolC; 114 Standard_Real mytolS; 115 Standard_Real myucinf; 116 Standard_Real myucsup; 117 TColStd_SequenceOfReal mySqDist; 118 GeomAbs_SurfaceType myStype; 119 120 121 }; 122 123 124 125 126 127 128 129 #endif // _Extrema_ExtCS_HeaderFile 130