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