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 inline void IntRes2d_Domain::SetEquivalentParameters(const double p_first, const double p_last)
0026 {
0027   if ((status & 3) != 3)
0028   {
0029     throw Standard_DomainError();
0030   }
0031   status |= 4;
0032   periodfirst = p_first;
0033   periodlast  = p_last;
0034 }
0035 
0036 inline bool IntRes2d_Domain::HasFirstPoint() const
0037 {
0038   return (status & 1) != 0;
0039 }
0040 
0041 inline double IntRes2d_Domain::FirstParameter() const
0042 {
0043   if (!(status & 1))
0044   {
0045     throw Standard_DomainError();
0046   }
0047   return (first_param);
0048 }
0049 
0050 inline const gp_Pnt2d& IntRes2d_Domain::FirstPoint() const
0051 {
0052   if (!(status & 1))
0053   {
0054     throw Standard_DomainError();
0055   }
0056   return (first_point);
0057 }
0058 
0059 inline double IntRes2d_Domain::FirstTolerance() const
0060 {
0061   if (!(status & 1))
0062   {
0063     throw Standard_DomainError();
0064   }
0065   return (first_tol);
0066 }
0067 
0068 inline bool IntRes2d_Domain::HasLastPoint() const
0069 {
0070   return (status & 2) != 0;
0071 }
0072 
0073 inline double IntRes2d_Domain::LastParameter() const
0074 {
0075   if (!(status & 2))
0076   {
0077     throw Standard_DomainError();
0078   }
0079   return (last_param);
0080 }
0081 
0082 inline const gp_Pnt2d& IntRes2d_Domain::LastPoint() const
0083 {
0084   if (!(status & 2))
0085   {
0086     throw Standard_DomainError();
0087   }
0088   return (last_point);
0089 }
0090 
0091 inline double IntRes2d_Domain::LastTolerance() const
0092 {
0093   if (!(status & 2))
0094   {
0095     throw Standard_DomainError();
0096   }
0097   return (last_tol);
0098 }
0099 
0100 inline bool IntRes2d_Domain::IsClosed() const
0101 {
0102   return (status & 4) != 0;
0103 }
0104 
0105 inline void IntRes2d_Domain::EquivalentParameters(double& p_first, double& p_last) const
0106 {
0107   p_first = periodfirst;
0108   p_last  = periodlast;
0109 }