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
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.
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.
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.
22 #include <Geom_Surface.hxx>
23 #include <Standard_NullObject.hxx>
24 #include <Standard_ConstructionError.hxx>
26 //=======================================================================
27 //function : GeomAdaptor_Surface
29 //=======================================================================
31 inline GeomAdaptor_Surface::GeomAdaptor_Surface()
32 : mySurfaceType(GeomAbs_OtherSurface),
42 //=======================================================================
43 //function : GeomAdaptor_Surface
45 //=======================================================================
47 inline GeomAdaptor_Surface::GeomAdaptor_Surface(const Handle(Geom_Surface)& S)
48 : myTolU(0.), myTolV(0.)
53 //=======================================================================
54 //function : GeomAdaptor_Surface
56 //=======================================================================
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)
66 Load(S,UFirst,ULast,VFirst,VLast,TolU,TolV);
69 //=======================================================================
72 //=======================================================================
74 inline void GeomAdaptor_Surface::Load(const Handle(Geom_Surface)& S)
76 if ( S.IsNull()) Standard_NullObject::Raise("GeomAdaptor_Surface::Load");
78 Standard_Real U1,U2,V1,V2;
79 S->Bounds(U1,U2,V1,V2);
83 //=======================================================================
86 //=======================================================================
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)
96 if ( S.IsNull()) Standard_NullObject::Raise("GeomAdaptor_Surface::Load");
98 if(UFirst>ULast || VFirst>VLast)
99 Standard_ConstructionError::Raise("GeomAdaptor_Surface::Load");
101 load(S,UFirst,ULast,VFirst,VLast,TolU,TolV);
105 //=======================================================================
108 //=======================================================================
110 inline const Handle(Geom_Surface)& GeomAdaptor_Surface::Surface() const {
114 //=======================================================================
115 //function : FirstUParameter
117 //=======================================================================
119 inline Standard_Real GeomAdaptor_Surface::FirstUParameter() const {
123 //=======================================================================
124 //function : LastUParameter
126 //=======================================================================
128 inline Standard_Real GeomAdaptor_Surface::LastUParameter() const {
132 //=======================================================================
133 //function : FirstVParameter
135 //=======================================================================
137 inline Standard_Real GeomAdaptor_Surface::FirstVParameter() const {
141 //=======================================================================
142 //function : LastVParameter
144 //=======================================================================
146 inline Standard_Real GeomAdaptor_Surface::LastVParameter() const {
150 //=======================================================================
153 //=======================================================================
155 inline GeomAbs_SurfaceType GeomAdaptor_Surface::GetType() const {
156 return mySurfaceType;