1 // Created on: 1995-09-12
2 // Created by: Bruno DUMORTIER
3 // Copyright (c) 1995-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 _GeomAPI_IntCS_HeaderFile
18 #define _GeomAPI_IntCS_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <IntCurveSurface_HInter.hxx>
25 #include <Standard_Boolean.hxx>
26 #include <Standard_Integer.hxx>
28 class StdFail_NotDone;
29 class Standard_OutOfRange;
34 //! This class implements methods for
35 //! computing intersection points and segments between a
43 //! Creates an empty object. Use the
44 //! function Perform for further initialization of the algorithm by
45 //! the curve and the surface.
46 Standard_EXPORT GeomAPI_IntCS();
48 //! Computes the intersections between
49 //! the curve C and the surface S.
51 //! Use function IsDone to verify that the intersections are computed successfully.
52 Standard_EXPORT GeomAPI_IntCS(const Handle(Geom_Curve)& C, const Handle(Geom_Surface)& S);
54 //! This function Initializes an algorithm with the curve C and the
55 //! surface S and computes the intersections between C and S.
57 //! Use function IsDone to verify that the intersections are computed successfully.
58 Standard_EXPORT void Perform (const Handle(Geom_Curve)& C, const Handle(Geom_Surface)& S);
60 //! Returns true if the intersections are successfully computed.
61 Standard_EXPORT Standard_Boolean IsDone() const;
63 //! Returns the number of Intersection Points
64 //! if IsDone returns True.
65 //! else NotDone is raised.
66 Standard_EXPORT Standard_Integer NbPoints() const;
68 //! Returns the Intersection Point of range <Index>in case of cross intersection.
69 //! Raises NotDone if the computation has failed or if
70 //! the computation has not been done
71 //! raises OutOfRange if Index is not in the range <1..NbPoints>
72 Standard_EXPORT const gp_Pnt& Point (const Standard_Integer Index) const;
74 //! Returns parameter W on the curve
75 //! and (parameters U,V) on the surface of the computed intersection point
76 //! of index Index in case of cross intersection.
78 //! StdFail_NotDone if intersection algorithm fails or is not initialized.
79 //! Standard_OutOfRange if Index is not in the range [ 1,NbPoints ], where
80 //! NbPoints is the number of computed intersection points.
81 Standard_EXPORT void Parameters (const Standard_Integer Index, Standard_Real& U, Standard_Real& V, Standard_Real& W) const;
83 //! Returns the number of computed
84 //! intersection segments in case of tangential intersection.
86 //! StdFail_NotDone if the intersection algorithm fails or is not initialized.
87 Standard_EXPORT Standard_Integer NbSegments() const;
89 //! Returns the computed intersection
90 //! segment of index Index in case of tangential intersection.
91 //! Intersection segment is a portion of the initial curve tangent to surface.
93 //! StdFail_NotDone if intersection algorithm fails or is not initialized.
94 //! Standard_OutOfRange if Index is not in the range [ 1,NbSegments ],
95 //! where NbSegments is the number of computed intersection segments.
96 Standard_EXPORT Handle(Geom_Curve) Segment (const Standard_Integer Index) const;
98 //! Returns the parameters of the first (U1,V1) and the last (U2,V2) points
99 //! of curve's segment on the surface in case of tangential intersection.
100 //! Index is the number of computed intersection segments.
102 //! StdFail_NotDone if intersection algorithm fails or is not initialized.
103 //! Standard_OutOfRange if Index is not in the range [ 1,NbSegments ],
104 //! where NbSegments is the number of computed intersection segments.
105 Standard_EXPORT void Parameters (const Standard_Integer Index, Standard_Real& U1, Standard_Real& V1, Standard_Real& U2, Standard_Real& V2) const;
120 Handle(Geom_Curve) myCurve;
121 IntCurveSurface_HInter myIntCS;
132 #endif // _GeomAPI_IntCS_HeaderFile