summaryrefslogtreecommitdiff
path: root/inc/IntRes2d_Intersection.lxx
blob: b3793784893f79e6afd3c718d380b110647c7a0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// File:	IntRes2d_Intersection.lxx
// Created:	Wed May 27 16:17:41 1992
// Author:	Laurent BUCHARD
//		<lbr@topsn3>


#include <StdFail_NotDone.hxx>
#include <Standard_OutOfRange.hxx>


inline Standard_Boolean IntRes2d_Intersection::IsDone() const {
  return done;
}

//----------------------------------------------------------------------
inline IntRes2d_Intersection::IntRes2d_Intersection() {
  done=reverse=Standard_False;
}
//----------------------------------------------------------------------
inline IntRes2d_Intersection::IntRes2d_Intersection(const IntRes2d_Intersection& Other) {
  done=reverse=Standard_False;
  lpnt = Other.lpnt;
  lseg = Other.lseg;
}
//----------------------------------------------------------------------
inline Standard_Boolean IntRes2d_Intersection::IsEmpty() const {
  if (!done) {StdFail_NotDone::Raise();}
  return ((lpnt.Length() == 0) && (lseg.Length() == 0));
}
//----------------------------------------------------------------------
inline Standard_Integer IntRes2d_Intersection::NbPoints() const {
  if (!done) {StdFail_NotDone::Raise();}
  return lpnt.Length();
}
//----------------------------------------------------------------------
inline const IntRes2d_IntersectionPoint&
  IntRes2d_Intersection::Point( const Standard_Integer N) const {
    if (!done) {StdFail_NotDone::Raise();}
    return lpnt(N);
  }
//----------------------------------------------------------------------
inline Standard_Integer IntRes2d_Intersection::NbSegments() const {
  if (!done) {StdFail_NotDone::Raise();}
  return lseg.Length();
}
//----------------------------------------------------------------------
inline const IntRes2d_IntersectionSegment& 
  IntRes2d_Intersection::Segment(const Standard_Integer N) const {
    if (!done) {StdFail_NotDone::Raise();}
    return lseg(N);
  }
//----------------------------------------------------------------------
inline void IntRes2d_Intersection::Append(const IntRes2d_IntersectionSegment& Seg) {
  lseg.Append(Seg);
}
//----------------------------------------------------------------------
inline void IntRes2d_Intersection::Append(const IntRes2d_IntersectionPoint& Pnt) {
  lpnt.Append(Pnt);
}
//----------------------------------------------------------------------
inline void IntRes2d_Intersection::ResetFields() {
  if(done) {
    lseg.Clear();
    lpnt.Clear();
    done=Standard_False;
  }
}
//----------------------------------------------------------------------
inline void IntRes2d_Intersection::SetReversedParameters(const Standard_Boolean flag) {
  reverse=flag;
}
//----------------------------------------------------------------------
inline Standard_Boolean IntRes2d_Intersection::ReversedParameters() const {
  return(reverse);
}