1 // Created on: 1993-05-18
2 // Created by: Bruno DUMORTIER
3 // Copyright (c) 1993-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #include <Geom_Surface.hxx>
18 #include <Standard_NullObject.hxx>
19 #include <Standard_ConstructionError.hxx>
21 //=======================================================================
22 //function : GeomAdaptor_Surface
24 //=======================================================================
26 inline GeomAdaptor_Surface::GeomAdaptor_Surface()
33 mySurfaceType(GeomAbs_OtherSurface)
37 //=======================================================================
38 //function : GeomAdaptor_Surface
40 //=======================================================================
42 inline GeomAdaptor_Surface::GeomAdaptor_Surface(const Handle(Geom_Surface)& S)
43 : myTolU(0.), myTolV(0.)
48 //=======================================================================
49 //function : GeomAdaptor_Surface
51 //=======================================================================
53 inline GeomAdaptor_Surface::GeomAdaptor_Surface(const Handle(Geom_Surface)& S,
54 const Standard_Real UFirst,
55 const Standard_Real ULast,
56 const Standard_Real VFirst,
57 const Standard_Real VLast,
58 const Standard_Real TolU,
59 const Standard_Real TolV)
61 Load(S,UFirst,ULast,VFirst,VLast,TolU,TolV);
64 //=======================================================================
67 //=======================================================================
69 inline void GeomAdaptor_Surface::Load(const Handle(Geom_Surface)& S)
71 if ( S.IsNull()) throw Standard_NullObject("GeomAdaptor_Surface::Load");
73 Standard_Real U1,U2,V1,V2;
74 S->Bounds(U1,U2,V1,V2);
78 //=======================================================================
81 //=======================================================================
83 inline void GeomAdaptor_Surface::Load(const Handle(Geom_Surface)& S,
84 const Standard_Real UFirst,
85 const Standard_Real ULast,
86 const Standard_Real VFirst,
87 const Standard_Real VLast,
88 const Standard_Real TolU,
89 const Standard_Real TolV)
91 if ( S.IsNull()) throw Standard_NullObject("GeomAdaptor_Surface::Load");
93 if(UFirst>ULast || VFirst>VLast)
94 throw Standard_ConstructionError("GeomAdaptor_Surface::Load");
96 load(S,UFirst,ULast,VFirst,VLast,TolU,TolV);
100 //=======================================================================
103 //=======================================================================
105 inline const Handle(Geom_Surface)& GeomAdaptor_Surface::Surface() const {
109 //=======================================================================
110 //function : FirstUParameter
112 //=======================================================================
114 inline Standard_Real GeomAdaptor_Surface::FirstUParameter() const {
118 //=======================================================================
119 //function : LastUParameter
121 //=======================================================================
123 inline Standard_Real GeomAdaptor_Surface::LastUParameter() const {
127 //=======================================================================
128 //function : FirstVParameter
130 //=======================================================================
132 inline Standard_Real GeomAdaptor_Surface::FirstVParameter() const {
136 //=======================================================================
137 //function : LastVParameter
139 //=======================================================================
141 inline Standard_Real GeomAdaptor_Surface::LastVParameter() const {
145 //=======================================================================
148 //=======================================================================
150 inline GeomAbs_SurfaceType GeomAdaptor_Surface::GetType() const {
151 return mySurfaceType;