0024428: Implementation of LGPL license
[occt.git] / src / IntRes2d / IntRes2d_Intersection.lxx
CommitLineData
b311480e 1// Created on: 1992-05-27
2// Created by: Laurent BUCHARD
3// Copyright (c) 1992-1999 Matra Datavision
973c2be1 4// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 5//
973c2be1 6// This file is part of Open CASCADE Technology software library.
b311480e 7//
973c2be1 8// This library is free software; you can redistribute it and / or modify it
9// under the terms of the GNU Lesser General Public 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.
b311480e 13//
973c2be1 14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
7fd59977 16
17#include <StdFail_NotDone.hxx>
18#include <Standard_OutOfRange.hxx>
19
20
21inline Standard_Boolean IntRes2d_Intersection::IsDone() const {
22 return done;
23}
24
25//----------------------------------------------------------------------
26inline IntRes2d_Intersection::IntRes2d_Intersection() {
27 done=reverse=Standard_False;
28}
29//----------------------------------------------------------------------
30inline IntRes2d_Intersection::IntRes2d_Intersection(const IntRes2d_Intersection& Other) {
31 done=reverse=Standard_False;
32 lpnt = Other.lpnt;
33 lseg = Other.lseg;
34}
35//----------------------------------------------------------------------
36inline Standard_Boolean IntRes2d_Intersection::IsEmpty() const {
37 if (!done) {StdFail_NotDone::Raise();}
38 return ((lpnt.Length() == 0) && (lseg.Length() == 0));
39}
40//----------------------------------------------------------------------
41inline Standard_Integer IntRes2d_Intersection::NbPoints() const {
42 if (!done) {StdFail_NotDone::Raise();}
43 return lpnt.Length();
44}
45//----------------------------------------------------------------------
46inline const IntRes2d_IntersectionPoint&
47 IntRes2d_Intersection::Point( const Standard_Integer N) const {
48 if (!done) {StdFail_NotDone::Raise();}
49 return lpnt(N);
50 }
51//----------------------------------------------------------------------
52inline Standard_Integer IntRes2d_Intersection::NbSegments() const {
53 if (!done) {StdFail_NotDone::Raise();}
54 return lseg.Length();
55}
56//----------------------------------------------------------------------
57inline const IntRes2d_IntersectionSegment&
58 IntRes2d_Intersection::Segment(const Standard_Integer N) const {
59 if (!done) {StdFail_NotDone::Raise();}
60 return lseg(N);
61 }
62//----------------------------------------------------------------------
63inline void IntRes2d_Intersection::Append(const IntRes2d_IntersectionSegment& Seg) {
64 lseg.Append(Seg);
65}
66//----------------------------------------------------------------------
67inline void IntRes2d_Intersection::Append(const IntRes2d_IntersectionPoint& Pnt) {
68 lpnt.Append(Pnt);
69}
70//----------------------------------------------------------------------
71inline void IntRes2d_Intersection::ResetFields() {
72 if(done) {
73 lseg.Clear();
74 lpnt.Clear();
75 done=Standard_False;
76 }
77}
78//----------------------------------------------------------------------
79inline void IntRes2d_Intersection::SetReversedParameters(const Standard_Boolean flag) {
80 reverse=flag;
81}
82//----------------------------------------------------------------------
83inline Standard_Boolean IntRes2d_Intersection::ReversedParameters() const {
84 return(reverse);
85}