Warning, /include/opencascade/IntRes2d_Intersection.lxx is written in an unsupported language. File is not indexed.
0001 // Created on: 1992-05-27
0002 // Created by: Laurent BUCHARD
0003 // Copyright (c) 1992-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016
0017 #include <StdFail_NotDone.hxx>
0018 #include <Standard_OutOfRange.hxx>
0019
0020 inline Standard_Boolean IntRes2d_Intersection::IsDone() const
0021 {
0022 return done;
0023 }
0024
0025 //----------------------------------------------------------------------
0026 inline IntRes2d_Intersection::IntRes2d_Intersection()
0027 {
0028 done = reverse = Standard_False;
0029 }
0030
0031 //----------------------------------------------------------------------
0032 inline IntRes2d_Intersection::IntRes2d_Intersection(const IntRes2d_Intersection& Other)
0033 {
0034 done = reverse = Standard_False;
0035 lpnt = Other.lpnt;
0036 lseg = Other.lseg;
0037 }
0038
0039 //----------------------------------------------------------------------
0040 inline Standard_Boolean IntRes2d_Intersection::IsEmpty() const
0041 {
0042 if (!done)
0043 {
0044 throw StdFail_NotDone();
0045 }
0046 return ((lpnt.Length() == 0) && (lseg.Length() == 0));
0047 }
0048
0049 //----------------------------------------------------------------------
0050 inline Standard_Integer IntRes2d_Intersection::NbPoints() const
0051 {
0052 if (!done)
0053 {
0054 throw StdFail_NotDone();
0055 }
0056 return lpnt.Length();
0057 }
0058
0059 //----------------------------------------------------------------------
0060 inline const IntRes2d_IntersectionPoint& IntRes2d_Intersection::Point(
0061 const Standard_Integer N) const
0062 {
0063 if (!done)
0064 {
0065 throw StdFail_NotDone();
0066 }
0067 return lpnt(N);
0068 }
0069
0070 //----------------------------------------------------------------------
0071 inline Standard_Integer IntRes2d_Intersection::NbSegments() const
0072 {
0073 if (!done)
0074 {
0075 throw StdFail_NotDone();
0076 }
0077 return lseg.Length();
0078 }
0079
0080 //----------------------------------------------------------------------
0081 inline const IntRes2d_IntersectionSegment& IntRes2d_Intersection::Segment(
0082 const Standard_Integer N) const
0083 {
0084 if (!done)
0085 {
0086 throw StdFail_NotDone();
0087 }
0088 return lseg(N);
0089 }
0090
0091 //----------------------------------------------------------------------
0092 inline void IntRes2d_Intersection::Append(const IntRes2d_IntersectionSegment& Seg)
0093 {
0094 lseg.Append(Seg);
0095 }
0096
0097 //----------------------------------------------------------------------
0098 inline void IntRes2d_Intersection::Append(const IntRes2d_IntersectionPoint& Pnt)
0099 {
0100 lpnt.Append(Pnt);
0101 }
0102
0103 //----------------------------------------------------------------------
0104 inline void IntRes2d_Intersection::ResetFields()
0105 {
0106 if (done)
0107 {
0108 lseg.Clear();
0109 lpnt.Clear();
0110 done = Standard_False;
0111 }
0112 }
0113
0114 //----------------------------------------------------------------------
0115 inline void IntRes2d_Intersection::SetReversedParameters(const Standard_Boolean flag)
0116 {
0117 reverse = flag;
0118 }
0119
0120 //----------------------------------------------------------------------
0121 inline Standard_Boolean IntRes2d_Intersection::ReversedParameters() const
0122 {
0123 return (reverse);
0124 }