HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GEO_Curve.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: Geometry Library (C++)
7  *
8  * COMMENTS:
9  * This class handles curves of arbitrary degree.
10  * The Face class maintains the control vertices for the curve.
11  *
12  */
13 
14 #ifndef __GEO_Curve_h__
15 #define __GEO_Curve_h__
16 
17 #include "GEO_API.h"
18 #include "GEO_Face.h"
19 #include "GEO_Greville.h"
20 #include "GEO_PrimType.h"
21 
22 #include <GA/GA_Basis.h>
23 #include <GA/GA_GenericHandle.h>
24 
25 #include <UT/UT_Array.h>
26 #include <UT/UT_IntArray.h>
27 #include <UT/UT_Interval.h>
28 #include <UT/UT_Matrix.h>
29 
30 class GEO_Delta;
31 template<bool isconst> class GA_PwHandle;
33 
34 class GEO_API GEO_Curve : public GEO_Face
35 {
36 public:
37  using GEO_Face::evaluate;
40 
41 protected:
42  /// NOTE: The constructor should only be called from subclass
43  /// constructors.
45  : GEO_Face(d, offset), myBasis(NULL)
46  {}
47 
48  /// NOTE: The destructor should only be called from subclass
49  /// destructors.
50  /// It assumes it is OK to delete the basis, so make sure you always
51  /// set the basis with an object allocated from the heap.
52  virtual ~GEO_Curve()
53  {
54  delete myBasis;
55  }
56 
57 public:
58  // Overwrite this curve with the data from src. Virtual by inheritance.
59  virtual void copyPrimitive(const GEO_Primitive *src);
60  virtual GEO_Primitive *copy(int preserve_shared_pts = 0) const;
61 
62  virtual void copySubclassData(const GA_Primitive *source);
63 
64  virtual bool changePointRef(GA_Offset from, GA_Offset to);
65 
66  // Evaluate one point (when du=0), or the du-th derivative.
67  // Return 0 if successful, and -1 otherwise.
68  int evaluateHomogeneous(float u, UT_Vector4 &pos,
69  unsigned du=0, int uOffset=-1) const;
70  template <typename T>
71  bool evaluateHomogeneous(fpreal u,
73  T &result,
74  int du=0, int uOffset=-1) const;
75 
76  // Given a domain value (u), store all the basis derivatives (from 0 to du
77  // inclusive) into bmatx. Return the min and max index of the CVs needed
78  // for the linear combination. The indices may exceed the number of
79  // vertices if the curve is wrapped, so remember to use % getVertexCount().
80  virtual int evaluateBasisDerivs(float u, float bmatx[][GA_MAXORDER],
81  int &cvoffset, unsigned du = 0,
82  int uoffset = -1) const = 0;
83 
84  // Evaluate the basis at the given point in the domain and also return
85  // the index of the first CV to linearly combine the basis with. The CV
86  // index may exceed the number of vertices if the curve is wrapped,
87  // so remember to use modulus (%). This method handles both rational and
88  // non-rational curves.
89  virtual int evaluateBasis(float u, float *ubvals, int &cvoffset,
90  unsigned du=0, int uoffset=-1) const = 0;
91 
92  // Return the value of the i'th basis at parameter u. This method handles
93  // both rational an non-rational curves.
94  float computeBValue(float u, int i) const;
95 
96  virtual bool evaluateMesh(const UT_FloatArray &uvals,
97  GA_Offset *results,
98  GA_AttributeRefMap &hlist, unsigned du=0) const
99  { return evaluateMesh(uvals,
101  results, du); }
102 
103  // Explicit instantiations are provided for float, UT_Vector3,
104  // UT_Vector4, UT_Matrix3, UT_Matrix4
105  template <typename T>
106  bool evaluateMesh(const UT_FloatArray &uvals,
107  const GA_ROGenericHandleVertex<T> &h, T *pos,
108  unsigned du=0) const;
109 
110  virtual bool evaluateMesh(const UT_FloatArray &uvals,
111  UT_Vector4 *pos, unsigned du=0) const;
112 
113  // This method takes a start and a stop index in the valid domain, a lod
114  // representing number of points between every two breakpoints, an integer
115  // index, and return the value of the DOMAIN of point index after the
116  // domain has lod points inserted between breakpoints.
117  virtual float breakSegmIndexToDomain(int ustartidx, int ustopidx,
118  int lod, int index) const;
119 
120  // Evaluate the unit normal at (u). Return 0 if successful, and -1
121  // otherwise.
122  int evaluateNormal(float u, UT_Vector3 &nml) const;
123 
124  // Evaluate the curvature at (u). Return 0 if successful and -1 otherwise.
125  int curvature(float u, UT_Vector3 &curv) const;
126 
127  // Evaluate the arc length of the curve within a range. If the
128  // values are invalid, return -1. divs means divisions per span.
129  // If use_frwd_diff is true, forward differencing is used to speed
130  // up the computation of the arc length; if false, a more precise
131  // but slower solution is computed.
132  float arcLength(float u0, float u1, bool use_frwd_diff = true,
133  int divs = 10) const;
134 
135  // compute the un-normalized lengths corresponding to points on the curve
136  // evaluated at the valid knots parameter values
137  // (ones with which lie within curve paramer domain) and store them
138  // in the 'lengths' array. Returns the curve "length" (same as last knot).
139  // The meaning of "length" depends on ptype, and can mean chord length,
140  // square chord length, approximate arc length.
141  virtual float getKnotLengths(GA_ParameterizationType ptype,
142  UT_FloatArray &lengths) const=0;
143 
144  // Increase the order. Return 0 if successful, -1 otherwise (eg.
145  // order cannot be increased because it's >= MAXORDER).
146  int raiseOrder(int neworder, GA_AttributeRefMap &map)
147  { return raiseOrderRefMap(neworder, map); }
148  int raiseOrder (int neworder)
149  { return raiseOrderInt(neworder); }
150 
151  // Translate the CVs such that the given breakpoint change positions by
152  // the given delta. Return -1 if something goes wrong, 0 if translation
153  // was successful.
154  // NOTE: uindices cannot contain any duplicates. If the curve is closed,
155  // the first and last breakpoint are considered the same.
156  virtual int translateBreakpoints(const UT_IntArray &uindices,
157  const UT_Vector3 &delta,
158  int fixbkpts = 1,
159  GA_PointGroup *ptgroup = NULL,
160  GEO_Delta *geodelta = 0)= 0;
161 
162  virtual int transformBreakpoints(const UT_IntArray &uindices,
163  const UT_Matrix4 &matx,
164  int fixbkpts = 1,
165  GA_PointGroup *ptgroup = NULL,
166  GEO_Delta *geodelta = 0)= 0;
167 
168  // Append another face to us in one of two ways: blend the two endpoints
169  // or connect them straight or rounded. The bias ranges from 0 to 1 and is
170  // relevant only to blending. The tolerance for blending: if 0, the two
171  // endpoints will merge into one point with a discontinuity; if less than
172  // 1, we insert knots into the curves to minimize the affected areas; if 1,
173  // no refinement is done. For the non-blend case, the tolerance will
174  // generate a span whose shape goes from round to straight; 0 tolerance
175  // means straight connection. If unrefine is on, we'll try to reduce the
176  // complexity of the face if we're connecting rounded. We return 0 if OK
177  // and -1 if error. Both curves must be open and have the same order.
178  virtual int attach(const GEO_Face &face, int blend = 1,
179  float bias = 0.5f, float tolerance = 1.0f,
180  int unrefine = 1, GA_PointGroup *ptgroup=0);
181 
182  // Given a CV index figure out the min/max indicies of the knots between
183  // which the curve needs to be re-evaluated if the CV changes. If not
184  // given a valid CV index, the method returns -1. Otherwise it returns 0.
185  virtual int domainRangeOfCV(int cvidx, int &mink,
186  int &maxk) const = 0;
187 
188  // Given a CV index figure out the min/max breakpoints which are
189  // affected if the CV changes. If not given a valid CV index, the
190  // method returns -1. Otherwise it returns 0. Also returns -1 if
191  // no breakpoints are affected.
192  // NOTE: use % breakCount since maxbkp may be >= breakCount
193  virtual int breakpointRangeOfCV(int cvidx, int &minbkp,
194  int &maxbkp) const = 0;
195 
196  // Reparameterize the curve by changing its basis. This type of
197  // reparameterization is generally NOT shape preserving:
198  virtual void reparameterize(GA_ParameterizationType ptype) = 0;
199 
200  // Compute the UV and CV images of each Greville point.
201  // resize is expensive: try to avoid it if possible.
202  // Returns true if success
203  bool buildGrevilles(UT_Array<GEO_Greville> &dest) const;
204 
205  // Set the coordinates of cv[r]
206  // The method returns 0 if OK and -1 if the indices are wrong.
207  int setCV(unsigned r, const UT_Vector4 &v);
208 
209  // Take the weights into consideration or don't. If you do, the curve
210  // becomes a rational, and possibly different algorithms apply. If 'onOff'
211  // is true, this function first checks if any two weights are different
212  // before setting the rational flag to TRUE; if they are all the same,
213  // the curve is set to non-rational (=> faster evaluation). weights()
214  // calls normalizeWeights() to bring the weights to standard form.
215  // Weights that are <= 0 are bumped up to FLT_EPSILON.
216  void weights(unsigned short onOff);
217 
218  // Set the weight of cv[r] to w. If the indices are out of bounds, it
219  // returns -1; otherwise it returns 0. Weights that are <= 0 are bumped
220  // up to FLT_EPSILON.
221  int setWeight(unsigned int r, float w);
222 
223  // Get the weight of cv[r]. Return -1 if indices are wrong.
224  float getWeight(unsigned int r) const;
225 
226  // Find out whether the curve is currently computed as a rational:
227  int isRational() const;
228 
229  // Normalize the weights of the control mesh so that edge weights are 1,
230  // and all weights are >= 0 (those that are <= 0 are bumped up to
231  // FLT_EPSILON).
232  void normalizeWeights();
233 
234  // Normalize the domain and optionally shift it to a new origin. Use the
235  // given length if greater than 0.
236  void normalizeDomain(float len = 0.0F, fpreal *neworigin=0)
237  {
238  myBasis->normalize(len, neworigin);
239  }
240 
241  // Go from a normalized domain ([0,1]) to the real domain or vice versa.
242  // We look only at the valid interval.
243  virtual float unitToRealDomain(float u_unit) const;
244  virtual float realToUnitDomain(float u_real) const;
245 
246  // Calculate the real domains for n consecutive operations on the domain
247  // given n normalized domains and the operation
248  // Here the real domain ranges from 0 to vertexcount - 1 + isClosed().
249 
250  virtual void unitToRealSequence(float *uunit, float *ureal,
251  int ulen) const;
252 
253  // Map the normalized length (distance value [0,1]) parameter to the unit
254  // parameterization of the primitve. The tolerance specifies max
255  // error of the returned value (cannot be 0.0f)
256 
257  virtual float unitLengthToUnitDomain(float ulength,
258  float tolerance = 1e-05F) const;
259  virtual float unitToUnitLengthDomain(float uparm) const;
260 
261 
262  // Return the bounds of the valid evaluation interval in domain space:
263  virtual void validInterval(int &a, int &b) const;
264  virtual void validRange(float &ua, float &ub) const;
265 
266  /// Compute the texture coordinates either uniformly of chord length.
267  /// If ptattrib is true, we deal with points, else with vertices.
268  /// Returns false iff problems.
269  bool uniformTexture (const GA_RWHandleV3 &txth, bool ptattrib);
270  bool grevilleTexture(const GA_RWHandleV3 &txth, bool ptattrib);
271  bool chordLenTexture(const GA_RWHandleV3 &txth, bool ptattrib);
272 
273  // Reverses the vertices of a given face. It's virtual because some faces,
274  // such as rational splines, need to be aware of it.
275  virtual void reverse();
276 
277  // Set or query the basis. The "set" function overwrites the current
278  // basis pointer, so use with care; it returns -1 if the basis is invalid.
280  {
281  if (ub && ub->checkValid((int)getVertexCount(),
282  (int)isClosed()))
283  {
284  delete myBasis; myBasis = ub;
285  return 0;
286  }
287  else return -1;
288  }
289  /// Set the basis to a copy of the passed-in basis.
290  /// NOTE: basis *must* be valid for this curve!
291  virtual void setBasisCopy(const GA_Basis *basis) = 0;
292  const GA_Basis *getBasis(void) const { return myBasis; }
293  GA_Basis *getBasis(void) { return myBasis; }
294  void setAnyBasis(GA_Basis *ub) // Use with care!
295  {
296  delete myBasis; myBasis = ub;
297  }
298 
299  // Query the order and the dimension of the basis.
300  virtual unsigned getOrder(void) const;
301  unsigned getDim(void) const { return (unsigned)myBasis->getDimension(); }
302 
303  // Inherited from the base class: just checks the validity of the basis.
304  virtual bool isDegenerate(void) const;
305 
306  // Get the bounding box for a specific range of u and v
307  virtual void getRangeBBox(const UT_Interval &u,
308  UT_BoundingBox &bbox,
309  const GA_PwHandleRO &h) const = 0;
310 
311  // Dehomogenize data (with attributes):
312  static void dehomogenizeData(GA_Offset *vertices,
313  GA_AttributeRefMap &hlist,
314  int count);
315  static void dehomogenizeData(UT_Vector4 *pos, int count);
316 
317  // Return the surrounding values of the real-space u,v parameters.
318  // Returns 1 if succesful, 0 if out-of-range.
319  virtual int parametricBBox(float u, float v,
320  float *u0, float *u1,
321  float *v0, float *v1);
322 
323  // If ustart and ustop are two values in the valid interval,ustart < ustop,
324  // return the part of curve defined by ustart and ustop in a new primitive.
325  // Return 0 if a problem is encountered.
326  virtual GEO_Curve *extract(float ustart,float ustop) const = 0;
327  virtual int breakCount() const;
328 
329  /// @{
330  /// Method to load/save basis values. Defined from TriMesh
331  virtual bool jsonSaveBasis(UT_JSONWriter &w) const;
332  virtual bool jsonSaveBasis(UT_JSONValue &v) const;
333  virtual bool jsonLoadBasis(UT_JSONParser &p);
334  virtual bool jsonLoadBasis(UT_JSONParser &p, const UT_JSONValue &v);
335  /// @}
336 
337  // Contraint based manipulation.
338  // If the parameterization and derivative constraints do not change and
339  // the curve's basis and order don't change, then the system only needs to
340  // be solved once. The solution can then be applied multiple times,
341  // with different changes at the given parameters.
342 
343  // Return 0 if the resulting system is overdetermined or the dimensions
344  // are incorrect.
345  // 1 if ok.
346  int solveConstraints(const UT_Vector &param,
347  const UT_IntArray &dervs,
348  UT_MatrixF &soln,
349  UT_IntArray &cv_index);
350  // Return 0 if the given data is invalid (incorrect dimensions or indices).
351  // 1 if ok.
352  // If the curve is rational, the changes matrix will be modified.
353  int applyConstraints(UT_MatrixF &changes,
354  const UT_Vector &param,
355  const UT_IntArray &dervs,
356  const UT_IntArray &cv_index,
357  const UT_MatrixF &soln);
358 
359  // Return 0 if the resulting system is overdetermined.
360  // 1 if ok.
361  // Only call this method when the solution cannot be reused.
362  // If the curve is rational, the changes matrix will be modified.
363  int solveAndApplyConstraints(const UT_Vector &param,
364  const UT_IntArray &dervs,
365  UT_MatrixF &changes);
366 
367  /// Elevate the curve to the given order. Return 0 if OK and -1 otherwise.
368  int elevateOrder(int order);
369 
370  /// This is more powerful than convertNew. It always returns a NEW
371  /// object, so free it when you're done with it. It may return
372  /// a NURB curve or a Bezier curve depending on the type.
373  virtual GEO_Face *reconfigure(unsigned type, int order, bool open,
374  bool interpends, bool nonrational) const=0;
375 
376  /// Cut a wedge of the primitive given a domain range
377  /// ind1 and ind2 are indices to the refined values
378  /// They are updated if negative on input, else used as is.
379  /// If keep is zero the curve is only refined and the indices
380  /// updated.
381  virtual GEO_Curve *cut(float u1, float u2,
382  int &ind1, int &ind2, int keep) = 0;
383 
384  /// Open the primitive at the given domain value
385  virtual void openAt(float u) = 0;
386 
387  /// Puts the location of the breakpoint at index idx on the curve in p.
388  /// Returns 1 if idx is valid, 0 otherwise.
389  bool interpretBreakpoint(int idx, UT_Vector3 &p) const;
390 
391  /// Method for helping curve fitting on a set of data points.
392  /// Given a set of data points dataPts[0..n][0..2].
393  /// Compute the unit tangent vectors for local interpolation methods,
394  /// and indicate possible corner points if needed.
395  /// To specify that you want to detect corners, set the column
396  /// dimensions of tangents to [0..5] (ie. tangents[0..n][0..5],
397  /// to allow for 2 tangents (in/out) per point)
398  /// else set tangents[0..n][0..2].
399  /// Output: tangents[0..n][0..2||5].
400  static void computeDataPtsUnitTangents(const UT_MatrixF &dataPts,
401  UT_MatrixF &tangents);
402 
403  virtual void computeInteriorPointWeights(
404  UT_Array<GA_Offset> &vtxlist, UT_Array<float> &weightlist,
405  fpreal u, fpreal v, fpreal w) const;
406 
407 protected:
408  // The basis. Not const because we want to be able to (re)set it at
409  // initialization time or elsewhere. It must be assigned an object
410  // allocated from the heap so that we can delete it when calling this
411  // class's destructor.
413 
415  {
416  return static_cast<GA_PrimitiveFamilyMask>(
419  );
420  }
422 
423  // Load and save functions redefined from the parent class.
424  virtual bool savePrivateH9(std::ostream &os, bool binary) const;
425  virtual bool loadPrivateH9(UT_IStream &is);
426  virtual void copyBasis(const GEO_Curve *src);
427 
428  // Get a new basis of a type that matches our type:
429  virtual GA_Basis *newBasis(void) const = 0;
430 
431  // Check the validity of the data. Meant to be called especially at loading
432  // time, since it also checks the weights. The method returns 1 if OK and
433  // 0 if trouble.
434  virtual bool validate(void) const;
435 
436  // Set the order of the basis:
437  void setOrder(unsigned ord) { myBasis->setOrder(ord); }
438 
439  // Compute an evalution stepsize that is surely valid.
440  float stepSize(float start, float stop, int count) const
441  {
442  return (count > 0) ? ((stop - start)/(float)count)
443  : 0.0F;
444  }
445 
446  // Evaluate the position or the derivative at domain point (u,v), where
447  // u and v MUST be in [0,1]. "v" and "dv" will be ignored here. Return 0 if
448  // OK and -1 otherwise.
449  virtual bool evaluatePointRefMap( GA_Offset result_vtx,
450  GA_AttributeRefMap &hlist,
451  fpreal u_unit, fpreal=0,
452  uint du=0, uint = 0) const;
453  virtual int evaluatePointV4( UT_Vector4 &pos,
454  float u_unit, float=0,
455  unsigned du=0, unsigned = 0) const;
456 
457  virtual bool evaluateRefMap(fpreal u, GA_Offset result_vtx,
458  GA_AttributeRefMap &hlist,
459  int du=0, int uOffset=-1) const;
460  virtual int evaluateV4(float u, UT_Vector4 &pos,
461  unsigned du=0, int uOffset=-1) const;
462 
463  virtual int raiseOrderRefMap(int neworder,
464  GA_AttributeRefMap &map)=0;
465  virtual int raiseOrderInt(int neworder)=0;
466 
467  /// Report approximate memory usage for myBasis, grevArray, myVertexList,
468  /// since the subclasses don't have access to grevArray.
469  int64 getBaseMemoryUsage() const;
470 
471  // This is called by the subclasses to count the
472  // memory used by myBasis, grevArray, myVertexList
474 
475 private:
476  friend std::ostream &operator<<(std::ostream &os, const GEO_Curve &d)
477  {
478  d.saveH9(os, 0,
481  return os;
482  }
484 };
486 
487 #endif
int raiseOrder(int neworder, GA_AttributeRefMap &map)
Definition: GEO_Curve.h:146
virtual int breakCount() const =0
virtual bool changePointRef(GA_Offset from, GA_Offset to)
void reverse() override
Reverse the order of vertices.
GLenum src
Definition: glew.h:2410
virtual void unitToRealSequence(float *uunit, float *ureal, int ulen) const
GLuint index
Definition: glew.h:1814
GLuint GLdouble u1
Definition: glew.h:3446
#define SYS_DEPRECATED_PUSH_DISABLE()
#define SYS_DEPRECATED_POP_DISABLE()
virtual float breakSegmIndexToDomain(int ustartidx, int ustopidx, int lod, int index) const
GLboolean GLboolean GLboolean GLboolean a
Definition: glew.h:9477
Specialization of GA_ROGenericHandleVertex for GA_Offset.
float stepSize(float start, float stop, int count) const
Definition: GEO_Curve.h:440
virtual void validRange(float &ua, float &ub) const
GLsizei GLsizei GLchar * source
Definition: glew.h:1832
#define GA_MAXORDER
Definition: GA_Defines.h:17
JSON reader class which handles parsing of JSON or bJSON files.
Definition: UT_JSONParser.h:75
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:32
const GLdouble * v
Definition: glew.h:1391
#define GA_NO_OVERRIDE
Definition: GA_Primitive.h:76
virtual int parametricBBox(float u, float v, float *u0, float *u1, float *v0, float *v1)
GA_PwHandle< true > GA_PwHandleRO
Definition: GEO_Curve.h:31
4D Vector class.
Definition: UT_Vector4.h:163
SYS_FORCE_INLINE bool isClosed() const
Definition: GEO_Face.h:243
GLfloat param
Definition: glew.h:1530
SYS_FORCE_INLINE int64 getBaseMemoryUsage() const
Report approximate memory usage for myVertexList for subclasses.
Definition: GA_Primitive.h:796
virtual float unitLengthToUnitDomain(float ulength, float tolerance=1e-04F) const
GA_PrimitiveFamilyMask
GLuint GLdouble GLdouble GLint GLint order
Definition: glew.h:3446
#define GA_INVALID_OFFSET
Definition: GA_Types.h:674
GEO_Primitive * copy(int preserve_shared_pts=0) const override
GA_ParameterizationType
Definition: GA_Types.h:193
int divs(int x, int y)
Definition: ImathFun.h:180
GEO_Curve(GA_Detail *d, GA_Offset offset=GA_INVALID_OFFSET)
Definition: GEO_Curve.h:44
virtual void validInterval(int &a, int &b) const
GA_Size GA_Offset
Definition: GA_Types.h:637
GA_Basis * myBasis
Definition: GEO_Curve.h:412
vint4 blend(const vint4 &a, const vint4 &b, const vbool4 &mask)
Definition: simd.h:4648
long long int64
Definition: SYS_Types.h:111
virtual bool checkValid(int cvLen, int bLen, bool doesWrap) const =0
GLclampf f
Definition: glew.h:3499
virtual int attach(const GEO_Face &face, int blend=1, float bias=0.5f, float tolerance=1.0f, int unrefine=1, GA_PointGroup *ptgroup=0)=0
const GLuint GLenum const void * binary
Definition: glew.h:3502
bool extract(const vbool4 &a)
Definition: simd.h:3330
GLubyte GLubyte GLubyte GLubyte w
Definition: glew.h:1890
virtual void weights(unsigned short onOff)
GA_Basis * getBasis(void)
Definition: GEO_Curve.h:293
bool evaluate(fpreal u, GEO_Vertex result, GEO_AttributeHandleList &gah, int du=0, int uOffset=-1) const
#define GEO_API
Definition: GEO_API.h:14
Bezier or NURBS basis classes which maintain knot vectors.
Definition: GA_Basis.h:49
virtual unsigned getOrder(void) const =0
bool evaluatePoint(GA_Offset result_vtx, GA_AttributeRefMap &map, fpreal u, fpreal v=0, uint du=0, uint dv=0) const
A handle to simplify manipulation of multiple attributes.
unsigned getDim(void) const
Definition: GEO_Curve.h:301
virtual int evaluateV4(float u, UT_Vector4 &pos, unsigned du=0, int uOffset=-1) const
virtual float unitToRealDomain(float u_unit) const
bool evaluatePointRefMap(GA_Offset result_vtx, GA_AttributeRefMap &vtxdata, fpreal u, fpreal v=0, uint du=0, uint dv=0) const override
GLfloat GLfloat GLfloat GLfloat h
Definition: glew.h:8011
GLfloat bias
Definition: glew.h:10274
int evaluatePointV4(UT_Vector4 &pos, float u_unit, float=0, unsigned du=0, unsigned dv=0) const override
virtual int open(float queuesize)
GLuint GLuint GLsizei GLenum type
Definition: glew.h:1253
#define GEO_FAMILY_CURVE
Definition: GEO_PrimType.h:73
unsigned int uint
Definition: SYS_Types.h:44
GLuint start
Definition: glew.h:1253
GLsizei GLenum GLuint GLuint GLsizei * lengths
Definition: glew.h:2581
GLenum GLuint GLint GLenum face
Definition: glew.h:4616
GLdouble GLdouble GLdouble b
Definition: glew.h:9122
GLfloat GLfloat p
Definition: glew.h:16321
double fpreal
Definition: SYS_Types.h:276
ImageBuf OIIO_API cut(const ImageBuf &src, ROI roi={}, int nthreads=0)
GT_Basis myBasis
Definition: GT_CurveEval.h:262
GLuint counter
Definition: glew.h:2740
const GA_Basis * getBasis(void) const
Definition: GEO_Curve.h:292
static const UT_Array< GA_AttribSaveDataH9 > & theEmptySaveAttribs
Convience objects to pass as arguments to saveH9()/loadH9().
virtual bool evaluateMesh(const UT_FloatArray &uvals, GA_Offset *results, GA_AttributeRefMap &hlist, unsigned du=0) const
Definition: GEO_Curve.h:96
virtual float realToUnitDomain(float u_real) const
virtual bool jsonLoadBasis(UT_JSONParser &p)
GLint lod
Definition: glew.h:1385
virtual ~GEO_Curve()
Definition: GEO_Curve.h:52
virtual bool jsonSaveBasis(UT_JSONWriter &w) const
int setBasis(GA_Basis *ub)
Definition: GEO_Curve.h:279
GLdouble GLdouble GLdouble r
Definition: glew.h:1406
GLuint GLuint GLsizei count
Definition: glew.h:1253
virtual bool evaluateMesh(const UT_FloatArray &uvals, GA_Offset *results, GA_AttributeRefMap &hlist, unsigned du=0) const
virtual bool evaluateRefMap(fpreal u, GA_Offset result_vtx, GA_AttributeRefMap &gah, int du=0, int uOffset=-1) const
GLfloat v0
Definition: glew.h:1848
void setAnyBasis(GA_Basis *ub)
Definition: GEO_Curve.h:294
Class to store JSON objects as C++ objects.
Definition: UT_JSONValue.h:76
GLuint64EXT * result
Definition: glew.h:14007
GLuint GLdouble GLdouble u2
Definition: glew.h:3446
static GA_PrimitiveFamilyMask buildFamilyMask()
Definition: GEO_Face.h:395
Container class for all geometry.
Definition: GA_Detail.h:95
Specialization of GA_ROGenericHandle for GA_ATTRIB_VERTEX offsets.
virtual float unitToUnitLengthDomain(float uparm) const
int raiseOrder(int neworder)
Definition: GEO_Curve.h:148
void normalizeDomain(float len=0.0F, fpreal *neworigin=0)
Definition: GEO_Curve.h:236
#define const
Definition: zconf.h:214
virtual void computeInteriorPointWeights(UT_Array< GA_Offset > &vtxlist, UT_Array< float > &weightlist, fpreal u, fpreal v, fpreal w) const override
bool isDegenerate() const override
Is the primitive degenerate.
void countBaseMemory(UT_MemoryCounter &counter) const
static GA_PrimitiveFamilyMask buildFamilyMask()
Definition: GEO_Curve.h:414
GLfloat GLfloat v1
Definition: glew.h:1852
virtual void copySubclassData(const GA_Primitive *source) override
friend std::ostream & operator<<(std::ostream &os, const GEO_Curve &d)
Definition: GEO_Curve.h:476
bool saveH9(std::ostream &os, bool binary, const UT_Array< GA_AttribSaveDataH9 > &prim_attribs, const UT_Array< GA_AttribSaveDataH9 > &vtx_attribs) const override
GLenum GLsizei len
Definition: glew.h:7752
void copyPrimitive(const GEO_Primitive *src) override
GLintptr offset
Definition: glew.h:1682
GA_DECLARE_INTRINSICS(override)