42cf5bc1 |
1 | // Created on: 1993-01-09 |
2 | // Created by: 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_BSplineCurve_HeaderFile |
18 | #define _IGESGeom_BSplineCurve_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 <TColgp_HArray1OfXYZ.hxx> |
27 | #include <Standard_Real.hxx> |
28 | #include <gp_XYZ.hxx> |
29 | #include <IGESData_IGESEntity.hxx> |
30 | class Standard_DimensionMismatch; |
31 | class Standard_OutOfRange; |
32 | class gp_XYZ; |
33 | class gp_Pnt; |
34 | |
35 | |
36 | class IGESGeom_BSplineCurve; |
37 | DEFINE_STANDARD_HANDLE(IGESGeom_BSplineCurve, IGESData_IGESEntity) |
38 | |
39 | //! defines IGESBSplineCurve, Type <126> Form <0-5> |
40 | //! in package IGESGeom |
41 | //! A parametric equation obtained by dividing two summations |
42 | //! involving weights (which are real numbers), the control |
43 | //! points, and B-Spline basis functions |
44 | class IGESGeom_BSplineCurve : public IGESData_IGESEntity |
45 | { |
46 | |
47 | public: |
48 | |
49 | |
50 | Standard_EXPORT IGESGeom_BSplineCurve(); |
51 | |
52 | //! This method is used to set the fields of the class |
53 | //! BSplineCurve. Beware about indexation of arrays |
54 | //! - anIndex : Upper index of the sum |
55 | //! - aDegree : Degree of basis functions |
56 | //! - aPlanar : 0 = nonplanar curve, 1 = planar curve |
57 | //! - aClosed : 0 = open curve, 1 = closed curve |
58 | //! - aPolynom : 0 = rational, 1 = polynomial |
59 | //! - aPeriodic : 0 = nonperiodic, 1 = periodic |
60 | //! - allKnots : Knot sequence values [-Degree,Index+1] |
61 | //! - allWeights : Array of weights [0,Index] |
62 | //! - allPoles : X, Y, Z coordinates of all control points |
63 | //! [0,Index] |
64 | //! - aUmin, aUmax : Starting and ending parameter values |
65 | //! - aNorm : Unit normal (if the curve is planar) |
66 | //! raises exception if allWeights & allPoles are not of same size. |
67 | Standard_EXPORT void Init (const Standard_Integer anIndex, const Standard_Integer aDegree, const Standard_Boolean aPlanar, const Standard_Boolean aClosed, const Standard_Boolean aPolynom, const Standard_Boolean aPeriodic, const Handle(TColStd_HArray1OfReal)& allKnots, const Handle(TColStd_HArray1OfReal)& allWeights, const Handle(TColgp_HArray1OfXYZ)& allPoles, const Standard_Real aUmin, const Standard_Real aUmax, const gp_XYZ& aNorm); |
68 | |
69 | //! Changes FormNumber (indicates the Shape of the Curve) |
70 | //! Error if not in range [0-5] |
71 | Standard_EXPORT void SetFormNumber (const Standard_Integer form); |
72 | |
73 | //! returns the upper index of the sum (see Knots,Poles) |
74 | Standard_EXPORT Standard_Integer UpperIndex() const; |
75 | |
76 | //! returns the degree of basis functions |
77 | Standard_EXPORT Standard_Integer Degree() const; |
78 | |
79 | //! returns True if the curve is Planar, False if non-planar |
80 | Standard_EXPORT Standard_Boolean IsPlanar() const; |
81 | |
82 | //! returns True if the curve is closed, False if open |
83 | Standard_EXPORT Standard_Boolean IsClosed() const; |
84 | |
85 | //! returns True if the curve is polynomial, False if rational |
86 | //! <flag> False (D) : computed from the list of weights |
87 | //! (all must be equal) |
88 | //! <flag> True : as recorded |
89 | Standard_EXPORT Standard_Boolean IsPolynomial (const Standard_Boolean flag = Standard_False) const; |
90 | |
91 | //! returns True if the curve is periodic, False otherwise |
92 | Standard_EXPORT Standard_Boolean IsPeriodic() const; |
93 | |
94 | //! returns the number of knots (i.e. Degree + UpperIndex + 2) |
95 | Standard_EXPORT Standard_Integer NbKnots() const; |
96 | |
97 | //! returns the knot referred to by anIndex, |
98 | //! inside the range [-Degree,UpperIndex+1] |
99 | //! raises exception if |
100 | //! anIndex < -Degree() or anIndex > (NbKnots() - Degree()) |
101 | //! Note : Knots are numbered from -Degree (not from 1) |
102 | Standard_EXPORT Standard_Real Knot (const Standard_Integer anIndex) const; |
103 | |
104 | //! returns number of poles (i.e. UpperIndex + 1) |
105 | Standard_EXPORT Standard_Integer NbPoles() const; |
106 | |
107 | //! returns the weight referred to by anIndex, in [0,UpperIndex] |
108 | //! raises exception if anIndex < 0 or anIndex > UpperIndex() |
109 | Standard_EXPORT Standard_Real Weight (const Standard_Integer anIndex) const; |
110 | |
111 | //! returns the pole referred to by anIndex, in [0,UpperIndex] |
112 | //! raises exception if anIndex < 0 or anIndex > UpperIndex() |
113 | Standard_EXPORT gp_Pnt Pole (const Standard_Integer anIndex) const; |
114 | |
115 | //! returns the anIndex'th pole after applying Transf. Matrix |
116 | //! raises exception if an Index < 0 or an Index > UpperIndex() |
117 | Standard_EXPORT gp_Pnt TransformedPole (const Standard_Integer anIndex) const; |
118 | |
119 | //! returns starting parameter value |
120 | Standard_EXPORT Standard_Real UMin() const; |
121 | |
122 | //! returns ending parameter value |
123 | Standard_EXPORT Standard_Real UMax() const; |
124 | |
125 | //! if the curve is nonplanar then (0, 0, 0) is returned |
126 | Standard_EXPORT gp_XYZ Normal() const; |
127 | |
128 | |
129 | |
130 | |
92efcf78 |
131 | DEFINE_STANDARD_RTTIEXT(IGESGeom_BSplineCurve,IGESData_IGESEntity) |
42cf5bc1 |
132 | |
133 | protected: |
134 | |
135 | |
136 | |
137 | |
138 | private: |
139 | |
140 | |
141 | Standard_Integer theIndex; |
142 | Standard_Integer theDegree; |
143 | Standard_Boolean isPlanar; |
144 | Standard_Boolean isClosed; |
145 | Standard_Boolean isPolynomial; |
146 | Standard_Boolean isPeriodic; |
147 | Handle(TColStd_HArray1OfReal) theKnots; |
148 | Handle(TColStd_HArray1OfReal) theWeights; |
149 | Handle(TColgp_HArray1OfXYZ) thePoles; |
150 | Standard_Real theUmin; |
151 | Standard_Real theUmax; |
152 | gp_XYZ theNorm; |
153 | |
154 | |
155 | }; |
156 | |
157 | |
158 | |
159 | |
160 | |
161 | |
162 | |
163 | #endif // _IGESGeom_BSplineCurve_HeaderFile |