Warnings on vc14 were eliminated
[occt.git] / src / GeomAPI / GeomAPI_IntCS.hxx
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
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _GeomAPI_IntCS_HeaderFile
18 #define _GeomAPI_IntCS_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <IntCurveSurface_HInter.hxx>
25 #include <Standard_Boolean.hxx>
26 #include <Standard_Integer.hxx>
27 #include <Quantity_Parameter.hxx>
28 class Geom_Curve;
29 class StdFail_NotDone;
30 class Standard_OutOfRange;
31 class Geom_Surface;
32 class gp_Pnt;
33
34
35 //! This class implements methods for
36 //! computing intersection points and  segments between a
37 class GeomAPI_IntCS 
38 {
39 public:
40
41   DEFINE_STANDARD_ALLOC
42
43   
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();
48   
49   //! Computes the intersections between
50   //! the curve C and the surface S.
51   //! Warning
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);
54   
55   //! This function Initializes an algorithm with the curve C and the
56   //! surface S and computes the intersections between C and S.
57   //! Warning
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);
60   
61   //! Returns true if the intersections are successfully computed.
62   Standard_EXPORT Standard_Boolean IsDone() const;
63   
64   //! Returns the number of Intersection Points
65   //! if IsDone returns True.
66   //! else NotDone is raised.
67   Standard_EXPORT Standard_Integer NbPoints() const;
68   
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;
74   
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.
78   //! Exceptions
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;
83   
84   //! Returns the number of computed
85   //! intersection segments in case of tangential intersection.
86   //! Exceptions
87   //! StdFail_NotDone if the intersection algorithm fails or is not initialized.
88   Standard_EXPORT Standard_Integer NbSegments() const;
89   
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.
93   //! Exceptions
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;
98   
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.
102   //! Exceptions
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;
107
108
109
110
111 protected:
112
113
114
115
116
117 private:
118
119
120
121   Handle(Geom_Curve) myCurve;
122   IntCurveSurface_HInter myIntCS;
123
124
125 };
126
127
128
129
130
131
132
133 #endif // _GeomAPI_IntCS_HeaderFile