Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:05

0001 // Created on: 1991-02-20
0002 // Created by: Jacques GOUSSARD
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 _IntAna2d_AnaIntersection_HeaderFile
0018 #define _IntAna2d_AnaIntersection_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <Standard_Integer.hxx>
0024 #include <IntAna2d_IntPoint.hxx>
0025 class gp_Lin2d;
0026 class gp_Circ2d;
0027 class IntAna2d_Conic;
0028 class gp_Elips2d;
0029 class gp_Parab2d;
0030 class gp_Hypr2d;
0031 
0032 
0033 //! Implementation of the analytical intersection between:
0034 //! - two Lin2d,
0035 //! - two Circ2d,
0036 //! - a Lin2d and a Circ2d,
0037 //! - an element of gp (Lin2d, Circ2d, Elips2d, Parab2d, Hypr2d)
0038 //! and another conic.
0039 //! No tolerance is given for all the intersections: the tolerance
0040 //! will be the "precision machine".
0041 class IntAna2d_AnaIntersection 
0042 {
0043 public:
0044 
0045   DEFINE_STANDARD_ALLOC
0046 
0047   
0048   //! Empty constructor. IsDone returns False.
0049   Standard_EXPORT IntAna2d_AnaIntersection();
0050   
0051   //! Intersection between two lines.
0052   Standard_EXPORT IntAna2d_AnaIntersection(const gp_Lin2d& L1, const gp_Lin2d& L2);
0053   
0054   //! Intersection between two circles.
0055   Standard_EXPORT IntAna2d_AnaIntersection(const gp_Circ2d& C1, const gp_Circ2d& C2);
0056   
0057   //! Intersection between a line and a circle.
0058   Standard_EXPORT IntAna2d_AnaIntersection(const gp_Lin2d& L, const gp_Circ2d& C);
0059   
0060   //! Intersection between a line and a conic.
0061   Standard_EXPORT IntAna2d_AnaIntersection(const gp_Lin2d& L, const IntAna2d_Conic& C);
0062   
0063   //! Intersection between a circle and another conic.
0064   Standard_EXPORT IntAna2d_AnaIntersection(const gp_Circ2d& C, const IntAna2d_Conic& Co);
0065   
0066   //! Intersection between an ellipse and another conic.
0067   Standard_EXPORT IntAna2d_AnaIntersection(const gp_Elips2d& E, const IntAna2d_Conic& C);
0068   
0069   //! Intersection between a parabola and another conic.
0070   Standard_EXPORT IntAna2d_AnaIntersection(const gp_Parab2d& P, const IntAna2d_Conic& C);
0071   
0072   //! Intersection between an hyperbola and another conic.
0073   Standard_EXPORT IntAna2d_AnaIntersection(const gp_Hypr2d& H, const IntAna2d_Conic& C);
0074   
0075   //! Intersection between two lines.
0076   Standard_EXPORT void Perform (const gp_Lin2d& L1, const gp_Lin2d& L2);
0077   
0078   //! Intersection between two circles.
0079   Standard_EXPORT void Perform (const gp_Circ2d& C1, const gp_Circ2d& C2);
0080   
0081   //! Intersection between a line and a circle.
0082   Standard_EXPORT void Perform (const gp_Lin2d& L, const gp_Circ2d& C);
0083   
0084   //! Intersection between a line and a conic.
0085   Standard_EXPORT void Perform (const gp_Lin2d& L, const IntAna2d_Conic& C);
0086   
0087   //! Intersection between a circle and another conic.
0088   Standard_EXPORT void Perform (const gp_Circ2d& C, const IntAna2d_Conic& Co);
0089   
0090   //! Intersection between an ellipse and another conic.
0091   Standard_EXPORT void Perform (const gp_Elips2d& E, const IntAna2d_Conic& C);
0092   
0093   //! Intersection between a parabola and another conic.
0094   Standard_EXPORT void Perform (const gp_Parab2d& P, const IntAna2d_Conic& C);
0095   
0096   //! Intersection between an hyperbola and another conic.
0097   Standard_EXPORT void Perform (const gp_Hypr2d& H, const IntAna2d_Conic& C);
0098   
0099   //! Returns TRUE if the computation was successful.
0100     Standard_Boolean IsDone() const;
0101   
0102   //! Returns TRUE when there is no intersection, i-e
0103   //! - no intersection point
0104   //! - the elements are not identical.
0105   //! The element may be parallel in this case.
0106     Standard_Boolean IsEmpty() const;
0107   
0108   //! For the intersection between an element of gp and a conic
0109   //! known by an implicit equation, the result will be TRUE
0110   //! if the element of gp verifies the implicit equation.
0111   //! For the intersection between two Lin2d or two Circ2d, the
0112   //! result will be TRUE if the elements are identical.
0113   //! The function returns FALSE in all the other cases.
0114     Standard_Boolean IdenticalElements() const;
0115   
0116   //! For the intersection between two Lin2d or two Circ2d,
0117   //! the function returns TRUE if the elements are parallel.
0118   //! The function returns FALSE in all the other cases.
0119     Standard_Boolean ParallelElements() const;
0120   
0121   //! returns the number of IntPoint between the 2 curves.
0122     Standard_Integer NbPoints() const;
0123   
0124   //! returns the intersection point of range N;
0125   //! If (N<=0) or (N>NbPoints), an exception is raised.
0126     const IntAna2d_IntPoint& Point (const Standard_Integer N) const;
0127 
0128 
0129 
0130 
0131 protected:
0132 
0133 
0134 
0135 
0136 
0137 private:
0138 
0139 
0140 
0141   Standard_Boolean done;
0142   Standard_Boolean para;
0143   Standard_Boolean iden;
0144   Standard_Boolean empt;
0145   Standard_Integer nbp;
0146   IntAna2d_IntPoint lpnt[4];
0147 
0148 
0149 };
0150 
0151 
0152 #include <IntAna2d_AnaIntersection.lxx>
0153 
0154 
0155 
0156 
0157 
0158 #endif // _IntAna2d_AnaIntersection_HeaderFile