7fd59977 |
1 | // File: IntRes2d_Intersection.lxx |
2 | // Created: Wed May 27 16:17:41 1992 |
3 | // Author: Laurent BUCHARD |
4 | // <lbr@topsn3> |
5 | |
6 | |
7 | #include <StdFail_NotDone.hxx> |
8 | #include <Standard_OutOfRange.hxx> |
9 | |
10 | |
11 | inline Standard_Boolean IntRes2d_Intersection::IsDone() const { |
12 | return done; |
13 | } |
14 | |
15 | //---------------------------------------------------------------------- |
16 | inline IntRes2d_Intersection::IntRes2d_Intersection() { |
17 | done=reverse=Standard_False; |
18 | } |
19 | //---------------------------------------------------------------------- |
20 | inline IntRes2d_Intersection::IntRes2d_Intersection(const IntRes2d_Intersection& Other) { |
21 | done=reverse=Standard_False; |
22 | lpnt = Other.lpnt; |
23 | lseg = Other.lseg; |
24 | } |
25 | //---------------------------------------------------------------------- |
26 | inline Standard_Boolean IntRes2d_Intersection::IsEmpty() const { |
27 | if (!done) {StdFail_NotDone::Raise();} |
28 | return ((lpnt.Length() == 0) && (lseg.Length() == 0)); |
29 | } |
30 | //---------------------------------------------------------------------- |
31 | inline Standard_Integer IntRes2d_Intersection::NbPoints() const { |
32 | if (!done) {StdFail_NotDone::Raise();} |
33 | return lpnt.Length(); |
34 | } |
35 | //---------------------------------------------------------------------- |
36 | inline const IntRes2d_IntersectionPoint& |
37 | IntRes2d_Intersection::Point( const Standard_Integer N) const { |
38 | if (!done) {StdFail_NotDone::Raise();} |
39 | return lpnt(N); |
40 | } |
41 | //---------------------------------------------------------------------- |
42 | inline Standard_Integer IntRes2d_Intersection::NbSegments() const { |
43 | if (!done) {StdFail_NotDone::Raise();} |
44 | return lseg.Length(); |
45 | } |
46 | //---------------------------------------------------------------------- |
47 | inline const IntRes2d_IntersectionSegment& |
48 | IntRes2d_Intersection::Segment(const Standard_Integer N) const { |
49 | if (!done) {StdFail_NotDone::Raise();} |
50 | return lseg(N); |
51 | } |
52 | //---------------------------------------------------------------------- |
53 | inline void IntRes2d_Intersection::Append(const IntRes2d_IntersectionSegment& Seg) { |
54 | lseg.Append(Seg); |
55 | } |
56 | //---------------------------------------------------------------------- |
57 | inline void IntRes2d_Intersection::Append(const IntRes2d_IntersectionPoint& Pnt) { |
58 | lpnt.Append(Pnt); |
59 | } |
60 | //---------------------------------------------------------------------- |
61 | inline void IntRes2d_Intersection::ResetFields() { |
62 | if(done) { |
63 | lseg.Clear(); |
64 | lpnt.Clear(); |
65 | done=Standard_False; |
66 | } |
67 | } |
68 | //---------------------------------------------------------------------- |
69 | inline void IntRes2d_Intersection::SetReversedParameters(const Standard_Boolean flag) { |
70 | reverse=flag; |
71 | } |
72 | //---------------------------------------------------------------------- |
73 | inline Standard_Boolean IntRes2d_Intersection::ReversedParameters() const { |
74 | return(reverse); |
75 | } |