441006294b4a17fc031fe76fd97c132feae9064f
[occt.git] / src / IntRes2d / IntRes2d_Intersection.hxx
1 // Created on: 1992-04-27
2 // Created by: Laurent BUCHARD
3 // Copyright (c) 1992-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 _IntRes2d_Intersection_HeaderFile
18 #define _IntRes2d_Intersection_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <Standard_Boolean.hxx>
25 #include <IntRes2d_SequenceOfIntersectionPoint.hxx>
26 #include <IntRes2d_SequenceOfIntersectionSegment.hxx>
27 #include <Standard_Integer.hxx>
28 #include <Standard_Real.hxx>
29 class StdFail_NotDone;
30 class Standard_OutOfRange;
31 class IntRes2d_IntersectionPoint;
32 class IntRes2d_IntersectionSegment;
33
34
35 //! Defines  the root   class  of  all  the  Intersections
36 //! between  two 2D-Curves, and  provides all  the methods
37 //! about the results of the Intersections Algorithms.
38 class IntRes2d_Intersection 
39 {
40 public:
41
42   DEFINE_STANDARD_ALLOC
43
44   
45   //! returns TRUE when the computation was successful.
46     Standard_Boolean IsDone() const;
47   
48   //! Returns TRUE if there is no intersection between the
49   //! given arguments.
50   //! The exception NotDone is raised if IsDone returns FALSE.
51     Standard_Boolean IsEmpty() const;
52   
53   //! This function returns the number of intersection
54   //! points between the 2 curves.
55   //! The exception NotDone is raised if IsDone returns FALSE.
56     Standard_Integer NbPoints() const;
57   
58   //! This function returns the intersection point
59   //! of range N;
60   //! The exception NotDone is raised if IsDone returns FALSE.
61   //! The exception OutOfRange is raised if (N <= 0)
62   //! or (N > NbPoints).
63     const IntRes2d_IntersectionPoint& Point (const Standard_Integer N) const;
64   
65   //! This function returns the number of intersection
66   //! segments between the two curves.
67   //! The exception NotDone is raised if IsDone returns FALSE.
68     Standard_Integer NbSegments() const;
69   
70   //! This function returns the intersection segment
71   //! of range N;
72   //! The exception NotDone is raised if IsDone returns FALSE.
73   //! The exception OutOfRange is raised if (N <= 0)
74   //! or (N > NbPoints).
75     const IntRes2d_IntersectionSegment& Segment (const Standard_Integer N) const;
76   
77     void SetReversedParameters (const Standard_Boolean Reverseflag);
78
79
80
81
82 protected:
83
84   
85   //! Empty constructor.
86     IntRes2d_Intersection();
87   
88     IntRes2d_Intersection(const IntRes2d_Intersection& Other);
89   
90   Standard_EXPORT void SetValues (const IntRes2d_Intersection& Inter);
91   
92   Standard_EXPORT void Append (const IntRes2d_Intersection& Inter, const Standard_Real FirstParam1, const Standard_Real LastParam1, const Standard_Real FirstParam2, const Standard_Real LastParam2);
93   
94     void Append (const IntRes2d_IntersectionSegment& Seg);
95   
96     void Append (const IntRes2d_IntersectionPoint& Pnt);
97   
98   Standard_EXPORT void Insert (const IntRes2d_IntersectionPoint& Pnt);
99   
100     void ResetFields();
101   
102     Standard_Boolean ReversedParameters() const;
103
104
105   Standard_Boolean done;
106
107
108 private:
109
110
111
112   Standard_Boolean reverse;
113   IntRes2d_SequenceOfIntersectionPoint lpnt;
114   IntRes2d_SequenceOfIntersectionSegment lseg;
115
116
117 };
118
119
120 #include <IntRes2d_Intersection.lxx>
121
122
123
124
125
126 #endif // _IntRes2d_Intersection_HeaderFile