0024166: Unable to create file with "Save" menu of voxeldemo Qt sample
[occt.git] / src / BSplSLib / BSplSLib.lxx
1 // Created on: 1993-11-25
2 // Created by: Bruno DUMORTIER
3 // Copyright (c) 1993-1999 Matra Datavision
4 // Copyright (c) 1999-2012 OPEN CASCADE SAS
5 //
6 // The content of this file is subject to the Open CASCADE Technology Public
7 // License Version 6.5 (the "License"). You may not use the content of this file
8 // except in compliance with the License. Please obtain a copy of the License
9 // at http://www.opencascade.org and read it completely before using this file.
10 //
11 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 //
14 // The Original Code and all software distributed under the License is
15 // distributed on an "AS IS" basis, without warranty of any kind, and the
16 // Initial Developer hereby disclaims all such warranties, including without
17 // limitation, any warranties of merchantability, fitness for a particular
18 // purpose or non-infringement. Please see the License for the specific terms
19 // and conditions governing the rights and limitations under the License.
20
21
22 #include <BSplCLib.hxx>
23 #include <TColgp_Array2OfPnt.hxx>
24 #include <TColStd_Array2OfReal.hxx>
25
26 //=======================================================================
27 //function : CoefsD0
28 //purpose  : 
29 //=======================================================================
30
31 inline void BSplSLib::CoefsD0(const Standard_Real U, 
32                               const Standard_Real V, 
33                               const TColgp_Array2OfPnt& Poles, 
34                               const TColStd_Array2OfReal& Weights, 
35                               gp_Pnt& Point)
36 {
37   BSplSLib::CacheD0(U, V,
38                     Poles.RowLength() - 1, Poles.ColLength() - 1, 
39                     0., 0., 1., 1.,
40                     Poles, Weights, Point);
41 }
42
43 //=======================================================================
44 //function : CoefsD1
45 //purpose  : 
46 //=======================================================================
47
48 inline void BSplSLib::CoefsD1(const Standard_Real U, 
49                               const Standard_Real V, 
50                               const TColgp_Array2OfPnt& Poles, 
51                               const TColStd_Array2OfReal& Weights, 
52                               gp_Pnt& Point, 
53                               gp_Vec& VecU, 
54                               gp_Vec& VecV)
55 {
56   BSplSLib::CacheD1(U, V,
57                     Poles.RowLength() - 1, Poles.ColLength() - 1, 
58                     0., 0., 1., 1.,
59                     Poles, Weights, Point, VecU, VecV);
60 }
61
62 //=======================================================================
63 //function : CoefsD2
64 //purpose  : 
65 //=======================================================================
66
67 inline void BSplSLib::CoefsD2(const Standard_Real U, 
68                               const Standard_Real V, 
69                               const TColgp_Array2OfPnt& Poles, 
70                               const TColStd_Array2OfReal& Weights, 
71                               gp_Pnt& Point,
72                               gp_Vec& VecU, 
73                               gp_Vec& VecV, 
74                               gp_Vec& VecUU, 
75                               gp_Vec& VecUV, 
76                               gp_Vec& VecVV)
77 {
78   BSplSLib::CacheD2(U, V,
79                     Poles.RowLength() - 1, Poles.ColLength() - 1, 
80                     0., 0., 1., 1.,
81                     Poles, Weights, Point, VecU, VecV,
82                     VecUU, VecUV, VecVV);
83 }
84
85
86 //=======================================================================
87 //function : PolesCoefficients
88 //purpose  : 
89 //=======================================================================
90
91 inline void BSplSLib::PolesCoefficients(const TColgp_Array2OfPnt& Poles, 
92                                         TColgp_Array2OfPnt& CachePoles)
93 {
94   BSplSLib::PolesCoefficients(Poles, BSplSLib::NoWeights(),
95                               CachePoles, BSplSLib::NoWeights());
96 }
97
98 //=======================================================================
99 //function : NoWeights
100 //purpose  : 
101 //=======================================================================
102
103 inline TColStd_Array2OfReal&  BSplSLib::NoWeights()
104 {
105   return (*((TColStd_Array2OfReal*) NULL));
106 }
107