Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-03 08:36:12

0001 // Created on: 1991-05-15
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 _IntAna_IntQuadQuad_HeaderFile
0018 #define _IntAna_IntQuadQuad_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <IntAna_Curve.hxx>
0024 #include <Standard_Integer.hxx>
0025 #include <gp_Pnt.hxx>
0026 class gp_Cylinder;
0027 class IntAna_Quadric;
0028 class gp_Cone;
0029 
0030 //! This class provides the analytic intersection between a
0031 //! cylinder or a cone from gp and another quadric, as defined
0032 //! in the class Quadric from IntAna.
0033 //! This algorithm is used when the geometric intersection
0034 //! (class QuadQuadGeo from IntAna) returns no geometric
0035 //! solution.
0036 //! The result of the intersection may be
0037 //! - Curves as defined in the class Curve from IntAna
0038 //! - Points (Pnt from gp)
0039 class IntAna_IntQuadQuad
0040 {
0041 public:
0042   DEFINE_STANDARD_ALLOC
0043 
0044   //! Empty Constructor
0045   Standard_EXPORT IntAna_IntQuadQuad();
0046 
0047   //! Creates the intersection between a cylinder and a quadric .
0048   //! Tol est a definir plus precisemment.
0049   Standard_EXPORT IntAna_IntQuadQuad(const gp_Cylinder&    C,
0050                                      const IntAna_Quadric& Q,
0051                                      const Standard_Real   Tol);
0052 
0053   //! Creates the intersection between a cone and a quadric.
0054   //! Tol est a definir plus precisemment.
0055   Standard_EXPORT IntAna_IntQuadQuad(const gp_Cone&        C,
0056                                      const IntAna_Quadric& Q,
0057                                      const Standard_Real   Tol);
0058 
0059   //! Intersects a cylinder and a quadric .
0060   //! Tol est a definir plus precisemment.
0061   Standard_EXPORT void Perform(const gp_Cylinder&    C,
0062                                const IntAna_Quadric& Q,
0063                                const Standard_Real   Tol);
0064 
0065   //! Intersects a cone and a quadric.
0066   //! Tol est a definir plus precisemment.
0067   Standard_EXPORT void Perform(const gp_Cone& C, const IntAna_Quadric& Q, const Standard_Real Tol);
0068 
0069   //! Returns True if the computation was successful.
0070   Standard_Boolean IsDone() const;
0071 
0072   //! Returns TRUE if the cylinder, the cone or the sphere
0073   //! is identical to the quadric.
0074   Standard_Boolean IdenticalElements() const;
0075 
0076   //! Returns the number of curves solution.
0077   Standard_Integer NbCurve() const;
0078 
0079   //! Returns the curve of range N.
0080   Standard_EXPORT const IntAna_Curve& Curve(const Standard_Integer N) const;
0081 
0082   //! Returns the number of contact point.
0083   Standard_Integer NbPnt() const;
0084 
0085   //! Returns the point of range N.
0086   Standard_EXPORT const gp_Pnt& Point(const Standard_Integer N) const;
0087 
0088   //! Returns the parameters on the "explicit quadric"
0089   //! (i.e  the cylinder or the  cone, the first argument given to the constructor) of the point of
0090   //! range N.
0091   Standard_EXPORT void Parameters(const Standard_Integer N,
0092                                   Standard_Real&         U1,
0093                                   Standard_Real&         U2) const;
0094 
0095   //! Returns True if the Curve I  shares its last bound
0096   //! with another curve.
0097   Standard_EXPORT Standard_Boolean HasNextCurve(const Standard_Integer I) const;
0098 
0099   //! If  HasNextCurve(I)  returns True,  this  function
0100   //! returns  the  Index J  of the curve  which   has a
0101   //! common bound  with the curve   I.  If  theOpposite ==
0102   //! True , then the last parameter of the curve I, and
0103   //! the last parameter of  the curve J  give  the same
0104   //! point. Else the last  parameter of the curve I and
0105   //! the first parameter  of  the curve J are  the same
0106   //! point.
0107   Standard_EXPORT Standard_Integer NextCurve(const Standard_Integer I,
0108                                              Standard_Boolean&      theOpposite) const;
0109 
0110   //! Returns True if the Curve I shares its first bound
0111   //! with another curve.
0112   Standard_EXPORT Standard_Boolean HasPreviousCurve(const Standard_Integer I) const;
0113 
0114   //! if HasPreviousCurve(I) returns True, this function
0115   //! returns the   Index  J of the   curve  which has a
0116   //! common  bound with the  curve  I.  If theOpposite  ==
0117   //! True  , then the  first parameter of  the curve I,
0118   //! and the first parameter of the curve  J  give  the
0119   //! same point. Else the first  parameter of the curve
0120   //! I and the last  parameter  of the curve J  are the
0121   //! same point.
0122   Standard_EXPORT Standard_Integer PreviousCurve(const Standard_Integer I,
0123                                                  Standard_Boolean&      theOpposite) const;
0124 
0125 protected:
0126   //! Set the next and previous fields. Private method.
0127   Standard_EXPORT void InternalSetNextAndPrevious();
0128 
0129 protected:
0130   Standard_Boolean done;
0131   Standard_Boolean identical;
0132   IntAna_Curve     TheCurve[12];
0133   Standard_Integer previouscurve[12];
0134   Standard_Integer nextcurve[12];
0135   Standard_Integer NbCurves;
0136   Standard_Integer Nbpoints;
0137   gp_Pnt           Thepoints[2];
0138   Standard_Integer myNbMaxCurves;
0139   Standard_Real    myEpsilon;
0140   Standard_Real    myEpsilonCoeffPolyNull;
0141 };
0142 
0143 #include <IntAna_IntQuadQuad.lxx>
0144 
0145 #endif // _IntAna_IntQuadQuad_HeaderFile