0026937: Eliminate NO_CXX_EXCEPTION macro support
[occt.git] / src / Convert / Convert_ElementarySurfaceToBSplineSurface.cxx
1 // Copyright (c) 1995-1999 Matra Datavision
2 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 //
4 // This file is part of Open CASCADE Technology software library.
5 //
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
11 //
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
14
15 //JCV 16/10/91
16
17 #include <Convert_ElementarySurfaceToBSplineSurface.hxx>
18 #include <gp_Pnt.hxx>
19 #include <Standard_OutOfRange.hxx>
20
21 //=======================================================================
22 //function : Convert_ElementarySurfaceToBSplineSurface
23 //purpose  : 
24 //=======================================================================
25 Convert_ElementarySurfaceToBSplineSurface::
26 Convert_ElementarySurfaceToBSplineSurface 
27   (const Standard_Integer NbUPoles,
28    const Standard_Integer NbVPoles,
29    const Standard_Integer NbUKnots,
30    const Standard_Integer NbVKnots,
31    const Standard_Integer UDegree,
32    const Standard_Integer VDegree) : 
33   poles  (1, NbUPoles, 1, NbVPoles), weights (1, NbUPoles, 1, NbVPoles),
34   uknots (1, NbUKnots), umults (1, NbUKnots),
35   vknots (1, NbVKnots), vmults (1, NbVKnots), 
36   udegree  (UDegree),  vdegree  (VDegree),
37   nbUPoles (NbUPoles), nbVPoles (NbVPoles),
38   nbUKnots (NbUKnots), nbVKnots (NbVKnots)
39
40 { }
41    
42
43 //=======================================================================
44 //function : UDegree
45 //purpose  : 
46 //=======================================================================
47
48 Standard_Integer Convert_ElementarySurfaceToBSplineSurface::UDegree () const 
49 {
50   return udegree;
51 }
52
53
54 //=======================================================================
55 //function : VDegree
56 //purpose  : 
57 //=======================================================================
58
59 Standard_Integer Convert_ElementarySurfaceToBSplineSurface::VDegree () const 
60 {
61   return vdegree;
62 }
63
64
65 //=======================================================================
66 //function : NbUPoles
67 //purpose  : 
68 //=======================================================================
69
70 Standard_Integer Convert_ElementarySurfaceToBSplineSurface::NbUPoles () const 
71 {
72   return nbUPoles;
73 }
74
75
76 //=======================================================================
77 //function : NbVPoles
78 //purpose  : 
79 //=======================================================================
80
81 Standard_Integer Convert_ElementarySurfaceToBSplineSurface::NbVPoles () const 
82 {
83   return nbVPoles;
84 }
85
86
87 //=======================================================================
88 //function : NbUKnots
89 //purpose  : 
90 //=======================================================================
91
92 Standard_Integer Convert_ElementarySurfaceToBSplineSurface::NbUKnots () const 
93 {
94   return nbUKnots;
95 }
96
97
98 //=======================================================================
99 //function : NbVKnots
100 //purpose  : 
101 //=======================================================================
102
103 Standard_Integer Convert_ElementarySurfaceToBSplineSurface::NbVKnots () const 
104 {
105   return nbVKnots;
106 }
107
108
109 //=======================================================================
110 //function : IsUPeriodic
111 //purpose  : 
112 //=======================================================================
113
114 Standard_Boolean Convert_ElementarySurfaceToBSplineSurface::IsUPeriodic()
115 const 
116 {
117   return isuperiodic;
118 }
119
120 //=======================================================================
121 //function : IsVPeriodic
122 //purpose  : 
123 //=======================================================================
124
125 Standard_Boolean Convert_ElementarySurfaceToBSplineSurface::IsVPeriodic()
126 const 
127 {
128   return isvperiodic;
129 }
130
131
132 //=======================================================================
133 //function : Pole
134 //purpose  : 
135 //=======================================================================
136
137 gp_Pnt Convert_ElementarySurfaceToBSplineSurface::Pole 
138   (const Standard_Integer UIndex, 
139    const Standard_Integer VIndex ) const 
140 {
141    Standard_OutOfRange_Raise_if (
142                        UIndex < 1 || UIndex > nbUPoles ||
143                        VIndex < 1 || VIndex > nbVPoles, " ");
144    return poles (UIndex, VIndex);
145 }
146
147
148 //=======================================================================
149 //function : Weight
150 //purpose  : 
151 //=======================================================================
152
153 Standard_Real Convert_ElementarySurfaceToBSplineSurface::Weight 
154   (const Standard_Integer UIndex,
155    const Standard_Integer VIndex ) const 
156 {
157    Standard_OutOfRange_Raise_if (
158                        UIndex < 1 || UIndex > nbUPoles ||
159                        VIndex < 1 || VIndex > nbVPoles," ");
160    return weights (UIndex, VIndex);
161 }
162
163
164
165 //=======================================================================
166 //function : UKnot
167 //purpose  : 
168 //=======================================================================
169
170 Standard_Real Convert_ElementarySurfaceToBSplineSurface::UKnot 
171   (const Standard_Integer UIndex) const 
172 {
173   Standard_OutOfRange_Raise_if (UIndex < 1 || UIndex > nbUKnots, " ");
174   return uknots (UIndex);
175 }
176
177
178 //=======================================================================
179 //function : VKnot
180 //purpose  : 
181 //=======================================================================
182
183 Standard_Real Convert_ElementarySurfaceToBSplineSurface::VKnot 
184   (const Standard_Integer VIndex) const 
185 {
186   Standard_OutOfRange_Raise_if (VIndex < 1 || VIndex > nbVKnots, " ");
187   return vknots (VIndex);
188 }
189
190
191 //=======================================================================
192 //function : UMultiplicity
193 //purpose  : 
194 //=======================================================================
195
196 Standard_Integer Convert_ElementarySurfaceToBSplineSurface::UMultiplicity 
197   (const Standard_Integer UIndex) const 
198 {
199   Standard_OutOfRange_Raise_if (UIndex < 1 || UIndex > nbUKnots, " ");
200   return umults (UIndex);
201 }
202
203
204 //=======================================================================
205 //function : VMultiplicity
206 //purpose  : 
207 //=======================================================================
208
209 Standard_Integer Convert_ElementarySurfaceToBSplineSurface::VMultiplicity 
210   (const Standard_Integer VIndex) const 
211 {
212   Standard_OutOfRange_Raise_if (VIndex < 1 || VIndex > nbVKnots, " ");
213   return vmults (VIndex);
214 }