0023024: Update headers of OCCT files
[occt.git] / src / GeomAdaptor / GeomAdaptor_Surface.lxx
1 // Created on: 1993-05-18
2 // Created by: Bruno DUMORTIER
3 // Copyright (c) 1993-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 #include <Geom_Surface.hxx>
23 #include <Standard_NullObject.hxx>
24 #include <Standard_ConstructionError.hxx>
25
26 //=======================================================================
27 //function : GeomAdaptor_Surface
28 //purpose  : 
29 //=======================================================================
30
31 inline GeomAdaptor_Surface::GeomAdaptor_Surface()
32  : mySurfaceType(GeomAbs_OtherSurface), 
33    myUFirst(0.),
34    myULast(0.),
35    myVFirst(0.),
36    myVLast (0.),
37    myTolU(0.), 
38    myTolV(0.)
39 {
40
41
42 //=======================================================================
43 //function : GeomAdaptor_Surface
44 //purpose  : 
45 //=======================================================================
46
47 inline GeomAdaptor_Surface::GeomAdaptor_Surface(const Handle(Geom_Surface)& S)
48  : myTolU(0.), myTolV(0.)
49 {
50   Load(S);
51 }
52
53 //=======================================================================
54 //function : GeomAdaptor_Surface
55 //purpose  : 
56 //=======================================================================
57
58 inline GeomAdaptor_Surface::GeomAdaptor_Surface(const Handle(Geom_Surface)& S,
59                                                 const Standard_Real UFirst,
60                                                 const Standard_Real ULast,
61                                                 const Standard_Real VFirst,
62                                                 const Standard_Real VLast,
63                                                 const Standard_Real TolU,
64                                                 const Standard_Real TolV)
65 {
66   Load(S,UFirst,ULast,VFirst,VLast,TolU,TolV);
67 }
68
69 //=======================================================================
70 //function : Load
71 //purpose  : 
72 //=======================================================================
73
74 inline void GeomAdaptor_Surface::Load(const Handle(Geom_Surface)& S)
75 {
76   if ( S.IsNull()) Standard_NullObject::Raise("GeomAdaptor_Surface::Load");
77
78   Standard_Real U1,U2,V1,V2;
79   S->Bounds(U1,U2,V1,V2);
80   load(S,U1,U2,V1,V2);
81 }
82
83 //=======================================================================
84 //function : Load
85 //purpose  : 
86 //=======================================================================
87
88 inline void GeomAdaptor_Surface::Load(const Handle(Geom_Surface)& S,
89                                const Standard_Real UFirst,
90                                const Standard_Real ULast,
91                                const Standard_Real VFirst,
92                                const Standard_Real VLast,
93                                const Standard_Real TolU,
94                                const Standard_Real TolV)
95 {
96   if ( S.IsNull()) Standard_NullObject::Raise("GeomAdaptor_Surface::Load");
97
98   if(UFirst>ULast || VFirst>VLast)
99     Standard_ConstructionError::Raise("GeomAdaptor_Surface::Load");
100
101   load(S,UFirst,ULast,VFirst,VLast,TolU,TolV);
102 }
103
104
105 //=======================================================================
106 //function : Surface
107 //purpose  : 
108 //=======================================================================
109
110 inline const Handle(Geom_Surface)& GeomAdaptor_Surface::Surface() const {
111   return mySurface;
112 }
113
114 //=======================================================================
115 //function : FirstUParameter
116 //purpose  : 
117 //=======================================================================
118
119 inline Standard_Real GeomAdaptor_Surface::FirstUParameter() const {
120   return myUFirst;
121 }
122
123 //=======================================================================
124 //function : LastUParameter
125 //purpose  : 
126 //=======================================================================
127
128 inline Standard_Real GeomAdaptor_Surface::LastUParameter() const {
129   return myULast;
130 }
131
132 //=======================================================================
133 //function : FirstVParameter
134 //purpose  : 
135 //=======================================================================
136
137 inline Standard_Real GeomAdaptor_Surface::FirstVParameter() const {
138   return myVFirst;
139 }
140
141 //=======================================================================
142 //function : LastVParameter
143 //purpose  : 
144 //=======================================================================
145
146 inline Standard_Real GeomAdaptor_Surface::LastVParameter() const {
147   return myVLast;
148 }
149
150 //=======================================================================
151 //function : GetType
152 //purpose  : 
153 //=======================================================================
154
155 inline GeomAbs_SurfaceType GeomAdaptor_Surface::GetType() const {
156   return mySurfaceType;
157 }