1 // Created on: 1994-02-07
2 // Created by: Modelistation
3 // Copyright (c) 1994-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _BRepIntCurveSurface_Inter_HeaderFile
18 #define _BRepIntCurveSurface_Inter_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <Standard_Real.hxx>
25 #include <IntCurveSurface_HInter.hxx>
26 #include <Standard_Integer.hxx>
27 #include <TopAbs_State.hxx>
28 #include <Bnd_Box.hxx>
29 #include <TopTools_SequenceOfShape.hxx>
30 #include <Bnd_HArray1OfBox.hxx>
31 #include <Standard_Boolean.hxx>
32 #include <IntCurveSurface_TransitionOnCurve.hxx>
33 class GeomAdaptor_HCurve;
34 class BRepTopAdaptor_TopolTool;
35 class StdFail_NotDone;
37 class GeomAdaptor_Curve;
39 class IntCurveSurface_IntersectionPoint;
44 //! Computes the intersection between a face and a
45 //! curve. To intersect one curve with shape method
46 //! Init(Shape, curve, tTol) should be used. To
47 //! intersect a few curves with specified shape it is
48 //! necessary to load shape one time using method
49 //! Load(shape, tol) and find intersection points for
50 //! each curve using method Init(curve). For
51 //! iteration by intersection points method More() and
52 //! Next() should be used.
55 //! Inter.Load(shape, tol);
56 //! for( i =1; i <= nbCurves;i++)
58 //! Inter.Init(curve);
59 //! for( ;Inter.More(); Inter.Next())
64 class BRepIntCurveSurface_Inter
71 //! Empty constructor;
72 Standard_EXPORT BRepIntCurveSurface_Inter();
74 //! Load the Shape, the curve and initialize the
75 //! tolerance used for the classification.
76 Standard_EXPORT void Init (const TopoDS_Shape& theShape, const GeomAdaptor_Curve& theCurve, const Standard_Real theTol);
78 //! Load the Shape, the curve and initialize the
79 //! tolerance used for the classification.
80 Standard_EXPORT void Init (const TopoDS_Shape& theShape, const gp_Lin& theLine, const Standard_Real theTol);
82 //! Load the Shape, and initialize the
83 //! tolerance used for the classification.
84 Standard_EXPORT void Load (const TopoDS_Shape& theShape, const Standard_Real theTol);
86 //! Method to find intersections of specified curve with loaded shape.
87 Standard_EXPORT void Init (const GeomAdaptor_Curve& theCurve);
89 //! returns True if there is a current face.
90 Standard_EXPORT Standard_Boolean More() const;
92 //! Sets the next intersection point to check.
93 Standard_EXPORT void Next();
95 //! returns the current Intersection point.
96 Standard_EXPORT IntCurveSurface_IntersectionPoint Point() const;
98 //! returns the current geometric Point
99 Standard_EXPORT const gp_Pnt& Pnt() const;
101 //! returns the U parameter of the current point
102 //! on the current face.
103 Standard_EXPORT Standard_Real U() const;
105 //! returns the V parameter of the current point
106 //! on the current face.
107 Standard_EXPORT Standard_Real V() const;
109 //! returns the parameter of the current point
111 Standard_EXPORT Standard_Real W() const;
113 //! returns the current state (IN or ON)
114 Standard_EXPORT TopAbs_State State() const;
116 //! returns the transition of the line on the surface (IN or OUT or UNKNOWN)
117 Standard_EXPORT IntCurveSurface_TransitionOnCurve Transition() const;
119 //! returns the current face.
120 Standard_EXPORT const TopoDS_Face& Face() const;
128 //! Internal function
129 Standard_EXPORT void Find();
131 //! Method chec found intersection point
132 Standard_EXPORT Standard_Boolean FindPoint();
134 //! Method to clear fields of class
135 Standard_EXPORT void Clear();
144 Standard_Real myTolerance;
145 Handle(GeomAdaptor_HCurve) myCurve;
146 IntCurveSurface_HInter myIntcs;
147 Standard_Integer myCurrentindex;
148 Standard_Integer myCurrentnbpoints;
149 Handle(BRepTopAdaptor_TopolTool) myFastClass;
150 TopAbs_State myCurrentstate;
151 Standard_Real myCurrentU;
152 Standard_Real myCurrentV;
154 Standard_Integer myIndFace;
155 TopTools_SequenceOfShape myFaces;
156 Handle(Bnd_HArray1OfBox) myFaceBoxes;
167 #endif // _BRepIntCurveSurface_Inter_HeaderFile