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
0021 inline Standard_Boolean IntRes2d_Intersection::IsDone() const {
0022 return done;
0023 }
0024
0025 //----------------------------------------------------------------------
0026 inline IntRes2d_Intersection::IntRes2d_Intersection() {
0027 done=reverse=Standard_False;
0028 }
0029 //----------------------------------------------------------------------
0030 inline IntRes2d_Intersection::IntRes2d_Intersection(const IntRes2d_Intersection& Other) {
0031 done=reverse=Standard_False;
0032 lpnt = Other.lpnt;
0033 lseg = Other.lseg;
0034 }
0035 //----------------------------------------------------------------------
0036 inline Standard_Boolean IntRes2d_Intersection::IsEmpty() const {
0037 if (!done) {throw StdFail_NotDone();}
0038 return ((lpnt.Length() == 0) && (lseg.Length() == 0));
0039 }
0040 //----------------------------------------------------------------------
0041 inline Standard_Integer IntRes2d_Intersection::NbPoints() const {
0042 if (!done) {throw StdFail_NotDone();}
0043 return lpnt.Length();
0044 }
0045 //----------------------------------------------------------------------
0046 inline const IntRes2d_IntersectionPoint&
0047 IntRes2d_Intersection::Point( const Standard_Integer N) const {
0048 if (!done) {throw StdFail_NotDone();}
0049 return lpnt(N);
0050 }
0051 //----------------------------------------------------------------------
0052 inline Standard_Integer IntRes2d_Intersection::NbSegments() const {
0053 if (!done) {throw StdFail_NotDone();}
0054 return lseg.Length();
0055 }
0056 //----------------------------------------------------------------------
0057 inline const IntRes2d_IntersectionSegment&
0058 IntRes2d_Intersection::Segment(const Standard_Integer N) const {
0059 if (!done) {throw StdFail_NotDone();}
0060 return lseg(N);
0061 }
0062 //----------------------------------------------------------------------
0063 inline void IntRes2d_Intersection::Append(const IntRes2d_IntersectionSegment& Seg) {
0064 lseg.Append(Seg);
0065 }
0066 //----------------------------------------------------------------------
0067 inline void IntRes2d_Intersection::Append(const IntRes2d_IntersectionPoint& Pnt) {
0068 lpnt.Append(Pnt);
0069 }
0070 //----------------------------------------------------------------------
0071 inline void IntRes2d_Intersection::ResetFields() {
0072 if(done) {
0073 lseg.Clear();
0074 lpnt.Clear();
0075 done=Standard_False;
0076 }
0077 }
0078 //----------------------------------------------------------------------
0079 inline void IntRes2d_Intersection::SetReversedParameters(const Standard_Boolean flag) {
0080 reverse=flag;
0081 }
0082 //----------------------------------------------------------------------
0083 inline Standard_Boolean IntRes2d_Intersection::ReversedParameters() const {
0084 return(reverse);
0085 }