Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-14 08:29:18

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 Standard_Boolean SingularOnUMin(const Handle(Adaptor3d_Surface)& S);
0037 
0038   static Standard_Boolean SingularOnUMax(const Handle(Adaptor3d_Surface)& S);
0039 
0040   static Standard_Boolean SingularOnVMin(const Handle(Adaptor3d_Surface)& S);
0041 
0042   static Standard_Boolean SingularOnVMax(const Handle(Adaptor3d_Surface)& S);
0043 
0044   Standard_EXPORT static Standard_Integer NbSamplesU(const Handle(Adaptor3d_Surface)& S,
0045                                                      const Standard_Real              u1,
0046                                                      const Standard_Real              u2);
0047 
0048   Standard_EXPORT static Standard_Integer NbSamplesV(const Handle(Adaptor3d_Surface)& S,
0049                                                      const Standard_Real              v1,
0050                                                      const Standard_Real              v2);
0051 
0052   Standard_EXPORT Standard_Integer NbSamplePoints(const Handle(Adaptor3d_Surface)& S);
0053 
0054   Standard_EXPORT void SamplePoint(const Handle(Adaptor3d_Surface)& S,
0055                                    const Standard_Integer           Index,
0056                                    Standard_Real&                   U,
0057                                    Standard_Real&                   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 Standard_Boolean HasBeenSeen(const 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 Standard_Integer NbSamplesOnArc(const 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 Handle(Adaptor2d_Curve2d)& C,
0076                                      Standard_Real&                   Ufirst,
0077                                      Standard_Real&                   Ulast);
0078 
0079   //! Projects the point P on the arc C.
0080   //! If the methods returns Standard_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 Standard_False, Param proj and Ptproj
0084   //! are not significant.
0085   Standard_EXPORT static Standard_Boolean Project(const Handle(Adaptor2d_Curve2d)& C,
0086                                                   const gp_Pnt2d&                  P,
0087                                                   Standard_Real&                   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 Abs(parameter(Vertex) - parameter(OtherPnt))<=
0093   //! Tolerance, the points are "merged".
0094   Standard_EXPORT static Standard_Real Tolerance(const Handle(Adaptor3d_HVertex)& V,
0095                                                  const Handle(Adaptor2d_Curve2d)& C);
0096 
0097   //! Returns the parameter of the vertex V on the arc A.
0098   Standard_EXPORT static Standard_Real Parameter(const Handle(Adaptor3d_HVertex)& V,
0099                                                  const Handle(Adaptor2d_Curve2d)& C);
0100 
0101   //! Returns the number of intersection points on the arc A.
0102   Standard_EXPORT static Standard_Integer NbPoints(const 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 Handle(Adaptor2d_Curve2d)& C,
0108                                     const Standard_Integer           Index,
0109                                     gp_Pnt&                          Pt,
0110                                     Standard_Real&                   Tol,
0111                                     Standard_Real&                   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 Standard_Boolean IsVertex(const Handle(Adaptor2d_Curve2d)& C,
0116                                                    const Standard_Integer           Index);
0117 
0118   //! When IsVertex returns True, this method returns the
0119   //! vertex on the arc A.
0120   Standard_EXPORT static void Vertex(const Handle(Adaptor2d_Curve2d)& C,
0121                                      const Standard_Integer           Index,
0122                                      Handle(Adaptor3d_HVertex)&       V);
0123 
0124   //! returns the number of part of A solution of the
0125   //! of intersection problem.
0126   Standard_EXPORT static Standard_Integer NbSegments(const Handle(Adaptor2d_Curve2d)& C);
0127 
0128   //! Returns True when the segment of range Index is not
0129   //! open at the left side. In that case, IndFirst is the
0130   //! range in the list intersection points (see NbPoints)
0131   //! of the one which defines the left bound of the segment.
0132   //! Otherwise, the method has to return False, and IndFirst
0133   //! has no meaning.
0134   Standard_EXPORT static Standard_Boolean HasFirstPoint(const Handle(Adaptor2d_Curve2d)& C,
0135                                                         const Standard_Integer           Index,
0136                                                         Standard_Integer&                IndFirst);
0137 
0138   //! Returns True when the segment of range Index is not
0139   //! open at the right side. In that case, IndLast is the
0140   //! range in the list intersection points (see NbPoints)
0141   //! of the one which defines the right bound of the segment.
0142   //! Otherwise, the method has to return False, and IndLast
0143   //! has no meaning.
0144   Standard_EXPORT static Standard_Boolean HasLastPoint(const Handle(Adaptor2d_Curve2d)& C,
0145                                                        const Standard_Integer           Index,
0146                                                        Standard_Integer&                IndLast);
0147 
0148   //! Returns True when the whole restriction is solution
0149   //! of the intersection problem.
0150   Standard_EXPORT static Standard_Boolean IsAllSolution(const Handle(Adaptor2d_Curve2d)& C);
0151 
0152 protected:
0153 private:
0154   Standard_Real uinf;
0155   Standard_Real vinf;
0156   Standard_Real usup;
0157   Standard_Real vsup;
0158 };
0159 
0160 #include <IntPatch_HInterTool.lxx>
0161 
0162 #endif // _IntPatch_HInterTool_HeaderFile