Back to home page

EIC code displayed by LXR

 
 

    


Warning, /include/opencascade/IntRes2d_IntersectionSegment.lxx is written in an unsupported language. File is not indexed.

0001 // Copyright (c) 1995-1999 Matra Datavision
0002 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0003 //
0004 // This file is part of Open CASCADE Technology software library.
0005 //
0006 // This library is free software; you can redistribute it and/or modify it under
0007 // the terms of the GNU Lesser General Public License version 2.1 as published
0008 // by the Free Software Foundation, with special exception defined in the file
0009 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0010 // distribution for complete text of the license and disclaimer of any warranty.
0011 //
0012 // Alternatively, this file may be used under the terms of Open CASCADE
0013 // commercial license or contractual agreement.
0014 
0015 #include <Standard_DomainError.hxx>
0016 
0017 inline IntRes2d_IntersectionSegment::IntRes2d_IntersectionSegment (
0018          const IntRes2d_IntersectionPoint& P1, 
0019          const IntRes2d_IntersectionPoint& P2,
0020          const Standard_Boolean Oppos,
0021          const Standard_Boolean ReverseFlag):
0022 
0023   oppos(Oppos),
0024   first(Standard_True),
0025   last(Standard_True),
0026   ptfirst(P1),
0027   ptlast(P2)
0028 { 
0029   if(ReverseFlag) {
0030     if(Oppos) {
0031       ptfirst= P2;
0032       ptlast = P1;
0033     }
0034   }
0035 }
0036 
0037 inline IntRes2d_IntersectionSegment::IntRes2d_IntersectionSegment (
0038          const IntRes2d_IntersectionPoint& P, 
0039          const Standard_Boolean First,
0040          const Standard_Boolean Oppos,
0041          const Standard_Boolean ReverseFlag):
0042 
0043   oppos(Oppos),
0044   ptfirst(),
0045   ptlast()
0046     {
0047       if(ReverseFlag && Oppos) {
0048         if (First) {
0049           first=Standard_False; last=Standard_True; ptlast=P;
0050         }
0051         else {
0052           first=Standard_True; last=Standard_False; ptfirst=P;
0053         }
0054       }
0055       else {
0056         if (First) {
0057           first=Standard_True; last=Standard_False; ptfirst=P;
0058         }
0059         else {
0060           first=Standard_False; last=Standard_True; ptlast=P;
0061         }
0062       }
0063     }
0064 
0065 inline IntRes2d_IntersectionSegment::IntRes2d_IntersectionSegment (
0066                                             const Standard_Boolean Oppos):
0067   oppos(Oppos),
0068   first(Standard_False),
0069   last(Standard_False),
0070   ptfirst(),
0071   ptlast()
0072 { }
0073 
0074 inline Standard_Boolean IntRes2d_IntersectionSegment::IsOpposite () const {
0075   return oppos;
0076 }
0077 
0078 inline Standard_Boolean IntRes2d_IntersectionSegment::HasFirstPoint () const {
0079   return first; 
0080 }
0081 
0082 inline Standard_Boolean IntRes2d_IntersectionSegment::HasLastPoint () const {
0083   return last;
0084 }
0085 
0086 inline const IntRes2d_IntersectionPoint& 
0087         IntRes2d_IntersectionSegment::FirstPoint () const {
0088 
0089   if (!first) { throw Standard_DomainError(); }
0090   return ptfirst;
0091 }
0092 
0093 
0094 inline const IntRes2d_IntersectionPoint&
0095         IntRes2d_IntersectionSegment::LastPoint () const {
0096 
0097   if (!last) { throw Standard_DomainError();}
0098   return ptlast;
0099 }
0100 
0101