zjf
2023-03-06 392b76515f40376b6d36f40a114850ef63650384
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
/////////////////////////////////////////////////////////////////////////////// 
// Copyright (C) 2002-2016, Open Design Alliance (the "Alliance"). 
// All rights reserved. 
// 
// This software and its documentation and related materials are owned by 
// the Alliance. The software may only be incorporated into application 
// programs owned by members of the Alliance, subject to a signed 
// Membership Agreement and Supplemental Software License Agreement with the
// Alliance. The structure and organization of this software are the valuable  
// trade secrets of the Alliance and its suppliers. The software is also 
// protected by copyright law and international treaty provisions. Application  
// programs incorporating this software must include the following statement 
// with their copyright notices:
//   
//   This application incorporates Teigha(R) software pursuant to a license 
//   agreement with Open Design Alliance.
//   Teigha(R) Copyright (C) 2002-2016 by Open Design Alliance. 
//   All rights reserved.
//
// By use of this software, its documentation or related materials, you 
// acknowledge and accept the above terms.
///////////////////////////////////////////////////////////////////////////////
 
#ifndef OD_GENURBSF_H
#define OD_GENURBSF_H /*!DOM*/
 
#include "Ge/GeSurface.h"
#include "Ge/GeKnotVector.h"
#include "OdPlatformSettings.h"
#include "TD_PackPush.h"
 
class OdGeNurbCurve3d;
 
static const int derivArraySize = 3;
/**
    \details
    Defines VectorDerivArray type.
*/
typedef OdGeVector3d VectorDerivArray[derivArraySize][derivArraySize];
/**
    \details
    Defines the WDerivArray type.
*/
typedef double WDerivArray [derivArraySize][derivArraySize];
 
/** \details
    This class represents non-uniform, rational B-Spline (NURBS) surfaces.
 
    Library: TD_Ge
 
    <group OdGe_Classes>
 
    \sa
    <link ge_OdGeNurbSurface.html, Working with NURBS Surfaces>
*/
class GE_TOOLKIT_EXPORT OdGeNurbSurface : public OdGeSurface
{
public:
 
 
  /** \param degreeInU [in]  Degree in the U direction. 
    \param degreeInV [in]  Degree in the V direction.
    \param propsInU [in]  Properties in the U direction.
    \param propsInV [in]  Properties in the V direction.
    \param numControlPointsInU [in]  Number of control points in the U direction.
    \param numControlPointsInV [in]  Number of control points in the V direction.
    \param controlPoints [in]  Array of 3D control points.
    \param weights [in]  Array of weights
    \param uKnots [in]  Knot vector in the U direction.
    \param vKnots [in]  Knot vector in the V direction.
    \param tol [in]  Geometric tolerance.
    \param source [in]  Object to be cloned.
   
    \remarks
    propsInU and propsInV utilize OdGe::NurbSurfaceProperties values.
  */
  OdGeNurbSurface();
  OdGeNurbSurface(
    int degreeInU, 
    int degreeInV, 
    int propsInU, 
    int propsInV,
    int numControlPointsInU, 
    int numControlPointsInV,
    const OdGePoint3dArray& controlPoints,
    const OdGeDoubleArray& weights,
    const OdGeKnotVector& uKnots,
    const OdGeKnotVector& vKnots,
    const OdGeTol& tol = OdGeContext::gTol);
  OdGeNurbSurface(
    const OdGeNurbSurface& source);
 
  OdGeNurbSurface& operator =(
    const OdGeNurbSurface& nurb);
 
  
  /** \details
    Returns true if and only if this surface is rational in the U direction.
 
    \param tol [in]  Geometric tolerance.
  */
     bool isRationalInU() const;
 
  /** \details
    Returns true if and only if this surface is periodic in the U direction, and returns the period.
 
    \param period [in]  Period.
  */
     bool isPeriodicInU(double& period) const;
 
  /** \details
    Returns true if and only if this surface is rational in the V direction.
 
    \param tol [in]  Geometric tolerance.
  */
     bool isRationalInV() const;
 
  /** \details
    Returns true if and only if this surface is periodic in the U direction, and returns the period.
 
    \param period [in]  Period.
  */
     bool isPeriodicInV(double& period) const;
  
  /** \details
    Returns a description of the singularity in the U direction:
    
    \remarks
    singularityInU utilizes OdGe::NurbSurfaceProperties values.
  */
   int singularityInU() const;
 
  /** \details
    Returns a description of the singularity in the V direction:
    
    \remarks
    singularityInV utilizes OdGe::NurbSurfaceProperties values.
  */
   int singularityInV() const;
 
  /** Desctiption:
    Returns the degree in the U direction.
  */
   int degreeInU() const;
 
  /** \details
    Returns the number of control points in the U direction.
  */
   int numControlPointsInU() const;
  
  /** \details
    Returns the degree in the V direction.
  */
   int degreeInV() const;
  
  /** \details
    Returns the number of control points in the V direction.
  */
   int numControlPointsInV() const;
 
  /** \details
    Returns the array of control points.
    
    \param controlPoints [out] Receives an array of 3D control points.
  */
     void getControlPoints(
    OdGePoint3dArray& controlPoints) const;
    
