Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-16 08:28:54

0001 // Created on: 1994-02-07
0002 // Created by: Modelistation
0003 // Copyright (c) 1994-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 _BRepIntCurveSurface_Inter_HeaderFile
0018 #define _BRepIntCurveSurface_Inter_HeaderFile
0019 
0020 #include <GeomAdaptor_Curve.hxx>
0021 #include <IntCurveSurface_HInter.hxx>
0022 #include <TopTools_SequenceOfShape.hxx>
0023 #include <Bnd_HArray1OfBox.hxx>
0024 #include <IntCurveSurface_TransitionOnCurve.hxx>
0025 
0026 class BRepTopAdaptor_TopolTool;
0027 class TopoDS_Shape;
0028 class GeomAdaptor_Curve;
0029 class gp_Lin;
0030 class IntCurveSurface_IntersectionPoint;
0031 class gp_Pnt;
0032 class TopoDS_Face;
0033 
0034 //! Computes the intersection between a face and a
0035 //! curve. To intersect one curve with shape method
0036 //! Init(Shape, curve, tTol) should be used. To
0037 //! intersect a few curves with specified shape it is
0038 //! necessary to load shape one time using method
0039 //! Load(shape, tol) and find intersection points for
0040 //! each curve using method Init(curve). For
0041 //! iteration by intersection points method More() and
0042 //! Next() should be used.
0043 //!
0044 //! Example:
0045 //! Inter.Load(shape, tol);
0046 //! for( i =1; i <= nbCurves;i++)
0047 //! {
0048 //! Inter.Init(curve);
0049 //! for(  ;Inter.More(); Inter.Next())
0050 //! {
0051 //! .......
0052 //! }
0053 //! }
0054 class BRepIntCurveSurface_Inter
0055 {
0056 public:
0057   DEFINE_STANDARD_ALLOC
0058 
0059   //! Empty constructor;
0060   Standard_EXPORT BRepIntCurveSurface_Inter();
0061 
0062   //! Load the Shape, the curve and initialize the
0063   //! tolerance used for the classification.
0064   Standard_EXPORT void Init(const TopoDS_Shape&      theShape,
0065                             const GeomAdaptor_Curve& theCurve,
0066                             const Standard_Real      theTol);
0067 
0068   //! Load the Shape, the curve and initialize the
0069   //! tolerance used for the classification.
0070   Standard_EXPORT void Init(const TopoDS_Shape& theShape,
0071                             const gp_Lin&       theLine,
0072                             const Standard_Real theTol);
0073 
0074   //! Load the Shape, and initialize the
0075   //! tolerance used for the classification.
0076   Standard_EXPORT void Load(const TopoDS_Shape& theShape, const Standard_Real theTol);
0077 
0078   //! Method to find intersections of specified curve with loaded shape.
0079   Standard_EXPORT void Init(const GeomAdaptor_Curve& theCurve);
0080 
0081   //! returns True if there is a current face.
0082   Standard_EXPORT Standard_Boolean More() const;
0083 
0084   //! Sets the next intersection point to check.
0085   Standard_EXPORT void Next();
0086 
0087   //! returns the current Intersection point.
0088   Standard_EXPORT IntCurveSurface_IntersectionPoint Point() const;
0089 
0090   //! returns the current geometric Point
0091   Standard_EXPORT const gp_Pnt& Pnt() const;
0092 
0093   //! returns the U parameter of the current point
0094   //! on the current face.
0095   Standard_EXPORT Standard_Real U() const;
0096 
0097   //! returns the V parameter of the current point
0098   //! on the current face.
0099   Standard_EXPORT Standard_Real V() const;
0100 
0101   //! returns the parameter of the current point
0102   //! on the curve.
0103   Standard_EXPORT Standard_Real W() const;
0104 
0105   //! returns the current state (IN or ON)
0106   Standard_EXPORT TopAbs_State State() const;
0107 
0108   //! returns the transition of the line on the surface (IN or OUT or UNKNOWN)
0109   Standard_EXPORT IntCurveSurface_TransitionOnCurve Transition() const;
0110 
0111   //! returns the current face.
0112   Standard_EXPORT const TopoDS_Face& Face() const;
0113 
0114 protected:
0115   //! Internal function
0116   Standard_EXPORT void Find();
0117 
0118   //! Method check found intersection point
0119   Standard_EXPORT Standard_Boolean FindPoint();
0120 
0121   //! Method to clear fields of class
0122   Standard_EXPORT void Clear();
0123 
0124 private:
0125   Standard_Real                    myTolerance;
0126   Handle(GeomAdaptor_Curve)        myCurve;
0127   IntCurveSurface_HInter           myIntcs;
0128   Standard_Integer                 myCurrentindex;
0129   Standard_Integer                 myCurrentnbpoints;
0130   Handle(BRepTopAdaptor_TopolTool) myFastClass;
0131   TopAbs_State                     myCurrentstate;
0132   Standard_Real                    myCurrentU;
0133   Standard_Real                    myCurrentV;
0134   Bnd_Box                          myCurveBox;
0135   Standard_Integer                 myIndFace;
0136   TopTools_SequenceOfShape         myFaces;
0137   Handle(Bnd_HArray1OfBox)         myFaceBoxes;
0138 };
0139 
0140 #endif // _BRepIntCurveSurface_Inter_HeaderFile