42cf5bc1 |
1 | // Created on: 1993-01-09 |
2 | // Created by: CKY / Contract Toubro-Larsen ( Kiran ) |
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 | #ifndef _IGESGeom_BSplineSurface_HeaderFile |
18 | #define _IGESGeom_BSplineSurface_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_Type.hxx> |
22 | |
23 | #include <Standard_Integer.hxx> |
24 | #include <Standard_Boolean.hxx> |
25 | #include <TColStd_HArray1OfReal.hxx> |
26 | #include <TColStd_HArray2OfReal.hxx> |
27 | #include <TColgp_HArray2OfXYZ.hxx> |
28 | #include <Standard_Real.hxx> |
29 | #include <IGESData_IGESEntity.hxx> |
30 | class Standard_DimensionMismatch; |
31 | class Standard_OutOfRange; |
32 | class gp_Pnt; |
33 | |
34 | |
35 | class IGESGeom_BSplineSurface; |
36 | DEFINE_STANDARD_HANDLE(IGESGeom_BSplineSurface, IGESData_IGESEntity) |
37 | |
38 | //! defines IGESBSplineSurface, Type <128> Form <0-9> |
39 | //! in package IGESGeom |
40 | //! A parametric equation obtained by dividing two summations |
41 | //! involving weights (which are real numbers), the control |
42 | //! points, and B-Spline basis functions |
43 | class IGESGeom_BSplineSurface : public IGESData_IGESEntity |
44 | { |
45 | |
46 | public: |
47 | |
48 | |
49 | Standard_EXPORT IGESGeom_BSplineSurface(); |
50 | |
51 | //! This method is used to set the fields of the class |
52 | //! BSplineSurface |
53 | //! - anIndexU : Upper index of first sum |
54 | //! - anIndexV : Upper index of second sum |
55 | //! - aDegU, aDegV : Degrees of first and second sets |
56 | //! of basis functions |
57 | //! - aCloseU, aCloseV : 1 = Closed in U, V directions |
58 | //! 0 = open in U, V directions |
59 | //! - aPolynom : 0 = Rational, 1 = polynomial |
60 | //! - aPeriodU, aPeriodV : 0 = Non periodic in U or V direction |
61 | //! 1 = Periodic in U or V direction |
62 | //! - allKnotsU, allKnotsV : Knots in U and V directions |
63 | //! - allWeights : Array of weights |
64 | //! - allPoles : XYZ coordinates of all control points |
65 | //! - aUmin : Starting value of U direction |
66 | //! - aUmax : Ending value of U direction |
67 | //! - aVmin : Starting value of V direction |
68 | //! - aVmax : Ending value of V direction |
69 | //! raises exception if allWeights & allPoles are not of same size. |
70 | Standard_EXPORT void Init (const Standard_Integer anIndexU, const Standard_Integer anIndexV, const Standard_Integer aDegU, const Standard_Integer aDegV, const Standard_Boolean aCloseU, const Standard_Boolean aCloseV, const Standard_Boolean aPolynom, const Standard_Boolean aPeriodU, const Standard_Boolean aPeriodV, const Handle(TColStd_HArray1OfReal)& allKnotsU, const Handle(TColStd_HArray1OfReal)& allKnotsV, const Handle(TColStd_HArray2OfReal)& allWeights, const Handle(TColgp_HArray2OfXYZ)& allPoles, const Standard_Real aUmin, const Standard_Real aUmax, const Standard_Real aVmin, const Standard_Real aVmax); |
71 | |
72 | //! Changes FormNumber (indicates the Shape of the Surface) |
73 | //! Error if not in range [0-9] |
74 | Standard_EXPORT void SetFormNumber (const Standard_Integer form); |
75 | |
76 | //! returns the upper index of the first sum (U) |
77 | Standard_EXPORT Standard_Integer UpperIndexU() const; |
78 | |
79 | //! returns the upper index of the second sum (V) |
80 | Standard_EXPORT Standard_Integer UpperIndexV() const; |
81 | |
82 | //! returns degree of first set of basis functions |
83 | Standard_EXPORT Standard_Integer DegreeU() const; |
84 | |
85 | //! returns degree of second set of basis functions |
86 | Standard_EXPORT Standard_Integer DegreeV() const; |
87 | |
88 | //! True if closed in U direction else False |
89 | Standard_EXPORT Standard_Boolean IsClosedU() const; |
90 | |
91 | //! True if closed in V direction else False |
92 | Standard_EXPORT Standard_Boolean IsClosedV() const; |
93 | |
94 | //! True if polynomial, False if rational |
95 | //! <flag> False (D) : computed from Weights |
96 | //! <flag> True : recorded |
97 | Standard_EXPORT Standard_Boolean IsPolynomial (const Standard_Boolean flag = Standard_False) const; |
98 | |
99 | //! True if periodic in U direction else False |
100 | Standard_EXPORT Standard_Boolean IsPeriodicU() const; |
101 | |
102 | //! True if periodic in V direction else False |
103 | Standard_EXPORT Standard_Boolean IsPeriodicV() const; |
104 | |
105 | //! returns number of knots in U direction |
106 | //! KnotsU are numbered from -DegreeU |
107 | Standard_EXPORT Standard_Integer NbKnotsU() const; |
108 | |
109 | //! returns number of knots in V direction |
110 | //! KnotsV are numbered from -DegreeV |
111 | Standard_EXPORT Standard_Integer NbKnotsV() const; |
112 | |
113 | //! returns the value of knot referred to by anIndex in U direction |
114 | //! raises exception if |
115 | //! anIndex < -DegreeU() or anIndex > (NbKnotsU() - DegreeU()) |
116 | Standard_EXPORT Standard_Real KnotU (const Standard_Integer anIndex) const; |
117 | |
118 | //! returns the value of knot referred to by anIndex in V direction |
119 | //! raises exception if |
120 | //! anIndex < -DegreeV() or anIndex > (NbKnotsV() - DegreeV()) |
121 | Standard_EXPORT Standard_Real KnotV (const Standard_Integer anIndex) const; |
122 | |
123 | //! returns number of poles in U direction |
124 | Standard_EXPORT Standard_Integer NbPolesU() const; |
125 | |
126 | //! returns number of poles in V direction |
127 | Standard_EXPORT Standard_Integer NbPolesV() const; |
128 | |
129 | //! returns the weight referred to by anIndex1, anIndex2 |
130 | //! raises exception if anIndex1 <= 0 or anIndex1 > NbPolesU() |
131 | //! or if anIndex2 <= 0 or anIndex2 > NbPolesV() |
132 | Standard_EXPORT Standard_Real Weight (const Standard_Integer anIndex1, const Standard_Integer anIndex2) const; |
133 | |
134 | //! returns the control point referenced by anIndex1, anIndex2 |
135 | //! raises exception if anIndex1 <= 0 or anIndex1 > NbPolesU() |
136 | //! or if anIndex2 <= 0 or anIndex2 > NbPolesV() |
137 | Standard_EXPORT gp_Pnt Pole (const Standard_Integer anIndex1, const Standard_Integer anIndex2) const; |
138 | |
139 | //! returns the control point referenced by anIndex1, anIndex2 |
140 | //! after applying the Transf.Matrix |
141 | //! raises exception if anIndex1 <= 0 or anIndex1 > NbPolesU() |
142 | //! or if anIndex2 <= 0 or anIndex2 > NbPolesV() |
143 | Standard_EXPORT gp_Pnt TransformedPole (const Standard_Integer anIndex1, const Standard_Integer anIndex2) const; |
144 | |
145 | //! returns starting value in the U direction |
146 | Standard_EXPORT Standard_Real UMin() const; |
147 | |
148 | //! returns ending value in the U direction |
149 | Standard_EXPORT Standard_Real UMax() const; |
150 | |
151 | //! returns starting value in the V direction |
152 | Standard_EXPORT Standard_Real VMin() const; |
153 | |
154 | //! returns ending value in the V direction |
155 | Standard_EXPORT Standard_Real VMax() const; |
156 | |
157 | |
158 | |
159 | |
92efcf78 |
160 | DEFINE_STANDARD_RTTIEXT(IGESGeom_BSplineSurface,IGESData_IGESEntity) |
42cf5bc1 |
161 | |
162 | protected: |
163 | |
164 | |
165 | |
166 | |
167 | private: |
168 | |
169 | |
170 | Standard_Integer theIndexU; |
171 | Standard_Integer theIndexV; |
172 | Standard_Integer theDegreeU; |
173 | Standard_Integer theDegreeV; |
174 | Standard_Boolean isClosedU; |
175 | Standard_Boolean isClosedV; |
176 | Standard_Boolean isPolynomial; |
177 | Standard_Boolean isPeriodicU; |
178 | Standard_Boolean isPeriodicV; |
179 | Handle(TColStd_HArray1OfReal) theKnotsU; |
180 | Handle(TColStd_HArray1OfReal) theKnotsV; |
181 | Handle(TColStd_HArray2OfReal) theWeights; |
182 | Handle(TColgp_HArray2OfXYZ) thePoles; |
183 | Standard_Real theUmin; |
184 | Standard_Real theUmax; |
185 | Standard_Real theVmin; |
186 | Standard_Real theVmax; |
187 | |
188 | |
189 | }; |
190 | |
191 | |
192 | |
193 | |
194 | |
195 | |
196 | |
197 | #endif // _IGESGeom_BSplineSurface_HeaderFile |