  /** \details
    Returns the array of weights.
    
    \param weights [in]  Array of weights
  */
     bool getWeights(
    OdGeDoubleArray& weights) const;
  
  /** \details
    Returns the number of knots in the U direction.
  */
     int numKnotsInU() const;
  
  /** \details
    Returns the knot vector in the U direction.
    
    \param uKnots [in]  Knot vector in the U direction.
  */
   void getUKnots(
    OdGeKnotVector& uKnots) const;
  
  /** \details
    Returns the number of knots in the V direction.
  */
     int numKnotsInV() const;
  
  /** \details
    Returns the knot vector in the V direction.
    
    \param vKnots [in]  Knot vector in the V direction.
  */
   void getVKnots(
    OdGeKnotVector& vKnots) const;
    
  /** \details
    Returns the data used to define this surface.
    
    \param degreeInU [out]  Receives the Degree in the U direction. 
    \param degreeInV [out]  Receives the Degree in the V direction.
    \param propsInU [out]  Receives the properties in the U direction.
    \param propsInV [out]  Receives the properties in the V direction.
    \param numControlPointsInU [out]  Receives the number of control points in the U direction.
    \param numControlPointsInV [out]  Receives the number of control points in the V direction.
    \param controlPoints [out]  Receives an array of 3D control points.
    \param weights [out]  Receives an array of weights
    \param uKnots [out]  Receives the knot vector in the U direction.
    \param vKnots [out]  Receives the knot vector in the V direction.
   
    \remarks
    propsInU and propsInV utilize OdGe::NurbSurfaceProperties values.
  */
     void getDefinition(
    int& degreeInU, 
    int& degreeInV,
    int& propsInU, 
    int& propsInV,
    int& numControlPointsInU,
    int& numControlPointsInV,
    OdGePoint3dArray& controlPoints,
    OdGeDoubleArray& weights,
    OdGeKnotVector& uKnots,
    OdGeKnotVector& vKnots) const;
 
  /** \details
    Sets the parameters for this spline according to the arguments, 
    and returns a reference to this spline.
 
    \param degreeInU [in]  Degree in the U direction. 
    \param degreeInV [in]  Degree in the V direction.
    \param propsInU [in]  Properties in the U direction.
    \param propsInV [in]  Properties in the V direction.
    \param numControlPointsInU [in]  Number of control points in the U direction.
    \param numControlPointsInV [in]  Number of control points in the V direction.
    \param controlPoints [in]  Array of 3D control points.
    \param weights [in]  Array of weights
    \param uKnots [in]  Knot vector in the U direction.
    \param vKnots [in]  Knot vector in the V direction.
    \param tol [in]  Geometric tolerance.
    \param source [in]  Object to be cloned.
   
    \remarks
    propsInU and propsInV utilize OdGe::NurbSurfaceProperties values.
  */
   OdGeNurbSurface& set(
    int degreeInU, 
    int degreeInV,
    int propsInU, 
    int propsInV,
    int numControlPointsInU,
    int numControlPointsInV,
    const OdGePoint3dArray& controlPoints,
    const OdGeDoubleArray& weights,
    const OdGeKnotVector& uKnots,
    const OdGeKnotVector& vKnots,
    const OdGeTol& tol = OdGeContext::gTol);
 
  //////////////////////////////////////////////////////////////////////////
  // TD Special :
 
  // computes isolines
  
  /** \details
    Returns the isoline for the specified value of V.
    Not implemented for third-party use only.
 
    \param V [in]  Value of V.
    \param isoline [out]  Receives the isoline for the specified value of V. 
  */
  void computeVIsoLine(
    double V, 
    OdGeNurbCurve3d& isoline) const;
 
  /** \details
    Returns the isoline for the specified value of U.
    Not implemented for third-party use only.
 
    \param V [in]  Value of U.
    \param isoline [out]  Receives the isoline for the specified value of U. 
  */
   void computeUIsoLine(
    double U, 
    OdGeNurbCurve3d& isoline) const;
 
     /** \details
    Returns the 2D pair of parameter values of a point on this surface.
 
    \param point [in]  Point to be evaluated.
    \param tol [in]  Geometric tolerance.
 
    \remarks
    The returned parameters specify a point within tol of point.
    If point is not on this surface, the results are unpredictable.
    If you are not sure the point is on this surface, use 
    isOn() instead of this function. This method is slower than paramOf, 
    but more accurate.
     */
   OdGePoint2d paramOfPrec(
    const OdGePoint3d& point,
    const OdGeTol& tol = OdGeContext::gTol) const;
   
 
  /** \details
    Returns the derivatives at the point specified by param.
    Not implemented for third-party use only.
 
    \param param [in]  Parameter to be evaluated.
    \param numDeriv [in]  Number of derivatives to be computed.
    \param derivatives [out]  Receives an array of derivatives at the point corresponding to param.
  */
  bool getDerivativesAt(
    const OdGePoint2d& param, 
    OdUInt32 numDeriv,
    VectorDerivArray derivatives) const;
 
  // the index in "m_controlPoints" of control *point* (i,j):
 
  /*!DOM*/
   int loc(
    int i, 
    int j) const;
 
protected:
  void calculateNURBSProperties();
};
 
#include "TD_PackPop.h"
 
#endif // OD_GENURBSF_H