Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1992-03-31
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 <Standard_DomainError.hxx>
0018 
0019 //-------------------------------------------------
0020 //-- hasfirst <--> status & 1 
0021 //-- haslast  <--> status & 2 
0022 //-- closed   <--> status & 4 
0023 //-------------------------------------------------
0024 
0025 
0026 inline void IntRes2d_Domain::SetEquivalentParameters
0027         (const Standard_Real p_first,
0028          const Standard_Real p_last)  {
0029   if((status&3)!=3) { throw Standard_DomainError(); }
0030   status|=4;
0031   periodfirst=p_first;
0032   periodlast=p_last;
0033 }
0034 
0035 inline Standard_Boolean IntRes2d_Domain::HasFirstPoint () const {
0036   return (status & 1) ? Standard_True : Standard_False;
0037 }
0038 
0039 inline Standard_Real IntRes2d_Domain::FirstParameter () const {
0040   if(!(status&1)) { throw Standard_DomainError(); }
0041   return(first_param);
0042 }
0043 
0044 inline const gp_Pnt2d& IntRes2d_Domain::FirstPoint () const {
0045   if(!(status&1)) { throw Standard_DomainError(); }
0046   return(first_point);
0047 }
0048 
0049 inline Standard_Real IntRes2d_Domain::FirstTolerance () const {
0050   if(!(status&1)) { throw Standard_DomainError(); }
0051   return(first_tol);
0052 }
0053 
0054 
0055 
0056 inline Standard_Boolean IntRes2d_Domain::HasLastPoint () const {
0057   return (status & 2) ? Standard_True : Standard_False;
0058 }
0059 
0060 inline Standard_Real IntRes2d_Domain::LastParameter () const {
0061   if(!(status&2)) { throw Standard_DomainError(); }
0062   return(last_param);
0063 }
0064 
0065 inline const gp_Pnt2d& IntRes2d_Domain::LastPoint () const {
0066   if(!(status&2)) { throw Standard_DomainError(); }
0067   return(last_point);
0068 }
0069 
0070 inline Standard_Real IntRes2d_Domain::LastTolerance () const {
0071   if(!(status&2)) { throw Standard_DomainError(); }
0072   return(last_tol);
0073 }
0074 
0075 inline Standard_Boolean IntRes2d_Domain::IsClosed () const {
0076   return (status & 4) ? Standard_True : Standard_False;
0077 }
0078 
0079 inline void IntRes2d_Domain::EquivalentParameters(Standard_Real& p_first,
0080                                                   Standard_Real& p_last) const
0081 {
0082   p_first=periodfirst;
0083   p_last=periodlast;
0084 }