b311480e |
1 | // Created on: 1992-05-27 |
2 | // Created by: Laurent BUCHARD |
3 | // Copyright (c) 1992-1999 Matra Datavision |
4 | // Copyright (c) 1999-2012 OPEN CASCADE SAS |
5 | // |
6 | // The content of this file is subject to the Open CASCADE Technology Public |
7 | // License Version 6.5 (the "License"). You may not use the content of this file |
8 | // except in compliance with the License. Please obtain a copy of the License |
9 | // at http://www.opencascade.org and read it completely before using this file. |
10 | // |
11 | // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
12 | // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
13 | // |
14 | // The Original Code and all software distributed under the License is |
15 | // distributed on an "AS IS" basis, without warranty of any kind, and the |
16 | // Initial Developer hereby disclaims all such warranties, including without |
17 | // limitation, any warranties of merchantability, fitness for a particular |
18 | // purpose or non-infringement. Please see the License for the specific terms |
19 | // and conditions governing the rights and limitations under the License. |
20 | |
7fd59977 |
21 | |
22 | |
23 | #include <StdFail_NotDone.hxx> |
24 | #include <Standard_OutOfRange.hxx> |
25 | |
26 | |
27 | inline Standard_Boolean IntRes2d_Intersection::IsDone() const { |
28 | return done; |
29 | } |
30 | |
31 | //---------------------------------------------------------------------- |
32 | inline IntRes2d_Intersection::IntRes2d_Intersection() { |
33 | done=reverse=Standard_False; |
34 | } |
35 | //---------------------------------------------------------------------- |
36 | inline IntRes2d_Intersection::IntRes2d_Intersection(const IntRes2d_Intersection& Other) { |
37 | done=reverse=Standard_False; |
38 | lpnt = Other.lpnt; |
39 | lseg = Other.lseg; |
40 | } |
41 | //---------------------------------------------------------------------- |
42 | inline Standard_Boolean IntRes2d_Intersection::IsEmpty() const { |
43 | if (!done) {StdFail_NotDone::Raise();} |
44 | return ((lpnt.Length() == 0) && (lseg.Length() == 0)); |
45 | } |
46 | //---------------------------------------------------------------------- |
47 | inline Standard_Integer IntRes2d_Intersection::NbPoints() const { |
48 | if (!done) {StdFail_NotDone::Raise();} |
49 | return lpnt.Length(); |
50 | } |
51 | //---------------------------------------------------------------------- |
52 | inline const IntRes2d_IntersectionPoint& |
53 | IntRes2d_Intersection::Point( const Standard_Integer N) const { |
54 | if (!done) {StdFail_NotDone::Raise();} |
55 | return lpnt(N); |
56 | } |
57 | //---------------------------------------------------------------------- |
58 | inline Standard_Integer IntRes2d_Intersection::NbSegments() const { |
59 | if (!done) {StdFail_NotDone::Raise();} |
60 | return lseg.Length(); |
61 | } |
62 | //---------------------------------------------------------------------- |
63 | inline const IntRes2d_IntersectionSegment& |
64 | IntRes2d_Intersection::Segment(const Standard_Integer N) const { |
65 | if (!done) {StdFail_NotDone::Raise();} |
66 | return lseg(N); |
67 | } |
68 | //---------------------------------------------------------------------- |
69 | inline void IntRes2d_Intersection::Append(const IntRes2d_IntersectionSegment& Seg) { |
70 | lseg.Append(Seg); |
71 | } |
72 | //---------------------------------------------------------------------- |
73 | inline void IntRes2d_Intersection::Append(const IntRes2d_IntersectionPoint& Pnt) { |
74 | lpnt.Append(Pnt); |
75 | } |
76 | //---------------------------------------------------------------------- |
77 | inline void IntRes2d_Intersection::ResetFields() { |
78 | if(done) { |
79 | lseg.Clear(); |
80 | lpnt.Clear(); |
81 | done=Standard_False; |
82 | } |
83 | } |
84 | //---------------------------------------------------------------------- |
85 | inline void IntRes2d_Intersection::SetReversedParameters(const Standard_Boolean flag) { |
86 | reverse=flag; |
87 | } |
88 | //---------------------------------------------------------------------- |
89 | inline Standard_Boolean IntRes2d_Intersection::ReversedParameters() const { |
90 | return(reverse); |
91 | } |