HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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 copyUnwiredForMerge(const GA_Primitive *src,
63  const GA_MergeMap &map);
64 
65  virtual bool changePointRef(GA_Offset from, GA_Offset to);
66 
67  // Evaluate one point (when du=0), or the du-th derivative.
68  // Return 0 if successful, and -1 otherwise.
69  int evaluateHomogeneous(float u, UT_Vector4 &pos,
70  unsigned du=0, int uOffset=-1) const;
71  template <typename T>
72  bool evaluateHomogeneous(fpreal u,
74  T &result,
75  int du=0, int uOffset=-1) const;
76 
77  // Given a domain value (u), store all the basis derivatives (from 0 to du
78  // inclusive) into bmatx. Return the min and max index of the CVs needed
79  // for the linear combination. The indices may exceed the number of
80  // vertices if the curve is wrapped, so remember to use % getVertexCount().
81  virtual int evaluateBasisDerivs(float u, float bmatx[][GA_MAXORDER],
82  int &cvoffset, unsigned du = 0,
83  int uoffset = -1) const = 0;
84 
85  // Evaluate the basis at the given point in the domain and also return
86  // the index of the first CV to linearly combine the basis with. The CV
87  // index may exceed the number of vertices if the curve is wrapped,
88  // so remember to use modulus (%). This method handles both rational and
89  // non-rational curves.
90  virtual int evaluateBasis(float u, float *ubvals, int &cvoffset,
91  unsigned du=0, int uoffset=-1) const = 0;
92 
93  // Return the value of the i'th basis at parameter u. This method handles
94  // both rational an non-rational curves.
95  float computeBValue(float u, int i) const;
96 
97  virtual bool evaluateMesh(const UT_FloatArray &uvals,
98  GA_Offset *results,
99  GA_AttributeRefMap &hlist, unsigned du=0) const
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  virtual bool evaluateMesh(const UT_FloatArray &uvals,
112  UT_Vector4 *pos, unsigned du=0) const;
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  virtual float breakSegmIndexToDomain(int ustartidx, int ustopidx,
119  int lod, int index) const;
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  virtual 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 
183  // Given a CV index figure out the min/max indicies of the knots between
184  // which the curve needs to be re-evaluated if the CV changes. If not
185  // given a valid CV index, the method returns -1. Otherwise it returns 0.
186  virtual int domainRangeOfCV(int cvidx, int &mink,
187  int &maxk) const = 0;
188 
189  // Given a CV index figure out the min/max breakpoints which are
190  // affected if the CV changes. If not given a valid CV index, the
191  // method returns -1. Otherwise it returns 0. Also returns -1 if
192  // no breakpoints are affected.
193  // NOTE: use % breakCount since maxbkp may be >= breakCount
194  virtual int breakpointRangeOfCV(int cvidx, int &minbkp,
195  int &maxbkp) const = 0;
196 
197  // Reparameterize the curve by changing its basis. This type of
198  // reparameterization is generally NOT shape preserving:
199  virtual void reparameterize(GA_ParameterizationType ptype) = 0;
200 
201  // Compute the UV and CV images of each Greville point.
202  // resize is expensive: try to avoid it if possible.
203  // Returns true if success
204  bool buildGrevilles(UT_Array<GEO_Greville> &dest) const;
205 
206  // Set the coordinates of cv[r]
207  // The method returns 0 if OK and -1 if the indices are wrong.
208  int setCV(unsigned r, const UT_Vector4 &v);
209 
210  // Take the weights into consideration or don't. If you do, the curve
211  // becomes a rational, and possibly different algorithms apply. If 'onOff'
212  // is true, this function first checks if any two weights are different
213  // before setting the rational flag to TRUE; if they are all the same,
214  // the curve is set to non-rational (=> faster evaluation). weights()
215  // calls normalizeWeights() to bring the weights to standard form.
216  // Weights that are <= 0 are bumped up to FLT_EPSILON.
217  void weights(unsigned short onOff);
218 
219  // Set the weight of cv[r] to w. If the indices are out of bounds, it
220  // returns -1; otherwise it returns 0. Weights that are <= 0 are bumped
221  // up to FLT_EPSILON.
222  int setWeight(unsigned int r, float w);
223 
224  // Get the weight of cv[r]. Return -1 if indices are wrong.
225  float getWeight(unsigned int r) const;
226 
227  // Find out whether the curve is currently computed as a rational:
228  int isRational() const;
229 
230  // Normalize the weights of the control mesh so that edge weights are 1,
231  // and all weights are >= 0 (those that are <= 0 are bumped up to
232  // FLT_EPSILON).
233  void normalizeWeights();
234 
235  // Normalize the domain and optionally shift it to a new origin. Use the
236  // given length if greater than 0.
237  void normalizeDomain(float len = 0.0F, fpreal *neworigin=0)
238  {
239  myBasis->normalize(len, neworigin);
240  }
241 
242  // Go from a normalized domain ([0,1]) to the real domain or vice versa.
243  // We look only at the valid interval.
244  virtual float unitToRealDomain(float u_unit) const;
245  virtual float realToUnitDomain(float u_real) const;
246 
247  // Calculate the real domains for n consecutive operations on the domain
248  // given n normalized domains and the operation
249  // Here the real domain ranges from 0 to vertexcount - 1 + isClosed().
250 
251  virtual void unitToRealSequence(float *uunit, float *ureal,
252  int ulen) const;
253 
254  // Map the normalized length (distance value [0,1]) parameter to the unit
255  // parameterization of the primitve. The tolerance specifies max
256  // error of the returned value (cannot be 0.0f)
257 
258  virtual float unitLengthToUnitDomain(float ulength,
259  float tolerance = 1e-05F) const;
260  virtual float unitToUnitLengthDomain(float uparm) const;
261 
262 
263  // Return the bounds of the valid evaluation interval in domain space:
264  virtual void validInterval(int &a, int &b) const;
265  virtual void validRange(float &ua, float &ub) const;
266 
267  /// Compute the texture coordinates either uniformly of chord length.
268  /// If ptattrib is true, we deal with points, else with vertices.
269  /// Returns false iff problems.
270  bool uniformTexture (const GA_RWHandleV3 &txth, bool ptattrib);
271  bool grevilleTexture(const GA_RWHandleV3 &txth, bool ptattrib);
272  bool chordLenTexture(const GA_RWHandleV3 &txth, bool ptattrib);
273 
274  // Reverses the vertices of a given face. It's virtual because some faces,
275  // such as rational splines, need to be aware of it.
276  virtual void reverse();
277 
278  // Set or query the basis. The "set" function overwrites the current
279  // basis pointer, so use with care; it returns -1 if the basis is invalid.
281  {
282  if (ub && ub->checkValid((int)getVertexCount(),
283  (int)isClosed()))
284  {
285  delete myBasis; myBasis = ub;
286  return 0;
287  }
288  else return -1;
289  }
290  /// Set the basis to a copy of the passed-in basis.
291  /// NOTE: basis *must* be valid for this curve!
292  virtual void setBasisCopy(const GA_Basis *basis) = 0;
293  const GA_Basis *getBasis(void) const { return myBasis; }
294  GA_Basis *getBasis(void) { return myBasis; }
295  void setAnyBasis(GA_Basis *ub) // Use with care!
296  {
297  delete myBasis; myBasis = ub;
298  }
299 
300  // Query the order and the dimension of the basis.
301  virtual unsigned getOrder(void) const;
302  unsigned getDim(void) const { return (unsigned)myBasis->getDimension(); }
303 
304  // Inherited from the base class: just checks the validity of the basis.
305  virtual bool isDegenerate(void) const;
306 
307  // Get the bounding box for a specific range of u and v
308  virtual void getRangeBBox(const UT_Interval &u,
309  UT_BoundingBox &bbox,
310  const GA_PwHandleRO &h) const = 0;
311 
312  // Dehomogenize data (with attributes):
313  static void dehomogenizeData(GA_Offset *vertices,
314  GA_AttributeRefMap &hlist,
315  int count);
316  static void dehomogenizeData(UT_Vector4 *pos, int count);
317 
318  // Return the surrounding values of the real-space u,v parameters.
319  // Returns 1 if succesful, 0 if out-of-range.
320  virtual int parametricBBox(float u, float v,
321  float *u0, float *u1,
322  float *v0, float *v1);
323 
324  // If ustart and ustop are two values in the valid interval,ustart < ustop,
325  // return the part of curve defined by ustart and ustop in a new primitive.
326  // Return 0 if a problem is encountered.
327  virtual GEO_Curve *extract(float ustart,float ustop) const = 0;
328  virtual int breakCount() const;
329 
330  /// @{
331  /// Method to load/save basis values. Defined from TriMesh
332  virtual bool jsonSaveBasis(UT_JSONWriter &w) const;
333  virtual bool jsonSaveBasis(UT_JSONValue &v) const;
334  virtual bool jsonLoadBasis(UT_JSONParser &p);
335  virtual bool jsonLoadBasis(UT_JSONParser &p, const UT_JSONValue &v);
336  /// @}
337 
338  // Contraint based manipulation.
339  // If the parameterization and derivative constraints do not change and
340  // the curve's basis and order don't change, then the system only needs to
341  // be solved once. The solution can then be applied multiple times,
342  // with different changes at the given parameters.
343 
344  // Return 0 if the resulting system is overdetermined or the dimensions
345  // are incorrect.
346  // 1 if ok.
347  int solveConstraints(const UT_Vector &param,
348  const UT_IntArray &dervs,
349  UT_MatrixF &soln,
350  UT_IntArray &cv_index);
351  // Return 0 if the given data is invalid (incorrect dimensions or indices).
352  // 1 if ok.
353  // If the curve is rational, the changes matrix will be modified.
354  int applyConstraints(UT_MatrixF &changes,
355  const UT_Vector &param,
356  const UT_IntArray &dervs,
357  const UT_IntArray &cv_index,
358  const UT_MatrixF &soln);
359 
360  // Return 0 if the resulting system is overdetermined.
361  // 1 if ok.
362  // Only call this method when the solution cannot be reused.
363  // If the curve is rational, the changes matrix will be modified.
364  int solveAndApplyConstraints(const UT_Vector &param,
365  const UT_IntArray &dervs,
366  UT_MatrixF &changes);
367 
368  /// Elevate the curve to the given order. Return 0 if OK and -1 otherwise.
369  int elevateOrder(int order);
370 
371  /// This is more powerful than convertNew. It always returns a NEW
372  /// object, so free it when you're done with it. It may return
373  /// a NURB curve or a Bezier curve depending on the type.
374  virtual GEO_Face *reconfigure(unsigned type, int order, bool open,
375  bool interpends, bool nonrational) const=0;
376 
377  /// Cut a wedge of the primitive given a domain range
378  /// ind1 and ind2 are indices to the refined values
379  /// They are updated if negative on input, else used as is.
380  /// If keep is zero the curve is only refined and the indices
381  /// updated.
382  virtual GEO_Curve *cut(float u1, float u2,
383  int &ind1, int &ind2, int keep) = 0;
384 
385  /// Open the primitive at the given domain value
386  virtual void openAt(float u) = 0;
387 
388  /// Puts the location of the breakpoint at index idx on the curve in p.
389  /// Returns 1 if idx is valid, 0 otherwise.
390  bool interpretBreakpoint(int idx, UT_Vector3 &p) const;
391 
392  /// Method for helping curve fitting on a set of data points.
393  /// Given a set of data points dataPts[0..n][0..2].
394  /// Compute the unit tangent vectors for local interpolation methods,
395  /// and indicate possible corner points if needed.
396  /// To specify that you want to detect corners, set the column
397  /// dimensions of tangents to [0..5] (ie. tangents[0..n][0..5],
398  /// to allow for 2 tangents (in/out) per point)
399  /// else set tangents[0..n][0..2].
400  /// Output: tangents[0..n][0..2||5].
401  static void computeDataPtsUnitTangents(const UT_MatrixF &dataPts,
402  UT_MatrixF &tangents);
403 
404  virtual void computeInteriorPointWeights(UT_Array<GA_Offset> &vtxlist, UT_FloatArray &weightlist, fpreal u, fpreal v, fpreal w) const;
405 
406 protected:
407  // The basis. Not const because we want to be able to (re)set it at
408  // initialization time or elsewhere. It must be assigned an object
409  // allocated from the heap so that we can delete it when calling this
410  // class's destructor.
412 
414  {
415  return static_cast<GA_PrimitiveFamilyMask>(
418  );
419  }
421 
422  // Load and save functions redefined from the parent class.
423  virtual bool savePrivateH9(std::ostream &os, bool binary) const;
424  virtual bool loadPrivateH9(UT_IStream &is);
425  virtual void copyBasis(const GEO_Curve *src);
426 
427  // Get a new basis of a type that matches our type:
428  virtual GA_Basis *newBasis(void) const = 0;
429 
430  // Check the validity of the data. Meant to be called especially at loading
431  // time, since it also checks the weights. The method returns 1 if OK and
432  // 0 if trouble.
433  virtual bool validate(void) const;
434 
435  // Set the order of the basis:
436  void setOrder(unsigned ord) { myBasis->setOrder(ord); }
437 
438  // Compute an evalution stepsize that is surely valid.
439  float stepSize(float start, float stop, int count) const
440  {
441  return (count > 0) ? ((stop - start)/(float)count)
442  : 0.0F;
443  }
444 
445  // Evaluate the position or the derivative at domain point (u,v), where
446  // u and v MUST be in [0,1]. "v" and "dv" will be ignored here. Return 0 if
447  // OK and -1 otherwise.
448  virtual bool evaluatePointRefMap( GA_Offset result_vtx,
449  GA_AttributeRefMap &hlist,
450  fpreal u_unit, fpreal=0,
451  uint du=0, uint = 0) const;
452  virtual int evaluatePointV4( UT_Vector4 &pos,
453  float u_unit, float=0,
454  unsigned du=0, unsigned = 0) const;
455 
456  virtual bool evaluateRefMap(fpreal u, GA_Offset result_vtx,
457  GA_AttributeRefMap &hlist,
458  int du=0, int uOffset=-1) const;
459  virtual int evaluateV4(float u, UT_Vector4 &pos,
460  unsigned du=0, int uOffset=-1) const;
461 
462  virtual int raiseOrderRefMap(int neworder,
463  GA_AttributeRefMap &map)=0;
464  virtual int raiseOrderInt(int neworder)=0;
465 
466  /// Report approximate memory usage for myBasis, grevArray, myVertexList,
467  /// since the subclasses don't have access to grevArray.
468  int64 getBaseMemoryUsage() const;
469 
470  // This is called by the subclasses to count the
471  // memory used by myBasis, grevArray, myVertexList
472  void countBaseMemory(UT_MemoryCounter &counter) const;
473 
474 private:
475  friend std::ostream &operator<<(std::ostream &os, const GEO_Curve &d)
476  {
477  d.saveH9(os, 0,
480  return os;
481  }
483 };
485 
486 #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.
virtual void unitToRealSequence(float *uunit, float *ureal, int ulen) const
void computeInteriorPointWeights(UT_Array< GA_Offset > &vtxlist, UT_FloatArray &weightlist, fpreal u, fpreal v, fpreal w) const override
#define SYS_DEPRECATED_PUSH_DISABLE()
const GLdouble * v
Definition: glcorearb.h:836
#define SYS_DEPRECATED_POP_DISABLE()
GLuint start
Definition: glcorearb.h:474
virtual float breakSegmIndexToDomain(int ustartidx, int ustopidx, int lod, int index) const
void copyUnwiredForMerge(const GA_Primitive *src, const GA_MergeMap &map) override
const GLuint GLenum const void * binary
Definition: glcorearb.h:1923
Specialization of GA_ROGenericHandleVertex for GA_Offset.
float stepSize(float start, float stop, int count) const
Definition: GEO_Curve.h:439
void countBaseMemory(UT_MemoryCounter &counter) const
The merge map keeps track of information when merging details.
Definition: GA_MergeMap.h:53
virtual void validRange(float &ua, float &ub) const
GLboolean GLboolean GLboolean GLboolean a
Definition: glcorearb.h:1221
#define GA_MAXORDER
Definition: GA_Defines.h:17
JSON reader class which handles parsing of JSON or bJSON files.
Definition: UT_JSONParser.h:72
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:32
#define GA_NO_OVERRIDE
Definition: GA_Primitive.h:75
virtual int parametricBBox(float u, float v, float *u0, float *u1, float *v0, float *v1)
3D Vector class.
GA_PwHandle< true > GA_PwHandleRO
Definition: GEO_Curve.h:31
SYS_FORCE_INLINE bool isClosed() const
Definition: GEO_Face.h:242
png_uint_32 i
Definition: png.h:2877
virtual float unitLengthToUnitDomain(float ulength, float tolerance=1e-04F) const
GA_PrimitiveFamilyMask
#define GA_INVALID_OFFSET
Definition: GA_Types.h:654
GEO_Primitive * copy(int preserve_shared_pts=0) const override
GA_ParameterizationType
Definition: GA_Types.h:173
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:617
GA_Basis * myBasis
Definition: GEO_Curve.h:411
long long int64
Definition: SYS_Types.h:100
GLfloat f
Definition: glcorearb.h:1925
virtual bool checkValid(int cvLen, int bLen, bool doesWrap) const =0
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
GLintptr offset
Definition: glcorearb.h:664
virtual void weights(unsigned short onOff)
GA_Basis * getBasis(void)
Definition: GEO_Curve.h:294
bool evaluate(fpreal u, GEO_Vertex result, GEO_AttributeHandleList &gah, int du=0, int uOffset=-1) const
#define GEO_API
Definition: GEO_API.h:10
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:302
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
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:1221
virtual int open(float queuesize)
#define GEO_FAMILY_CURVE
Definition: GEO_PrimType.h:73
unsigned int uint
Definition: SYS_Types.h:33
GLint GLsizei count
Definition: glcorearb.h:404
int64 getBaseMemoryUsage() const
Report approximate memory usage for myVertexList for subclasses.
GLfloat v0
Definition: glcorearb.h:815
GLfloat GLfloat GLfloat GLfloat h
Definition: glcorearb.h:2001
double fpreal
Definition: SYS_Types.h:263
GLenum GLfloat param
Definition: glcorearb.h:103
GT_Basis myBasis
Definition: GT_CurveEval.h:262
const GA_Basis * getBasis(void) const
Definition: GEO_Curve.h:293
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:97
virtual float realToUnitDomain(float u_real) const
virtual bool jsonLoadBasis(UT_JSONParser &p)
virtual ~GEO_Curve()
Definition: GEO_Curve.h:52
virtual bool jsonSaveBasis(UT_JSONWriter &w) const
GLuint index
Definition: glcorearb.h:785
int setBasis(GA_Basis *ub)
Definition: GEO_Curve.h:280
GLfloat GLfloat v1
Definition: glcorearb.h:816
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
void setAnyBasis(GA_Basis *ub)
Definition: GEO_Curve.h:295
Class to store JSON objects as C++ objects.
Definition: UT_JSONValue.h:75
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:107
static GA_PrimitiveFamilyMask buildFamilyMask()
Definition: GEO_Face.h:394
Container class for all geometry.
Definition: GA_Detail.h:96
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:856
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:237
GLboolean r
Definition: glcorearb.h:1221
#define const
Definition: zconf.h:214
bool isDegenerate() const override
Is the primitive degenerate.
static GA_PrimitiveFamilyMask buildFamilyMask()
Definition: GEO_Curve.h:413
GLint lod
Definition: glcorearb.h:2764
friend std::ostream & operator<<(std::ostream &os, const GEO_Curve &d)
Definition: GEO_Curve.h:475
int keep
Definition: png.h:2568
GLsizei GLenum GLenum GLuint GLenum GLsizei * lengths
Definition: glcorearb.h:2541
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:1792
GA_DECLARE_INTRINSICS(override)