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_ExtCS_HeaderFile
0018 #define _Extrema_ExtCS_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <Extrema_ExtElCS.hxx>
0024 #include <Extrema_SequenceOfPOnSurf.hxx>
0025 #include <Extrema_SequenceOfPOnCurv.hxx>
0026 #include <TColStd_SequenceOfReal.hxx>
0027 #include <GeomAbs_SurfaceType.hxx>
0028 
0029 class Adaptor3d_Curve;
0030 class Adaptor3d_Surface;
0031 class Extrema_POnCurv;
0032 class Extrema_POnSurf;
0033 class gp_Pnt;
0034 
0035 
0036 //! It calculates all the extremum distances
0037 //! between a curve and a surface.
0038 //! These distances can be minimum or maximum.
0039 class Extrema_ExtCS 
0040 {
0041 public:
0042 
0043   DEFINE_STANDARD_ALLOC
0044 
0045   
0046   Standard_EXPORT Extrema_ExtCS();
0047   
0048   //! It calculates all the distances between C and S.
0049   Standard_EXPORT Extrema_ExtCS(const Adaptor3d_Curve& C, const Adaptor3d_Surface& S, const Standard_Real TolC, const Standard_Real TolS);
0050   
0051   //! It calculates all the distances between C and S.
0052   //! UCinf and UCmax are the start and end parameters
0053   //! of the curve.
0054   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);
0055 
0056   //! Initializes the fields of the algorithm.
0057   Standard_EXPORT void Initialize (const Adaptor3d_Surface& S, const Standard_Real TolC, const Standard_Real TolS);
0058 
0059   //! Initializes the fields of the algorithm.
0060   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);
0061   
0062   //! Computes the distances.
0063   //! An exception is raised if the fieds have not been
0064   //! initialized.
0065   Standard_EXPORT void Perform (const Adaptor3d_Curve& C, const Standard_Real Uinf, const Standard_Real Usup);
0066   
0067   //! Returns True if the distances are found.
0068   Standard_EXPORT Standard_Boolean IsDone() const;
0069   
0070   //! Returns True if the curve is on a parallel surface.
0071   Standard_EXPORT Standard_Boolean IsParallel() const;
0072   
0073   //! Returns the number of extremum distances.
0074   Standard_EXPORT Standard_Integer NbExt() const;
0075   
0076   //! Returns the value of the Nth resulting square distance.
0077   Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const;
0078   
0079   //! Returns the point of the Nth resulting distance.
0080   Standard_EXPORT void Points (const Standard_Integer N, Extrema_POnCurv& P1, Extrema_POnSurf& P2) const;
0081 
0082 private:
0083 
0084   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);
0085 
0086 private:
0087 
0088   // disallow copies
0089   Extrema_ExtCS            (Extrema_ExtCS& ) Standard_DELETE;
0090   Extrema_ExtCS& operator= (Extrema_ExtCS& ) Standard_DELETE;
0091 
0092 private:
0093 
0094   const Adaptor3d_Surface* myS;
0095   Standard_Boolean myDone;
0096   Standard_Boolean myIsPar;
0097   Extrema_ExtElCS myExtElCS;
0098   Extrema_SequenceOfPOnSurf myPOnS;
0099   Extrema_SequenceOfPOnCurv myPOnC;
0100   Standard_Real myuinf;
0101   Standard_Real myusup;
0102   Standard_Real myvinf;
0103   Standard_Real myvsup;
0104   Standard_Real mytolC;
0105   Standard_Real mytolS;
0106   Standard_Real myucinf;
0107   Standard_Real myucsup;
0108   TColStd_SequenceOfReal mySqDist;
0109   GeomAbs_SurfaceType myStype;
0110 
0111 };
0112 
0113 #endif // _Extrema_ExtCS_HeaderFile