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