Warnings on vc14 were eliminated
[occt.git] / src / GeomAdaptor / GeomAdaptor_Surface.lxx
CommitLineData
b311480e 1// Created on: 1993-05-18
2// Created by: Bruno DUMORTIER
3// Copyright (c) 1993-1999 Matra Datavision
973c2be1 4// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 5//
973c2be1 6// This file is part of Open CASCADE Technology software library.
b311480e 7//
d5f74e42 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
973c2be1 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.
b311480e 13//
973c2be1 14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
7fd59977 16
17#include <Geom_Surface.hxx>
041bfce9 18#include <Standard_NullObject.hxx>
19#include <Standard_ConstructionError.hxx>
7fd59977 20
21//=======================================================================
22//function : GeomAdaptor_Surface
23//purpose :
24//=======================================================================
25
26inline GeomAdaptor_Surface::GeomAdaptor_Surface()
6b84c3f7 27 : myUFirst(0.),
041bfce9 28 myULast(0.),
29 myVFirst(0.),
30 myVLast (0.),
31 myTolU(0.),
6b84c3f7 32 myTolV(0.),
33 mySurfaceType(GeomAbs_OtherSurface)
041bfce9 34{
35}
7fd59977 36
37//=======================================================================
38//function : GeomAdaptor_Surface
39//purpose :
40//=======================================================================
41
42inline GeomAdaptor_Surface::GeomAdaptor_Surface(const Handle(Geom_Surface)& S)
43 : myTolU(0.), myTolV(0.)
44{
45 Load(S);
46}
47
48//=======================================================================
49//function : GeomAdaptor_Surface
50//purpose :
51//=======================================================================
52
53inline 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)
60{
61 Load(S,UFirst,ULast,VFirst,VLast,TolU,TolV);
62}
63
64//=======================================================================
65//function : Load
66//purpose :
67//=======================================================================
68
69inline void GeomAdaptor_Surface::Load(const Handle(Geom_Surface)& S)
70{
9775fa61 71 if ( S.IsNull()) throw Standard_NullObject("GeomAdaptor_Surface::Load");
041bfce9 72
7fd59977 73 Standard_Real U1,U2,V1,V2;
74 S->Bounds(U1,U2,V1,V2);
041bfce9 75 load(S,U1,U2,V1,V2);
76}
77
78//=======================================================================
79//function : Load
80//purpose :
81//=======================================================================
82
83inline 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)
90{
9775fa61 91 if ( S.IsNull()) throw Standard_NullObject("GeomAdaptor_Surface::Load");
041bfce9 92
93 if(UFirst>ULast || VFirst>VLast)
9775fa61 94 throw Standard_ConstructionError("GeomAdaptor_Surface::Load");
041bfce9 95
96 load(S,UFirst,ULast,VFirst,VLast,TolU,TolV);
7fd59977 97}
98
041bfce9 99
7fd59977 100//=======================================================================
101//function : Surface
102//purpose :
103//=======================================================================
104
105inline const Handle(Geom_Surface)& GeomAdaptor_Surface::Surface() const {
106 return mySurface;
107}
108
109//=======================================================================
110//function : FirstUParameter
111//purpose :
112//=======================================================================
113
114inline Standard_Real GeomAdaptor_Surface::FirstUParameter() const {
115 return myUFirst;
116}
117
118//=======================================================================
119//function : LastUParameter
120//purpose :
121//=======================================================================
122
123inline Standard_Real GeomAdaptor_Surface::LastUParameter() const {
124 return myULast;
125}
126
127//=======================================================================
128//function : FirstVParameter
129//purpose :
130//=======================================================================
131
132inline Standard_Real GeomAdaptor_Surface::FirstVParameter() const {
133 return myVFirst;
134}
135
136//=======================================================================
137//function : LastVParameter
138//purpose :
139//=======================================================================
140
141inline Standard_Real GeomAdaptor_Surface::LastVParameter() const {
142 return myVLast;
143}
144
145//=======================================================================
146//function : GetType
147//purpose :
148//=======================================================================
149
150inline GeomAbs_SurfaceType GeomAdaptor_Surface::GetType() const {
151 return mySurfaceType;
152}