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