Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-12 09:17:48

0001 // Created on: 1995-07-02
0002 // Created by: Laurent BUCHARD
0003 // Copyright (c) 1995-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 _IntPatch_HInterTool_HeaderFile
0018 #define _IntPatch_HInterTool_HeaderFile
0019 
0020 #include <Adaptor2d_Curve2d.hxx>
0021 #include <Adaptor3d_Surface.hxx>
0022 
0023 class gp_Pnt2d;
0024 class Adaptor3d_HVertex;
0025 class gp_Pnt;
0026 
0027 //! Tool for the intersection between 2 surfaces.
0028 //! Regroupe pour l instant les methodes hors Adaptor3d...
0029 class IntPatch_HInterTool
0030 {
0031 public:
0032   DEFINE_STANDARD_ALLOC
0033 
0034   Standard_EXPORT IntPatch_HInterTool();
0035 
0036   static bool SingularOnUMin(const occ::handle<Adaptor3d_Surface>& S);
0037 
0038   static bool SingularOnUMax(const occ::handle<Adaptor3d_Surface>& S);
0039 
0040   static bool SingularOnVMin(const occ::handle<Adaptor3d_Surface>& S);
0041 
0042   static bool SingularOnVMax(const occ::handle<Adaptor3d_Surface>& S);
0043 
0044   Standard_EXPORT static int NbSamplesU(const occ::handle<Adaptor3d_Surface>& S,
0045                                         const double                          u1,
0046                                         const double                          u2);
0047 
0048   Standard_EXPORT static int NbSamplesV(const occ::handle<Adaptor3d_Surface>& S,
0049                                         const double                          v1,
0050                                         const double                          v2);
0051 
0052   Standard_EXPORT int NbSamplePoints(const occ::handle<Adaptor3d_Surface>& S);
0053 
0054   Standard_EXPORT void SamplePoint(const occ::handle<Adaptor3d_Surface>& S,
0055                                    const int                             Index,
0056                                    double&                               U,
0057                                    double&                               V) const;
0058 
0059   //! Returns True if all the intersection point and edges
0060   //! are known on the Arc.
0061   //! The intersection point are given as vertices.
0062   //! The intersection edges are given as intervals between
0063   //! two vertices.
0064   Standard_EXPORT static bool HasBeenSeen(const occ::handle<Adaptor2d_Curve2d>& C);
0065 
0066   //! returns the number of points which is used to make
0067   //! a sample on the arc. this number is a function of
0068   //! the Surface and the CurveOnSurface complexity.
0069   Standard_EXPORT static int NbSamplesOnArc(const occ::handle<Adaptor2d_Curve2d>& A);
0070 
0071   //! Returns the parametric limits on the arc C.
0072   //! These limits must be finite : they are either
0073   //! the real limits of the arc, for a finite arc,
0074   //! or a bounding box for an infinite arc.
0075   Standard_EXPORT static void Bounds(const occ::handle<Adaptor2d_Curve2d>& C,
0076                                      double&                               Ufirst,
0077                                      double&                               Ulast);
0078 
0079   //! Projects the point P on the arc C.
0080   //! If the methods returns true, the projection is
0081   //! successful, and Paramproj is the parameter on the arc
0082   //! of the projected point, Ptproj is the projected Point.
0083   //! If the method returns false, Param proj and Ptproj
0084   //! are not significant.
0085   Standard_EXPORT static bool Project(const occ::handle<Adaptor2d_Curve2d>& C,
0086                                       const gp_Pnt2d&                       P,
0087                                       double&                               Paramproj,
0088                                       gp_Pnt2d&                             Ptproj);
0089 
0090   //! Returns the parametric tolerance used to consider
0091   //! that the vertex and another point meet, i-e
0092   //! if std::abs(parameter(Vertex) - parameter(OtherPnt))<=
0093   //! Tolerance, the points are "merged".
0094   Standard_EXPORT static double Tolerance(const occ::handle<Adaptor3d_HVertex>& V,
0095                                           const occ::handle<Adaptor2d_Curve2d>& C);
0096 
0097   //! Returns the parameter of the vertex V on the arc A.
0098   Standard_EXPORT static double Parameter(const occ::handle<Adaptor3d_HVertex>& V,
0099                                           const occ::handle<Adaptor2d_Curve2d>& C);
0100 
0101   //! Returns the number of intersection points on the arc A.
0102   Standard_EXPORT static int NbPoints(const occ::handle<Adaptor2d_Curve2d>& C);
0103 
0104   //! Returns the value (Pt), the tolerance (Tol), and
0105   //! the parameter (U) on the arc A , of the intersection
0106   //! point of range Index.
0107   Standard_EXPORT static void Value(const occ::handle<Adaptor2d_Curve2d>& C,
0108                                     const int                             Index,
0109                                     gp_Pnt&                               Pt,
0110                                     double&                               Tol,
0111                                     double&                               U);
0112 
0113   //! Returns True if the intersection point of range Index
0114   //! corresponds with a vertex on the arc A.
0115   Standard_EXPORT static bool IsVertex(const occ::handle<Adaptor2d_Curve2d>& C, const int Index);
0116 
0117   //! When IsVertex returns True, this method returns the
0118   //! vertex on the arc A.
0119   Standard_EXPORT static void Vertex(const occ::handle<Adaptor2d_Curve2d>& C,
0120                                      const int                             Index,
0121                                      occ::handle<Adaptor3d_HVertex>&       V);
0122 
0123   //! returns the number of part of A solution of the
0124   //! of intersection problem.
0125   Standard_EXPORT static int NbSegments(const occ::handle<Adaptor2d_Curve2d>& C);
0126 
0127   //! Returns True when the segment of range Index is not
0128   //! open at the left side. In that case, IndFirst is the
0129   //! range in the list intersection points (see NbPoints)
0130   //! of the one which defines the left bound of the segment.
0131   //! Otherwise, the method has to return False, and IndFirst
0132   //! has no meaning.
0133   Standard_EXPORT static bool HasFirstPoint(const occ::handle<Adaptor2d_Curve2d>& C,
0134                                             const int                             Index,
0135                                             int&                                  IndFirst);
0136 
0137   //! Returns True when the segment of range Index is not
0138   //! open at the right side. In that case, IndLast is the
0139   //! range in the list intersection points (see NbPoints)
0140   //! of the one which defines the right bound of the segment.
0141   //! Otherwise, the method has to return False, and IndLast
0142   //! has no meaning.
0143   Standard_EXPORT static bool HasLastPoint(const occ::handle<Adaptor2d_Curve2d>& C,
0144                                            const int                             Index,
0145                                            int&                                  IndLast);
0146 
0147   //! Returns True when the whole restriction is solution
0148   //! of the intersection problem.
0149   Standard_EXPORT static bool IsAllSolution(const occ::handle<Adaptor2d_Curve2d>& C);
0150 
0151 private:
0152   double uinf;
0153   double vinf;
0154   double usup;
0155   double vsup;
0156 };
0157 
0158 #include <IntPatch_HInterTool.lxx>
0159 
0160 #endif // _IntPatch_HInterTool_HeaderFile