0031682: Visualization - Prs3d_ShadingAspect::SetTransparency() has no effect with...
[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-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #include <Geom_Surface.hxx>
18 #include <Standard_NullObject.hxx>
19 #include <Standard_ConstructionError.hxx>
20
21 //=======================================================================
22 //function : GeomAdaptor_Surface
23 //purpose  : 
24 //=======================================================================
25
26 inline GeomAdaptor_Surface::GeomAdaptor_Surface()
27  : myUFirst(0.),
28    myULast(0.),
29    myVFirst(0.),
30    myVLast (0.),
31    myTolU(0.), 
32    myTolV(0.),
33    mySurfaceType(GeomAbs_OtherSurface)
34 {
35
36
37 //=======================================================================
38 //function : GeomAdaptor_Surface
39 //purpose  : 
40 //=======================================================================
41
42 inline 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
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)
60 {
61   Load(S,UFirst,ULast,VFirst,VLast,TolU,TolV);
62 }
63
64 //=======================================================================
65 //function : Load
66 //purpose  : 
67 //=======================================================================
68
69 inline void GeomAdaptor_Surface::Load(const Handle(Geom_Surface)& S)
70 {
71   if ( S.IsNull()) throw Standard_NullObject("GeomAdaptor_Surface::Load");
72
73   Standard_Real U1,U2,V1,V2;
74   S->Bounds(U1,U2,V1,V2);
75   load(S,U1,U2,V1,V2);
76 }
77
78 //=======================================================================
79 //function : Load
80 //purpose  : 
81 //=======================================================================
82
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)
90 {
91   if ( S.IsNull()) throw Standard_NullObject("GeomAdaptor_Surface::Load");
92
93   if(UFirst>ULast || VFirst>VLast)
94     throw Standard_ConstructionError("GeomAdaptor_Surface::Load");
95
96   load(S,UFirst,ULast,VFirst,VLast,TolU,TolV);
97 }
98
99
100 //=======================================================================
101 //function : Surface
102 //purpose  : 
103 //=======================================================================
104
105 inline const Handle(Geom_Surface)& GeomAdaptor_Surface::Surface() const {
106   return mySurface;
107 }
108
109 //=======================================================================
110 //function : FirstUParameter
111 //purpose  : 
112 //=======================================================================
113
114 inline Standard_Real GeomAdaptor_Surface::FirstUParameter() const {
115   return myUFirst;
116 }
117
118 //=======================================================================
119 //function : LastUParameter
120 //purpose  : 
121 //=======================================================================
122
123 inline Standard_Real GeomAdaptor_Surface::LastUParameter() const {
124   return myULast;
125 }
126
127 //=======================================================================
128 //function : FirstVParameter
129 //purpose  : 
130 //=======================================================================
131
132 inline Standard_Real GeomAdaptor_Surface::FirstVParameter() const {
133   return myVFirst;
134 }
135
136 //=======================================================================
137 //function : LastVParameter
138 //purpose  : 
139 //=======================================================================
140
141 inline Standard_Real GeomAdaptor_Surface::LastVParameter() const {
142   return myVLast;
143 }
144
145 //=======================================================================
146 //function : GetType
147 //purpose  : 
148 //=======================================================================
149
150 inline GeomAbs_SurfaceType GeomAdaptor_Surface::GetType() const {
151   return mySurfaceType;
152 }