0022769: Optimization of sewing algorithm
[occt.git] / src / GeomAdaptor / GeomAdaptor_Surface.lxx
1 // File:      GeomAdaptor_Surface.lxx
2 // Created:   Tue May 18 16:12:12 1993
3 // Author:    Bruno DUMORTIER
4 // Copyright: OPEN CASCADE 1993
5
6 #include <Geom_Surface.hxx>
7 #include <Standard_NullObject.hxx>
8 #include <Standard_ConstructionError.hxx>
9
10 //=======================================================================
11 //function : GeomAdaptor_Surface
12 //purpose  : 
13 //=======================================================================
14
15 inline GeomAdaptor_Surface::GeomAdaptor_Surface()
16  : mySurfaceType(GeomAbs_OtherSurface), 
17    myUFirst(0.),
18    myULast(0.),
19    myVFirst(0.),
20    myVLast (0.),
21    myTolU(0.), 
22    myTolV(0.)
23 {
24
25
26 //=======================================================================
27 //function : GeomAdaptor_Surface
28 //purpose  : 
29 //=======================================================================
30
31 inline GeomAdaptor_Surface::GeomAdaptor_Surface(const Handle(Geom_Surface)& S)
32  : myTolU(0.), myTolV(0.)
33 {
34   Load(S);
35 }
36
37 //=======================================================================
38 //function : GeomAdaptor_Surface
39 //purpose  : 
40 //=======================================================================
41
42 inline GeomAdaptor_Surface::GeomAdaptor_Surface(const Handle(Geom_Surface)& S,
43                                                 const Standard_Real UFirst,
44                                                 const Standard_Real ULast,
45                                                 const Standard_Real VFirst,
46                                                 const Standard_Real VLast,
47                                                 const Standard_Real TolU,
48                                                 const Standard_Real TolV)
49 {
50   Load(S,UFirst,ULast,VFirst,VLast,TolU,TolV);
51 }
52
53 //=======================================================================
54 //function : Load
55 //purpose  : 
56 //=======================================================================
57
58 inline void GeomAdaptor_Surface::Load(const Handle(Geom_Surface)& S)
59 {
60   if ( S.IsNull()) Standard_NullObject::Raise("GeomAdaptor_Surface::Load");
61
62   Standard_Real U1,U2,V1,V2;
63   S->Bounds(U1,U2,V1,V2);
64   load(S,U1,U2,V1,V2);
65 }
66
67 //=======================================================================
68 //function : Load
69 //purpose  : 
70 //=======================================================================
71
72 inline void GeomAdaptor_Surface::Load(const Handle(Geom_Surface)& S,
73                                const Standard_Real UFirst,
74                                const Standard_Real ULast,
75                                const Standard_Real VFirst,
76                                const Standard_Real VLast,
77                                const Standard_Real TolU,
78                                const Standard_Real TolV)
79 {
80   if ( S.IsNull()) Standard_NullObject::Raise("GeomAdaptor_Surface::Load");
81
82   if(UFirst>ULast || VFirst>VLast)
83     Standard_ConstructionError::Raise("GeomAdaptor_Surface::Load");
84
85   load(S,UFirst,ULast,VFirst,VLast,TolU,TolV);
86 }
87
88
89 //=======================================================================
90 //function : Surface
91 //purpose  : 
92 //=======================================================================
93
94 inline const Handle(Geom_Surface)& GeomAdaptor_Surface::Surface() const {
95   return mySurface;
96 }
97
98 //=======================================================================
99 //function : FirstUParameter
100 //purpose  : 
101 //=======================================================================
102
103 inline Standard_Real GeomAdaptor_Surface::FirstUParameter() const {
104   return myUFirst;
105 }
106
107 //=======================================================================
108 //function : LastUParameter
109 //purpose  : 
110 //=======================================================================
111
112 inline Standard_Real GeomAdaptor_Surface::LastUParameter() const {
113   return myULast;
114 }
115
116 //=======================================================================
117 //function : FirstVParameter
118 //purpose  : 
119 //=======================================================================
120
121 inline Standard_Real GeomAdaptor_Surface::FirstVParameter() const {
122   return myVFirst;
123 }
124
125 //=======================================================================
126 //function : LastVParameter
127 //purpose  : 
128 //=======================================================================
129
130 inline Standard_Real GeomAdaptor_Surface::LastVParameter() const {
131   return myVLast;
132 }
133
134 //=======================================================================
135 //function : GetType
136 //purpose  : 
137 //=======================================================================
138
139 inline GeomAbs_SurfaceType GeomAdaptor_Surface::GetType() const {
140   return mySurfaceType;
141 }