0026377: Passing Handle objects as arguments to functions as non-const reference...
[occt.git] / src / IntRes2d / IntRes2d_IntersectionSegment.hxx
1 // Created on: 1992-04-03
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_IntersectionSegment_HeaderFile
18 #define _IntRes2d_IntersectionSegment_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_IntersectionPoint.hxx>
26 class Standard_DomainError;
27 class IntRes2d_IntersectionPoint;
28
29
30 //! Definition of an intersection curve between
31 //! two 2D curves.
32 class IntRes2d_IntersectionSegment 
33 {
34 public:
35
36   DEFINE_STANDARD_ALLOC
37
38   
39   //! Empty constructor.
40   Standard_EXPORT IntRes2d_IntersectionSegment();
41   
42     IntRes2d_IntersectionSegment(const IntRes2d_IntersectionPoint& P1, const IntRes2d_IntersectionPoint& P2, const Standard_Boolean Oppos, const Standard_Boolean ReverseFlag);
43   
44     IntRes2d_IntersectionSegment(const IntRes2d_IntersectionPoint& P, const Standard_Boolean First, const Standard_Boolean Oppos, const Standard_Boolean ReverseFlag);
45   
46   //! Creates an infinite segment of intersection.
47     IntRes2d_IntersectionSegment(const Standard_Boolean Oppos);
48   
49   //! Returns FALSE if the intersection segment has got
50   //! the same orientation on both curves.
51     Standard_Boolean IsOpposite() const;
52   
53   //! Returns True if the segment is  limited by a first
54   //! point.   This  point defines  the lowest parameter
55   //! admitted on the first  curve for the  segment.  If
56   //! IsOpposite  returns  False, it  defines the lowest
57   //! parameter on the  second curve, otherwise,  it  is
58   //! the highest parameter on the second curve.
59     Standard_Boolean HasFirstPoint() const;
60   
61   //! Returns the  first point   of the segment    as an
62   //! IntersectionPoint (with    a    transition).   The
63   //! exception  DomainError  is raised if HasFirstPoint
64   //! returns False.
65     const IntRes2d_IntersectionPoint& FirstPoint() const;
66   
67   //! Returns True if the segment  is  limited by a last
68   //! point.  This point  defines  the highest parameter
69   //! admitted on the  first curve for  the segment.  If
70   //! IsOpposite returns  False, it  defines the highest
71   //! parameter on  the  second curve, otherwise, it  is
72   //! the lowest parameter on the second curve.
73     Standard_Boolean HasLastPoint() const;
74   
75   //! Returns   the  last point  of the    segment as an
76   //! IntersectionPoint   (with  a    transition).   The
77   //! exception        DomainError     is   raised    if
78   //! HasLastExtremity returns False.
79     const IntRes2d_IntersectionPoint& LastPoint() const;
80
81
82
83
84 protected:
85
86
87
88
89
90 private:
91
92
93
94   Standard_Boolean oppos;
95   Standard_Boolean first;
96   Standard_Boolean last;
97   IntRes2d_IntersectionPoint ptfirst;
98   IntRes2d_IntersectionPoint ptlast;
99
100
101 };
102
103
104 #include <IntRes2d_IntersectionSegment.lxx>
105
106
107
108
109
110 #endif // _IntRes2d_IntersectionSegment_HeaderFile