Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1996-05-31
0002 // Created by: Laurent BUCHARD
0003 // Copyright (c) 1996-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 _IntCurvesFace_Intersector_HeaderFile
0018 #define _IntCurvesFace_Intersector_HeaderFile
0019 
0020 #include <Adaptor3d_Curve.hxx>
0021 #include <Bnd_BoundSortBox.hxx>
0022 #include <BRepAdaptor_Surface.hxx>
0023 #include <IntCurveSurface_SequenceOfPnt.hxx>
0024 #include <IntCurveSurface_ThePolyhedronOfHInter.hxx>
0025 #include <TColStd_SequenceOfInteger.hxx>
0026 #include <TopoDS_Face.hxx>
0027 #include <GeomAbs_SurfaceType.hxx>
0028 #include <IntCurveSurface_TransitionOnCurve.hxx>
0029 #include <TopAbs_State.hxx>
0030 
0031 #include <memory>
0032 
0033 class BRepTopAdaptor_TopolTool;
0034 class gp_Lin;
0035 class gp_Pnt;
0036 class IntCurveSurface_HInter;
0037 class gp_Pnt2d;
0038 class Bnd_Box;
0039 
0040 DEFINE_STANDARD_HANDLE(IntCurvesFace_Intersector, Standard_Transient)
0041 
0042 
0043 class IntCurvesFace_Intersector : public Standard_Transient
0044 {
0045   DEFINE_STANDARD_RTTIEXT(IntCurvesFace_Intersector, Standard_Transient)
0046 
0047 public:
0048 
0049   DEFINE_STANDARD_ALLOC
0050 
0051   
0052   //! Load a Face.
0053   //!
0054   //! The Tolerance <Tol> is used to determine if the
0055   //! first point of the segment is near the face. In
0056   //! that case, the parameter of the intersection point
0057   //! on the line can be a negative value (greater than -Tol).
0058   //! If aRestr = true UV bounding box of face is used to restrict 
0059   //! it's underlined surface,
0060   //! otherwise surface is not restricted.
0061   //! If UseBToler = false then the 2d-point of intersection is classified with null-tolerance
0062   //! (relative to face);
0063   //! otherwise it's using maximum between input tolerance(aTol) and tolerances of face bounds (edges).
0064   Standard_EXPORT IntCurvesFace_Intersector(const TopoDS_Face& F, const Standard_Real aTol, 
0065                                             const Standard_Boolean aRestr = Standard_True,
0066                                             const Standard_Boolean UseBToler = Standard_True);
0067   
0068   //! Perform the intersection between the
0069   //! segment L and the loaded face.
0070   //!
0071   //! PInf is the smallest parameter on the line
0072   //! PSup is the highest  parameter on the line
0073   //!
0074   //! For an infinite line PInf and PSup can be
0075   //! +/- RealLast.
0076   Standard_EXPORT void Perform (const gp_Lin& L, const Standard_Real PInf, const Standard_Real PSup);
0077   
0078   //! same method for a HCurve from Adaptor3d.
0079   //! PInf an PSup can also be - and + INF.
0080   Standard_EXPORT void Perform (const Handle(Adaptor3d_Curve)& HCu, const Standard_Real PInf, const Standard_Real PSup);
0081   
0082   //! Return the surface type
0083   Standard_EXPORT GeomAbs_SurfaceType SurfaceType() const;
0084   
0085   //! True is returned when the intersection have been computed.
0086     Standard_Boolean IsDone() const;
0087   
0088     Standard_Integer NbPnt() const;
0089   
0090   //! Returns the U parameter of the ith intersection point
0091   //! on the surface.
0092     Standard_Real UParameter (const Standard_Integer I) const;
0093   
0094   //! Returns the V parameter of the ith intersection point
0095   //! on the surface.
0096     Standard_Real VParameter (const Standard_Integer I) const;
0097   
0098   //! Returns the parameter of the ith intersection point
0099   //! on the line.
0100     Standard_Real WParameter (const Standard_Integer I) const;
0101   
0102   //! Returns the geometric point of the ith intersection
0103   //! between the line and the surface.
0104     const gp_Pnt& Pnt (const Standard_Integer I) const;
0105   
0106   //! Returns the ith transition of the line on the surface.
0107     IntCurveSurface_TransitionOnCurve Transition (const Standard_Integer I) const;
0108   
0109   //! Returns the ith state of the point on the face.
0110   //! The values can be either TopAbs_IN
0111   //! ( the point is in the face)
0112   //! or TopAbs_ON
0113   //! ( the point is on a boundary of the face).
0114     TopAbs_State State (const Standard_Integer I) const;
0115 
0116   //! Returns true if curve is parallel or belongs face surface
0117   //! This case is recognized only for some pairs 
0118   //! of analytical curves and surfaces (plane - line, ...)
0119     Standard_Boolean IsParallel() const;
0120 
0121   //! Returns the significant face used to determine
0122   //! the intersection.
0123     const TopoDS_Face& Face() const;
0124   
0125   Standard_EXPORT TopAbs_State ClassifyUVPoint (const gp_Pnt2d& Puv) const;
0126   
0127   Standard_EXPORT Bnd_Box Bounding() const;
0128 
0129   //! Sets the boundary tolerance flag
0130   Standard_EXPORT void SetUseBoundToler(Standard_Boolean UseBToler );
0131 
0132   //! Returns the boundary tolerance flag
0133   Standard_EXPORT Standard_Boolean GetUseBoundToler() const;
0134   
0135   Standard_EXPORT virtual ~IntCurvesFace_Intersector();
0136 
0137 protected:
0138 
0139 
0140 
0141 
0142 
0143 private:
0144 
0145   
0146   Standard_EXPORT void InternalCall (const IntCurveSurface_HInter& HICS, const Standard_Real pinf, const Standard_Real psup);
0147 
0148 
0149   Handle(BRepTopAdaptor_TopolTool) myTopolTool;
0150   Handle(BRepAdaptor_Surface) Hsurface;
0151   Standard_Real Tol;
0152   IntCurveSurface_SequenceOfPnt SeqPnt;
0153   TColStd_SequenceOfInteger mySeqState;
0154   Standard_Boolean done;
0155   Standard_Boolean myReady;
0156   Standard_Integer nbpnt;
0157   TopoDS_Face face;
0158   std::unique_ptr<IntCurveSurface_ThePolyhedronOfHInter> myPolyhedron;
0159   std::unique_ptr<Bnd_BoundSortBox> myBndBounding;
0160   Standard_Boolean myUseBoundTol;
0161   Standard_Boolean myIsParallel; //Curve is "parallel" face surface
0162                                  //This case is recognized only for some pairs 
0163                                  //of analytical curves and surfaces (plane - line, ...)
0164 
0165 
0166 };
0167 
0168 
0169 #include <IntCurvesFace_Intersector.lxx>
0170 
0171 
0172 
0173 
0174 
0175 #endif // _IntCurvesFace_Intersector_HeaderFile