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>
27 #include <Quantity_Parameter.hxx>
29 class StdFail_NotDone;
30 class Standard_OutOfRange;
35 //! This class implements methods for
36 //! computing intersection points and segments between a
44 //! Creates an empty object. Use the
45 //! function Perform for further initialization of the algorithm by
46 //! the curve and the surface.
47 Standard_EXPORT GeomAPI_IntCS();
49 //! Computes the intersections between
50 //! the curve C and the surface S.
52 //! Use function IsDone to verify that the intersections are computed successfully.
53 Standard_EXPORT GeomAPI_IntCS(const Handle(Geom_Curve)& C, const Handle(Geom_Surface)& S);
55 //! This function Initializes an algorithm with the curve C and the
56 //! surface S and computes the intersections between C and S.
58 //! Use function IsDone to verify that the intersections are computed successfully.
59 Standard_EXPORT void Perform (const Handle(Geom_Curve)& C, const Handle(Geom_Surface)& S);
61 //! Returns true if the intersections are successfully computed.
62 Standard_EXPORT Standard_Boolean IsDone() const;
64 //! Returns the number of Intersection Points
65 //! if IsDone returns True.
66 //! else NotDone is raised.
67 Standard_EXPORT Standard_Integer NbPoints() const;
69 //! Returns the Intersection Point of range <Index>in case of cross intersection.
70 //! Raises NotDone if the computation has failed or if
71 //! the computation has not been done
72 //! raises OutOfRange if Index is not in the range <1..NbPoints>
73 Standard_EXPORT const gp_Pnt& Point (const Standard_Integer Index) const;
75 //! Returns parameter W on the curve
76 //! and (parameters U,V) on the surface of the computed intersection point
77 //! of index Index in case of cross intersection.
79 //! StdFail_NotDone if intersection algorithm fails or is not initialized.
80 //! Standard_OutOfRange if Index is not in the range [ 1,NbPoints ], where
81 //! NbPoints is the number of computed intersection points.
82 Standard_EXPORT void Parameters (const Standard_Integer Index, Quantity_Parameter& U, Quantity_Parameter& V, Quantity_Parameter& W) const;
84 //! Returns the number of computed
85 //! intersection segments in case of tangential intersection.
87 //! StdFail_NotDone if the intersection algorithm fails or is not initialized.
88 Standard_EXPORT Standard_Integer NbSegments() const;
90 //! Returns the computed intersection
91 //! segment of index Index in case of tangential intersection.
92 //! Intersection segment is a portion of the initial curve tangent to surface.
94 //! StdFail_NotDone if intersection algorithm fails or is not initialized.
95 //! Standard_OutOfRange if Index is not in the range [ 1,NbSegments ],
96 //! where NbSegments is the number of computed intersection segments.
97 Standard_EXPORT Handle(Geom_Curve) Segment (const Standard_Integer Index) const;
99 //! Returns the parameters of the first (U1,V1) and the last (U2,V2) points
100 //! of curve's segment on the surface in case of tangential intersection.
101 //! Index is the number of computed intersection segments.
103 //! StdFail_NotDone if intersection algorithm fails or is not initialized.
104 //! Standard_OutOfRange if Index is not in the range [ 1,NbSegments ],
105 //! where NbSegments is the number of computed intersection segments.
106 Standard_EXPORT void Parameters (const Standard_Integer Index, Quantity_Parameter& U1, Quantity_Parameter& V1, Quantity_Parameter& U2, Quantity_Parameter& V2) const;
121 Handle(Geom_Curve) myCurve;
122 IntCurveSurface_HInter myIntCS;
133 #endif // _GeomAPI_IntCS_HeaderFile