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
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 _IntRes2d_Intersection_HeaderFile
18 #define _IntRes2d_Intersection_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
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;
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
45 //! returns TRUE when the computation was successful.
46 Standard_Boolean IsDone() const;
48 //! Returns TRUE if there is no intersection between the
50 //! The exception NotDone is raised if IsDone returns FALSE.
51 Standard_Boolean IsEmpty() const;
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;
58 //! This function returns the intersection point
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;
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;
70 //! This function returns the intersection segment
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;
77 void SetReversedParameters (const Standard_Boolean Reverseflag);
85 //! Empty constructor.
86 IntRes2d_Intersection();
88 IntRes2d_Intersection(const IntRes2d_Intersection& Other);
90 //! Destructor is protected, for safe inheritance
91 ~IntRes2d_Intersection () {}
93 Standard_EXPORT void SetValues (const IntRes2d_Intersection& Inter);
95 Standard_EXPORT void Append (const IntRes2d_Intersection& Inter, const Standard_Real FirstParam1, const Standard_Real LastParam1, const Standard_Real FirstParam2, const Standard_Real LastParam2);
97 void Append (const IntRes2d_IntersectionSegment& Seg);
99 void Append (const IntRes2d_IntersectionPoint& Pnt);
101 Standard_EXPORT void Insert (const IntRes2d_IntersectionPoint& Pnt);
105 Standard_Boolean ReversedParameters() const;
108 Standard_Boolean done;
115 Standard_Boolean reverse;
116 IntRes2d_SequenceOfIntersectionPoint lpnt;
117 IntRes2d_SequenceOfIntersectionSegment lseg;
123 #include <IntRes2d_Intersection.lxx>
129 #endif // _IntRes2d_Intersection_HeaderFile