1 // Copyright (c) 1995-1999 Matra Datavision
2 // Copyright (c) 1999-2014 OPEN CASCADE SAS
4 // This file is part of Open CASCADE Technology software library.
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.
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
17 #include <Convert_ElementarySurfaceToBSplineSurface.hxx>
19 #include <Standard_OutOfRange.hxx>
21 //=======================================================================
22 //function : Convert_ElementarySurfaceToBSplineSurface
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)
43 //=======================================================================
46 //=======================================================================
48 Standard_Integer Convert_ElementarySurfaceToBSplineSurface::UDegree () const
54 //=======================================================================
57 //=======================================================================
59 Standard_Integer Convert_ElementarySurfaceToBSplineSurface::VDegree () const
65 //=======================================================================
68 //=======================================================================
70 Standard_Integer Convert_ElementarySurfaceToBSplineSurface::NbUPoles () const
76 //=======================================================================
79 //=======================================================================
81 Standard_Integer Convert_ElementarySurfaceToBSplineSurface::NbVPoles () const
87 //=======================================================================
90 //=======================================================================
92 Standard_Integer Convert_ElementarySurfaceToBSplineSurface::NbUKnots () const
98 //=======================================================================
101 //=======================================================================
103 Standard_Integer Convert_ElementarySurfaceToBSplineSurface::NbVKnots () const
109 //=======================================================================
110 //function : IsUPeriodic
112 //=======================================================================
114 Standard_Boolean Convert_ElementarySurfaceToBSplineSurface::IsUPeriodic()
120 //=======================================================================
121 //function : IsVPeriodic
123 //=======================================================================
125 Standard_Boolean Convert_ElementarySurfaceToBSplineSurface::IsVPeriodic()
132 //=======================================================================
135 //=======================================================================
137 gp_Pnt Convert_ElementarySurfaceToBSplineSurface::Pole
138 (const Standard_Integer UIndex,
139 const Standard_Integer VIndex ) const
141 Standard_OutOfRange_Raise_if (
142 UIndex < 1 || UIndex > nbUPoles ||
143 VIndex < 1 || VIndex > nbVPoles, " ");
144 return poles (UIndex, VIndex);
148 //=======================================================================
151 //=======================================================================
153 Standard_Real Convert_ElementarySurfaceToBSplineSurface::Weight
154 (const Standard_Integer UIndex,
155 const Standard_Integer VIndex ) const
157 Standard_OutOfRange_Raise_if (
158 UIndex < 1 || UIndex > nbUPoles ||
159 VIndex < 1 || VIndex > nbVPoles," ");
160 return weights (UIndex, VIndex);
165 //=======================================================================
168 //=======================================================================
170 Standard_Real Convert_ElementarySurfaceToBSplineSurface::UKnot
171 (const Standard_Integer UIndex) const
173 Standard_OutOfRange_Raise_if (UIndex < 1 || UIndex > nbUKnots, " ");
174 return uknots (UIndex);
178 //=======================================================================
181 //=======================================================================
183 Standard_Real Convert_ElementarySurfaceToBSplineSurface::VKnot
184 (const Standard_Integer VIndex) const
186 Standard_OutOfRange_Raise_if (VIndex < 1 || VIndex > nbVKnots, " ");
187 return vknots (VIndex);
191 //=======================================================================
192 //function : UMultiplicity
194 //=======================================================================
196 Standard_Integer Convert_ElementarySurfaceToBSplineSurface::UMultiplicity
197 (const Standard_Integer UIndex) const
199 Standard_OutOfRange_Raise_if (UIndex < 1 || UIndex > nbUKnots, " ");
200 return umults (UIndex);
204 //=======================================================================
205 //function : VMultiplicity
207 //=======================================================================
209 Standard_Integer Convert_ElementarySurfaceToBSplineSurface::VMultiplicity
210 (const Standard_Integer VIndex) const
212 Standard_OutOfRange_Raise_if (VIndex < 1 || VIndex > nbVKnots, " ");
213 return vmults (VIndex);