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_ExtElC_HeaderFile
0018 #define _Extrema_ExtElC_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <Standard_Integer.hxx>
0024 #include <Extrema_POnCurv.hxx>
0025 
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 distance between two elementary
0034 //! curves.
0035 //! These distances can be maximum or minimum.
0036 class Extrema_ExtElC 
0037 {
0038 public:
0039 
0040   DEFINE_STANDARD_ALLOC
0041 
0042   
0043   Standard_EXPORT Extrema_ExtElC();
0044   
0045   //! Calculates the distance between two lines.
0046   //! AngTol is used to test if the lines are parallel:
0047   //! Angle(C1,C2) < AngTol.
0048   Standard_EXPORT Extrema_ExtElC(const gp_Lin& C1, const gp_Lin& C2, const Standard_Real AngTol);
0049   
0050   //! Calculates the distance between a line and a
0051   //! circle.
0052   Standard_EXPORT Extrema_ExtElC(const gp_Lin& C1, const gp_Circ& C2, const Standard_Real Tol);
0053   
0054   //! Calculates the distance between a line and an
0055   //! ellipse.
0056   Standard_EXPORT Extrema_ExtElC(const gp_Lin& C1, const gp_Elips& C2);
0057   
0058   //! Calculates the distance between a line and a
0059   //! hyperbola.
0060   Standard_EXPORT Extrema_ExtElC(const gp_Lin& C1, const gp_Hypr& C2);
0061   
0062   //! Calculates the distance between a line and a
0063   //! parabola.
0064   Standard_EXPORT Extrema_ExtElC(const gp_Lin& C1, const gp_Parab& C2);
0065   
0066   //! Calculates the distance between two circles.
0067   //! The circles can be parallel or identical.
0068   Standard_EXPORT Extrema_ExtElC(const gp_Circ& C1, const gp_Circ& C2);
0069   
0070   //! Returns True if the distances are found.
0071   Standard_EXPORT Standard_Boolean IsDone() const;
0072   
0073   //! Returns True if the two curves are parallel.
0074   Standard_EXPORT Standard_Boolean IsParallel() const;
0075   
0076   //! Returns the number of extremum distances.
0077   Standard_EXPORT Standard_Integer NbExt() const;
0078   
0079   //! Returns the value of the Nth extremum square distance.
0080   Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N = 1) const;
0081   
0082   //! Returns the points of the Nth extremum distance.
0083   //! P1 is on the first curve, P2 on the second one.
0084   Standard_EXPORT void Points (const Standard_Integer N, Extrema_POnCurv& P1, Extrema_POnCurv& P2) const;
0085 
0086 
0087 
0088 
0089 protected:
0090 
0091   //! Computes extrema in case when considered line and circle are in one plane
0092   Standard_EXPORT Standard_Boolean PlanarLineCircleExtrema(const gp_Lin& C1,
0093                                                            const gp_Circ& C2);
0094 
0095 
0096 
0097 
0098 private:
0099 
0100 
0101 
0102   Standard_Boolean myDone;
0103   Standard_Boolean myIsPar;
0104   Standard_Integer myNbExt;
0105   Standard_Real mySqDist[6];
0106   Extrema_POnCurv myPoint[6][2];
0107 
0108 
0109 };
0110 
0111 
0112 
0113 
0114 
0115 
0116 
0117 #endif // _Extrema_ExtElC_HeaderFile