Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:12

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