0023024: Update headers of OCCT files
[occt.git] / src / IntRes2d / IntRes2d_Domain.lxx
1 // Created on: 1992-03-31
2 // Created by: Laurent BUCHARD
3 // Copyright (c) 1992-1999 Matra Datavision
4 // Copyright (c) 1999-2012 OPEN CASCADE SAS
5 //
6 // The content of this file is subject to the Open CASCADE Technology Public
7 // License Version 6.5 (the "License"). You may not use the content of this file
8 // except in compliance with the License. Please obtain a copy of the License
9 // at http://www.opencascade.org and read it completely before using this file.
10 //
11 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 //
14 // The Original Code and all software distributed under the License is
15 // distributed on an "AS IS" basis, without warranty of any kind, and the
16 // Initial Developer hereby disclaims all such warranties, including without
17 // limitation, any warranties of merchantability, fitness for a particular
18 // purpose or non-infringement. Please see the License for the specific terms
19 // and conditions governing the rights and limitations under the License.
20
21
22
23
24 #include <Standard_DomainError.hxx>
25
26 //-------------------------------------------------
27 //-- hasfirst <--> status & 1 
28 //-- haslast  <--> status & 2 
29 //-- closed   <--> status & 4 
30 //-------------------------------------------------
31
32
33 inline void IntRes2d_Domain::SetEquivalentParameters
34         (const Standard_Real p_first,
35          const Standard_Real p_last)  {
36   if((status&3)!=3) { Standard_DomainError::Raise(); }
37   status|=4;
38   periodfirst=p_first;
39   periodlast=p_last;
40 }
41
42 inline Standard_Boolean IntRes2d_Domain::HasFirstPoint () const {
43   return (status & 1) ? Standard_True : Standard_False;
44 }
45
46 inline Standard_Real IntRes2d_Domain::FirstParameter () const {
47   if(!(status&1)) { Standard_DomainError::Raise(); }
48   return(first_param);
49 }
50
51 inline const gp_Pnt2d& IntRes2d_Domain::FirstPoint () const {
52   if(!(status&1)) { Standard_DomainError::Raise(); }
53   return(first_point);
54 }
55
56 inline Standard_Real IntRes2d_Domain::FirstTolerance () const {
57   if(!(status&1)) { Standard_DomainError::Raise(); }
58   return(first_tol);
59 }
60
61
62
63 inline Standard_Boolean IntRes2d_Domain::HasLastPoint () const {
64   return (status & 2) ? Standard_True : Standard_False;
65 }
66
67 inline Standard_Real IntRes2d_Domain::LastParameter () const {
68   if(!(status&2)) { Standard_DomainError::Raise(); }
69   return(last_param);
70 }
71
72 inline const gp_Pnt2d& IntRes2d_Domain::LastPoint () const {
73   if(!(status&2)) { Standard_DomainError::Raise(); }
74   return(last_point);
75 }
76
77 inline Standard_Real IntRes2d_Domain::LastTolerance () const {
78   if(!(status&2)) { Standard_DomainError::Raise(); }
79   return(last_tol);
80 }
81
82 inline Standard_Boolean IntRes2d_Domain::IsClosed () const {
83   return (status & 4) ? Standard_True : Standard_False;
84 }
85
86 inline void IntRes2d_Domain::EquivalentParameters(Standard_Real& p_first,
87                                                   Standard_Real& p_last) const
88 {
89   p_first=periodfirst;
90   p_last=periodlast;
91 }