0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[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 class IntRes2d_IntersectionPoint;
28 class IntRes2d_IntersectionSegment;
29
30
31 //! Defines  the root   class  of  all  the  Intersections
32 //! between  two 2D-Curves, and  provides all  the methods
33 //! about the results of the Intersections Algorithms.
34 class IntRes2d_Intersection 
35 {
36 public:
37
38   DEFINE_STANDARD_ALLOC
39
40   
41   //! returns TRUE when the computation was successful.
42     Standard_Boolean IsDone() const;
43   
44   //! Returns TRUE if there is no intersection between the
45   //! given arguments.
46   //! The exception NotDone is raised if IsDone returns FALSE.
47     Standard_Boolean IsEmpty() const;
48   
49   //! This function returns the number of intersection
50   //! points between the 2 curves.
51   //! The exception NotDone is raised if IsDone returns FALSE.
52     Standard_Integer NbPoints() const;
53   
54   //! This function returns the intersection point
55   //! of range N;
56   //! The exception NotDone is raised if IsDone returns FALSE.
57   //! The exception OutOfRange is raised if (N <= 0)
58   //! or (N > NbPoints).
59     const IntRes2d_IntersectionPoint& Point (const Standard_Integer N) const;
60   
61   //! This function returns the number of intersection
62   //! segments between the two curves.
63   //! The exception NotDone is raised if IsDone returns FALSE.
64     Standard_Integer NbSegments() const;
65   
66   //! This function returns the intersection segment
67   //! of range N;
68   //! The exception NotDone is raised if IsDone returns FALSE.
69   //! The exception OutOfRange is raised if (N <= 0)
70   //! or (N > NbPoints).
71     const IntRes2d_IntersectionSegment& Segment (const Standard_Integer N) const;
72   
73     void SetReversedParameters (const Standard_Boolean Reverseflag);
74
75
76
77
78 protected:
79
80   
81   //! Empty constructor.
82     IntRes2d_Intersection();
83   
84     IntRes2d_Intersection(const IntRes2d_Intersection& Other);
85
86     //! Assignment
87     IntRes2d_Intersection& operator= (const IntRes2d_Intersection& theOther)
88     {
89       done = theOther.done;
90       reverse = theOther.reverse;
91       lpnt = theOther.lpnt;
92       lseg = theOther.lseg;
93       return *this;
94     }
95
96   //! Destructor is protected, for safe inheritance
97   ~IntRes2d_Intersection () {}
98   
99   Standard_EXPORT void SetValues (const IntRes2d_Intersection& Inter);
100   
101   Standard_EXPORT void Append (const IntRes2d_Intersection& Inter, const Standard_Real FirstParam1, const Standard_Real LastParam1, const Standard_Real FirstParam2, const Standard_Real LastParam2);
102   
103     void Append (const IntRes2d_IntersectionSegment& Seg);
104   
105     void Append (const IntRes2d_IntersectionPoint& Pnt);
106   
107   Standard_EXPORT void Insert (const IntRes2d_IntersectionPoint& Pnt);
108   
109     void ResetFields();
110   
111     Standard_Boolean ReversedParameters() const;
112
113 protected:
114
115   IntRes2d_SequenceOfIntersectionPoint lpnt;
116   IntRes2d_SequenceOfIntersectionSegment lseg;
117   Standard_Boolean done;
118   Standard_Boolean reverse;
119
120 };
121
122
123 #include <IntRes2d_Intersection.lxx>
124
125
126
127
128
129 #endif // _IntRes2d_Intersection_HeaderFile