0028799: Coding Rules - elimilate confusing Quantity aliases of Standard_Real type
[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 class Geom_Curve;
28 class StdFail_NotDone;
29 class Standard_OutOfRange;
30 class Geom_Surface;
31 class gp_Pnt;
32
33
34 //! This class implements methods for
35 //! computing intersection points and  segments between a
36 class GeomAPI_IntCS 
37 {
38 public:
39
40   DEFINE_STANDARD_ALLOC
41
42   
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();
47   
48   //! Computes the intersections between
49   //! the curve C and the surface S.
50   //! Warning
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);
53   
54   //! This function Initializes an algorithm with the curve C and the
55   //! surface S and computes the intersections between C and S.
56   //! Warning
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);
59   
60   //! Returns true if the intersections are successfully computed.
61   Standard_EXPORT Standard_Boolean IsDone() const;
62   
63   //! Returns the number of Intersection Points
64   //! if IsDone returns True.
65   //! else NotDone is raised.
66   Standard_EXPORT Standard_Integer NbPoints() const;
67   
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;
73   
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.
77   //! Exceptions
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;
82   
83   //! Returns the number of computed
84   //! intersection segments in case of tangential intersection.
85   //! Exceptions
86   //! StdFail_NotDone if the intersection algorithm fails or is not initialized.
87   Standard_EXPORT Standard_Integer NbSegments() const;
88   
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.
92   //! Exceptions
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;
97   
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.
101   //! Exceptions
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;
106
107
108
109
110 protected:
111
112
113
114
115
116 private:
117
118
119
120   Handle(Geom_Curve) myCurve;
121   IntCurveSurface_HInter myIntCS;
122
123
124 };
125
126
127
128
129
130
131
132 #endif // _GeomAPI_IntCS_HeaderFile