0032806: Coding - get rid of unused headers [Contap to Extrema]
[occt.git] / src / Convert / Convert_ElementarySurfaceToBSplineSurface.hxx
1 // Created on: 1991-10-10
2 // Created by: Jean Claude VAUTHIER
3 // Copyright (c) 1991-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 _Convert_ElementarySurfaceToBSplineSurface_HeaderFile
18 #define _Convert_ElementarySurfaceToBSplineSurface_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <TColgp_Array2OfPnt.hxx>
25 #include <TColStd_Array2OfReal.hxx>
26 #include <TColStd_Array1OfReal.hxx>
27 #include <TColStd_Array1OfInteger.hxx>
28 #include <Standard_Boolean.hxx>
29 class gp_Pnt;
30
31
32 //! Root class for algorithms which convert an elementary
33 //! surface (cylinder, cone, sphere or torus) into a BSpline
34 //! surface (CylinderToBSplineSurface, ConeToBSplineSurface,
35 //! SphereToBSplineSurface, TorusToBSplineSurface).
36 //! These algorithms all work on elementary surfaces from
37 //! the gp package and compute all the data needed to
38 //! construct a BSpline surface equivalent to the cylinder,
39 //! cone, sphere or torus. This data consists of the following:
40 //! -   degrees in the u and v parametric directions,
41 //! -   periodic characteristics in the u and v parametric directions,
42 //! -   a poles table with associated weights,
43 //! -   a knots table (for the u and v parametric directions)
44 //! with associated multiplicities.
45 //! The abstract class
46 //! ElementarySurfaceToBSplineSurface provides a
47 //! framework for storing and consulting this computed data.
48 //! This data may then be used to construct a
49 //! Geom_BSplineSurface surface, for example.
50 //! All those classes define algorithms to convert an
51 //! ElementarySurface into a B-spline surface.
52 //! This abstract class implements the methods to get
53 //! the geometric representation of the B-spline surface.
54 //! The B-spline representation is computed at the creation
55 //! time in the sub classes.
56 //! The B-spline surface is defined with its degree in the
57 //! parametric U and V directions, its control points (Poles),
58 //! its weights, its knots and their multiplicity.
59 //! KeyWords :
60 //! Convert, ElementarySurface, BSplineSurface.
61 class Convert_ElementarySurfaceToBSplineSurface 
62 {
63 public:
64
65   DEFINE_STANDARD_ALLOC
66
67   
68   Standard_EXPORT Standard_Integer UDegree() const;
69   
70   //! Returns the degree for the u or v parametric direction of
71   //! the BSpline surface whose data is computed in this framework.
72   Standard_EXPORT Standard_Integer VDegree() const;
73   
74   Standard_EXPORT Standard_Integer NbUPoles() const;
75   
76   //! Returns the number of poles for the u or v parametric
77   //! direction of the BSpline surface whose data is computed in this framework.
78   Standard_EXPORT Standard_Integer NbVPoles() const;
79   
80   Standard_EXPORT Standard_Integer NbUKnots() const;
81   
82   //! Returns the number of knots for the u or v parametric
83   //! direction of the BSpline surface whose data is computed in this framework .
84   Standard_EXPORT Standard_Integer NbVKnots() const;
85   
86   Standard_EXPORT Standard_Boolean IsUPeriodic() const;
87   
88   //! Returns true if the BSpline surface whose data is computed
89   //! in this framework is periodic in the u or v parametric direction.
90   Standard_EXPORT Standard_Boolean IsVPeriodic() const;
91   
92   //! Returns the pole of index (UIndex,VIndex) to the poles
93   //! table of the BSpline surface whose data is computed in this framework.
94   //! Exceptions
95   //! Standard_OutOfRange if, for the BSpline surface whose
96   //! data is computed in this framework:
97   //! -   UIndex is outside the bounds of the poles table in the u
98   //! parametric direction, or
99   //! -   VIndex is outside the bounds of the poles table in the v
100   //! parametric direction.
101   Standard_EXPORT gp_Pnt Pole (const Standard_Integer UIndex, const Standard_Integer VIndex) const;
102   
103   //! Returns the weight of the pole of index (UIndex,VIndex) to
104   //! the poles table of the BSpline surface whose data is computed in this framework.
105   //! Exceptions
106   //! Standard_OutOfRange if, for the BSpline surface whose
107   //! data is computed in this framework:
108   //! -   UIndex is outside the bounds of the poles table in the u
109   //! parametric direction, or
110   //! -   VIndex is outside the bounds of the poles table in the v
111   //! parametric direction.
112   Standard_EXPORT Standard_Real Weight (const Standard_Integer UIndex, const Standard_Integer VIndex) const;
113   
114   //! Returns the U-knot of range UIndex.
115   //! Raised if UIndex < 1 or UIndex > NbUKnots.
116   Standard_EXPORT Standard_Real UKnot (const Standard_Integer UIndex) const;
117   
118   //! Returns the V-knot of range VIndex.
119   //! Raised if VIndex < 1 or VIndex > NbVKnots.
120   Standard_EXPORT Standard_Real VKnot (const Standard_Integer UIndex) const;
121   
122   //! Returns the multiplicity of the U-knot of range UIndex.
123   //! Raised if UIndex < 1 or UIndex > NbUKnots.
124   Standard_EXPORT Standard_Integer UMultiplicity (const Standard_Integer UIndex) const;
125   
126   //! Returns the multiplicity of the V-knot of range VIndex.
127   //! Raised if VIndex < 1 or VIndex > NbVKnots.
128   Standard_EXPORT Standard_Integer VMultiplicity (const Standard_Integer VIndex) const;
129
130
131
132
133 protected:
134
135   
136   Standard_EXPORT Convert_ElementarySurfaceToBSplineSurface(const Standard_Integer NumberOfUPoles, const Standard_Integer NumberOfVPoles, const Standard_Integer NumberOfUKnots, const Standard_Integer NumberOfVKnots, const Standard_Integer UDegree, const Standard_Integer VDegree);
137
138
139   TColgp_Array2OfPnt poles;
140   TColStd_Array2OfReal weights;
141   TColStd_Array1OfReal uknots;
142   TColStd_Array1OfInteger umults;
143   TColStd_Array1OfReal vknots;
144   TColStd_Array1OfInteger vmults;
145   Standard_Integer udegree;
146   Standard_Integer vdegree;
147   Standard_Integer nbUPoles;
148   Standard_Integer nbVPoles;
149   Standard_Integer nbUKnots;
150   Standard_Integer nbVKnots;
151   Standard_Boolean isuperiodic;
152   Standard_Boolean isvperiodic;
153
154
155 private:
156
157
158
159
160
161 };
162
163
164
165
166
167
168
169 #endif // _Convert_ElementarySurfaceToBSplineSurface_HeaderFile