HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GEO_Hull.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 is used as a base class for all patch types supported.
10  * The vertex list management is handled by this class, however, all
11  * other function should be handled by the subclass.
12  * The insertRow and insertCol are meant to be virtual since it
13  * may be possible for the patch type to insert a row or column
14  * without distorting the shape of the patch (as in NURBs or MESH)
15  *
16  */
17 
18 #pragma once
19 
20 #ifndef __GEO_Hull_H__
21 #define __GEO_Hull_H__
22 
23 #include "GEO_API.h"
24 #include "GEO_Primitive.h"
25 #include "GEO_SurfaceType.h"
26 #include "GEO_Vertex.h"
27 #include <GA/GA_OffsetMatrix.h>
28 #include <UT/UT_Assert.h>
29 #include <UT/UT_RefMatrix.h>
30 #include <UT/UT_Vector3.h>
31 #include <iosfwd>
32 
33 class UT_BitArray;
34 class GA_Detail;
35 class GA_EdgeGroup;
36 class UT_JSONWriter;
37 class UT_JSONParser;
38 class GA_SaveMap;
39 class GA_LoadMap;
40 
41 template<typename T, bool B> class GA_EdgeT;
43 
45 {
46 public:
48  {
49  wrapu = 0;
50  wrapv = 0;
51  }
52  bool wrapu:1;
53  bool wrapv:1;
54  bool loadBinary( UT_IStream &is );
55  int saveBinary( std::ostream &os ) const;
56 };
57 
59 {
60 public:
62  {
63  wrapu = 0; wrapv = 0;
64  dupTop = 0; dupLeft = 0;
65  dupBottom = 0; dupRight = 0;
66  breakThread = 0; breakBridge = 0;
67  recurse = 1;
68  }
69 
70  unsigned wrapu:1,
71  wrapv:1,
72  dupTop:1,
73  dupLeft:1,
74  dupBottom:1,
75  dupRight:1,
76  breakThread:1,
77  breakBridge:1,
78  recurse:1;
79 };
80 
82 {
83 public:
84  GEO_SubHullPart() { h_edge = v_edge = d_edge = flags = 0; }
85 
86  int h_edge;
87  int v_edge;
88  int d_edge;
89  int flags;
90  // `flags' is used as follows:
91  // Bit 0 - horizontal edge is used to break into a subhull
92  // Bit 1 - vertical edge " "
93  // Bit 2 - diagonal edge " "
94 
95  bool operator==(const GEO_SubHullPart &p) const
96  { return( (h_edge==p.h_edge) &&
97  (v_edge==p.v_edge) &&
98  (d_edge==p.d_edge) &&
99  (flags ==p.flags ) );
100  }
101  bool operator!=(const GEO_SubHullPart &p) const
102  { return !(*this == p); }
103 };
104 
106 {
107 public:
108  GEO_SubHull() : mat() {}
109 
111  int v_rows, v_cols;
112  int h_rows, h_cols;
113  int d_rows, d_cols;
114 };
115 
117 {
118 protected:
119  /// NOTE: The constructor should only be called from subclass
120  /// constructors.
122  : GEO_Primitive(d, offset)
124  , myRows(0)
125  , myCols(0)
126 #endif
127  {}
128 
129 #if !GA_PRIMITIVE_VERTEXLIST
130  /// NOTE: The destructor should only be called from subclass
131  /// destructors.
132  virtual ~GEO_Hull();
133 #endif
134 
135 public:
136  bool saveVertexArray(UT_JSONWriter &w,
137  const GA_SaveMap &save) const;
138  bool loadVertexArray(UT_JSONParser &p,
139  const GA_LoadMap &load);
140 
141  // Compute the location of the breakpoint. Return 0 if OK, else -1.
142  virtual int evaluateBreakpoint(int uidx, int vidx,
143  UT_Vector4 &pos,
144  int du=0, int dv=0) const = 0;
145 
146  // Evaluate one point (when du=dv=0), or the du-th dv-th derivative.
147  // Returns true if successful, and false otherwise.
148  bool evaluateIndex(fpreal u, fpreal v, GA_Offset result_vtx,
149  GA_AttributeRefMap &hlist,
150  unsigned du, unsigned dv) const
151  { return evaluateIndexRefMap(u, v, result_vtx, hlist, du, dv); }
152  int evaluateIndex(float iu, float iv, UT_Vector4 &pos,
153  unsigned du=0, unsigned dv=0) const
154  { return evaluateIndexV4(iu, iv, pos, du, dv); }
155 
157  UT_Array<GA_Offset> &vtxlist,
158  UT_Array<float> &weightlist,
159  fpreal u, fpreal v, fpreal w) const override;
160 
161  void normal(NormalComp &output) const override;
162  void normal(NormalCompD &output) const override;
163 
164  // Evaluate the normal using unit u and v coordinates (i.e. in [0,1]).
165  // The normal is not normalized. The method does NOT fail if the point
166  // attribute is missing. We return 0 if OK and -1 if error.
167  int evaluateNormalVector(UT_Vector3 &nml, float u,
168  float v = 0, float w = 0) const override;
169 
170  // Evaluate the normal at real (u,v). The method does not fail if there
171  // is no point attribute, it instead just returns the face normal.
172  // Return 0 if successful, and -1 otherwise.
173  virtual int evaluateNormal(float u,float v, UT_Vector3 &nml) const;
174  virtual int normalIndex(float iu, float iv, UT_Vector3 &nml) const;
175 
176  virtual int uMinValidIndex() const;
177  virtual int uMaxValidIndex() const;
178  virtual int vMinValidIndex() const;
179  virtual int vMaxValidIndex() const;
180 
181  bool saveH9(std::ostream &os, bool binary,
182  const UT_Array<GA_AttribSaveDataH9> &prim_attribs,
183  const UT_Array<GA_AttribSaveDataH9> &vtx_attribs) const override;
184  bool loadH9(UT_IStream &is,
185  const UT_Array<GA_AttribLoadDataH9> &prim_attribs,
186  const UT_Array<GA_AttribLoadDataH9> &vtx_attribs) override;
187  bool getBBox(UT_BoundingBox *bbox) const override;
188  void addToBSphere(UT_BoundingSphere *bsphere) const override;
189  UT_Vector3 baryCenter() const override;
190  UT_Vector3D baryCenterD() const override;
191  UT_Vector3 computeNormal() const override;
192  UT_Vector3D computeNormalD() const override;
193  void copyPrimitive(const GEO_Primitive *src) override;
194  GEO_Primitive *copy(int preserve_shared_pts = 0) const override;
195 
196  void copySubclassData(const GA_Primitive *source) override;
197 
198 #if !GA_PRIMITIVE_VERTEXLIST
199  void addPointRefToGroup(GA_PointGroup &grp) const override;
200 #endif
201 
202  // Reverse rows (V) and/or columns (U):
203  void reverse () override;
204  virtual void reverseU();
205  virtual void reverseV();
206 
207  // Shift the array of vertices by an offset and wrap around. The offset
208  // can be either negative or positive. Cycles in complete rows/cols
209  virtual int cycleU(int amount, int = 1);
210  virtual int cycleV(int amount, int = 1);
211 
212  // All current rows and columns will be reinitialized
213  int setRowCol(int r, int c);
214  virtual int insertRow(unsigned int beforeWhich, bool appendPts=true);
215  int appendRow(bool appendPts=true)
216  {
217 #if GA_PRIMITIVE_VERTEXLIST
218  return insertRow(myRows, appendPts);
219 #else
220  return insertRow(myVertexMatx.getRows(), appendPts);
221 #endif
222  }
223  virtual int insertCol(unsigned int beforeWhich, bool appendPts=true);
224  int appendCol(bool appendPts=true)
225  {
226 #if GA_PRIMITIVE_VERTEXLIST
227  return insertCol(myCols, appendPts);
228 #else
229  return insertCol(myVertexMatx.getCols(), appendPts);
230 #endif
231  }
232 
233  virtual int deleteRow(unsigned int which);
234  virtual int deleteCol(unsigned int which);
235 
236  // Take the whole set of points into consideration when applying the
237  // point removal operation to this primitive. The method returns 0 if
238  // successful, -1 if it failed because it would have become degenerate,
239  // and -2 if it failed because it would have had to remove the primitive
240  // altogether.
241  int detachPoints (GA_PointGroup &grp) override;
242 
243  /// Before a point is deleted, all primitives using the point will be
244  /// notified. The method should return "false" if it's impossible to
245  /// delete the point. Otherwise, the vertices should be removed.
246  GA_DereferenceStatus dereferencePoint(
247  GA_Offset point, bool dry_run=false) override;
248  GA_DereferenceStatus dereferencePoints(
249  const GA_RangeMemberQuery &pt_q, bool dry_run=false) override;
250 
251  // Given a parameter in the domain, insert as many CVs as necessary to
252  // create a discontinuity at the corresponding point on the curve.The shape
253  // of the curve should NOT change. Return u's index upon success and -1
254  // otherwise.
255  int subdivideU(float u, GA_AttributeRefMap &map)
256  { return subdivideURefMap(u, map); }
257  int subdivideU(float u)
258  { return subdivideUFloat(u); }
259  int subdivideV(float u, GA_AttributeRefMap &map)
260  { return subdivideVRefMap(u, map); }
261  int subdivideV(float u)
262  { return subdivideVFloat(u); }
263 
264  virtual void subdivide(int numdivs, GA_PointGroup *ptgroup=0);
265 
266  // Warp the hull at u,v by the given delta. Change 1 or 4 Cvs and possibly
267  // insert a knot once or more as well. If a knot is inserted or we happen
268  // to land exactly on a knot, we change only one CV. The bias makes sense
269  // only when changing 4 CVs, and will be ignored altogether if < 0.
270  // We return the CV index in warpU/V and 0 in warp() if OK; -1 otherwise.
271  virtual int warpU(float u, const UT_Vector3 &delta,
272  GA_AttributeRefMap &map,
273  float sharpness = 0.0f, float bias = -1.0f) = 0;
274  virtual int warpV(float v, const UT_Vector3 &delta,
275  GA_AttributeRefMap &map,
276  float sharpness = 0.0f, float bias = -1.0f) = 0;
277  virtual int warp (float u, float v, const UT_Vector3 &delta,
278  GA_AttributeRefMap &map,
279  float usharpness = 0.0f, float vsharpness = 0.f,
280  float ubias = -1.0f, float vbias = -1.0f) = 0;
281 
282 
283  // Warp the hull along its normal at u,v. We warp u if the flag is 0,
284  // warp v if flag is 1, and warp both if flag is 2.
285  // We return 0 if OK, or -1 if there's an error.
286  int warpAlongNormal (float u, float v, float distance,
287  GA_AttributeRefMap &map,
288  float usharpness, float vsharpness,
289  float ubias, float vbias,
290  int u_v_both);
291 
292  // Append another hull to us in one of two ways: blend the two endpoints
293  // or connect them straight or rounded. The bias ranges from 0 to 1 and is
294  // relevant only to blending. The tolerance for blending: if 0, the two
295  // endpoints will merge into one point with a discontinuity; if less than
296  // 1, we insert knots into the hulls to minimize the affected areas; if 1,
297  // no refinement is done. For the non-blend case, the tolerance will
298  // generate a span whose shape goes from round to straight; 0 tolerance
299  // means straight connection. If unrefine is on, we'll try to reduce the
300  // complexity of the hull if we're connecting rounded. We return 0 if OK
301  // and -1 if error. Both hulls must be open and have the same order.
302  virtual int attachU(const GEO_Hull &hull, int blend = 1,
303  float bias = 0.5f, float tolerance = 1.0f,
304  int unrefine=1, GA_PointGroup *ptgroup=0) = 0;
305  virtual int attachV(const GEO_Hull &hull, int blend = 1,
306  float bias = 0.5f, float tolerance = 1.0f,
307  int unrefine=1, GA_PointGroup *ptgroup=0) = 0;
308 
309  // Change the multiplicity of the domain value by inserting it after
310  // checking its current multiplicity. Return -1 if invalid, otherwise
311  // return the index of the inserted knot
312 
313  virtual int refineU(float k,
314  GA_AttributeRefMap &hlist,
315  int i=1);
316 
317  virtual int refineU ( float k, int i=1);
318  virtual int refineV(float k,
319  GA_AttributeRefMap &hlist,
320  int i=1);
321  virtual int refineV ( float k, int i=1);
322 
323  // Refine numdivs times in each span.
325  int numdivs=1)
326  { spanRefineURefMap(map, numdivs); }
327  void spanRefineU( int numdivs=1)
328  { spanRefineUInt(numdivs); }
330  int numdivs=1)
331  { spanRefineVRefMap(map, numdivs); }
332  void spanRefineV( int numdivs=1)
333  { spanRefineVInt(numdivs); }
334 
335  // Remove rows and or columns based on a curvature tolerance. Return 1 of
336  // something was removed, else 0.
338  int mult=0, float tol=1e-4f,
339  GA_PointGroup *delgroup=0)
340  { return unrefineURefMap(kidx, h, mult,
341  tol, delgroup); }
342  int unrefineU(int kidx, int mult = 0,
343  float tol = 1e-4F,
344  GA_PointGroup *delgroup = 0)
345  { return unrefineUFloat(kidx, mult, tol,
346  delgroup); }
348  int mult=0, float tol=1e-4f,
349  GA_PointGroup *delgroup=0)
350  { return unrefineVRefMap(kidx, h, mult,
351  tol, delgroup); }
352  int unrefineV(int kidx, int mult = 0,
353  float tol = 1e-4F,
354  GA_PointGroup *delgroup = 0)
355  { return unrefineVFloat(kidx, mult, tol,
356  delgroup); }
357 
358  // If the hull is wrapped in U and/or V, explicitly add the wrapped vertex
359  // and open the hull in the direction(s) it's wrapped in.
360  virtual void fixSeamsU();
361  virtual void fixSeamsV();
362 
363  /// Apply row-column texture. If ptattrib is true, we deal with
364  /// points, else with vertices. Returns false iff problems.
365  bool rowColTexture(const GA_RWHandleV3 &txth, bool ptattrib);
366 
369 #if GA_PRIMITIVE_VERTEXLIST
370  { return myRows; }
371 #else
372  { return (int)myVertexMatx.getRows(); }
373 #endif
376 #if GA_PRIMITIVE_VERTEXLIST
377  { return myCols; }
378 #else
379  { return (int)myVertexMatx.getCols(); }
380 #endif
381 
382  /// This should only be used for initializing member data after
383  /// creating a hull primitive via appendPrimitive
384  /// and initializing its vertex list.
385  /// To initialize GEO_TPSurf primitives, also call setUBasis and setVBasis
386  /// with the appropriate type of basis.
387  ///
388  /// NOTE: rows corresponds with v, and cols corresponds with u
390  void initHullData(int rows, int cols, bool wrapv, bool wrapu)
391  {
392  UT_ASSERT(myRows == 0 && myCols == 0);
393  UT_ASSERT(rows*exint(cols) == getVertexCount());
394  myRows = rows;
395  myCols = cols;
396  flags.wrapv = wrapv;
397  flags.wrapu = wrapu;
398  }
399 
400  // Subscript operators. The const version does not check the boundaries.
401  // For safer but slower use, call getVertex() and setVertex().
403  SYS_DEPRECATED_HDK(13.0)
404  const GEO_Vertex operator()(unsigned int r, unsigned int c) const
405  { return getVertexElement(r, c); }
406  SYS_DEPRECATED_HDK(13.0)
407  GEO_Vertex operator()(unsigned int r, unsigned int c)
408  { return getVertexElement(r, c); }
409 
411  SYS_DEPRECATED_HDK(13.0)
412  const GEO_Vertex getVertexElement(unsigned int r, unsigned int c) const;
413 
414 #if GA_PRIMITIVE_VERTEXLIST
416 #endif
417 
418  SYS_FORCE_INLINE GA_Offset getVertexOffset(unsigned int r, unsigned int c) const
419  {
420  UT_ASSERT_P(r < getNumRows() && c < getNumCols());
421  if (r >= getNumRows() || c >= getNumCols())
422  return GA_INVALID_OFFSET;
423 #if GA_PRIMITIVE_VERTEXLIST
424  return getVertexOffset(r*exint(myCols) + c);
425 #else
426  return myVertexMatx(r, c);
427 #endif
428  }
429  SYS_FORCE_INLINE GA_Index getVertexIndex(unsigned int r, unsigned int c) const
430  {
431  GA_Offset vtxoff = getVertexOffset(r, c);
432  return GAisValid(vtxoff) ? getDetail().vertexIndex(vtxoff)
434  }
435  SYS_FORCE_INLINE GA_Offset getPointOffset(unsigned int r, unsigned int c) const
436  {
437  if (r >= getNumRows() || c >= getNumCols())
438  {
439  UT_ASSERT(!"Invalid offset");
440  return GA_INVALID_OFFSET;
441  }
442 
443  return vertexPoint(r, c);
444  }
445  SYS_FORCE_INLINE GA_Index getPointIndex(unsigned int r, unsigned int c) const
446  {
447  GA_Offset ptoff = getPointOffset(r, c);
448  return GAisValid(ptoff) ? getDetail().pointIndex(ptoff)
450  }
451  SYS_FORCE_INLINE UT_Vector3 getPos3(unsigned int r, unsigned int c) const
452  { return getDetail().getPos3(getPointOffset(r, c)); }
453  SYS_FORCE_INLINE void setPos3(unsigned int r, unsigned int c, const UT_Vector3 &pos) const
454  { getDetail().setPos3(getPointOffset(r, c), pos); }
455  SYS_FORCE_INLINE UT_Vector4 getPos4(unsigned int r, unsigned int c) const
456  { return getDetail().getPos4(getPointOffset(r, c)); }
457  SYS_FORCE_INLINE void setPos4(unsigned int r, unsigned int c, const UT_Vector4 &pos) const
458  { getDetail().setPos4(getPointOffset(r, c), pos); }
459  SYS_FORCE_INLINE void setPointOffset(unsigned int r, unsigned int c, GA_Offset ptoff) const
460  { getDetail().setVertexPoint(getVertexOffset(r,c), ptoff); }
461 
463  {
464  return exint(getNumRows()) * exint(getNumCols());
465  }
466  void setVertexPoint(unsigned int r, unsigned int c, GA_Offset pt)
467  {
468  if (r >= getNumRows() || c >= getNumCols())
469  return;
470 
471  setPointOffset(r, c, pt);
472  }
473 
474 #if !GA_PRIMITIVE_VERTEXLIST
475  void beginVertex(const_iterator &i) const override;
476  void nextVertex(const_iterator &i) const override;
477 #endif
478 
479  GEO_SurfaceType getSurfaceType() const { return surfaceType; }
480  void setSurfaceType(GEO_SurfaceType t) { surfaceType = t; }
481 
482  /// @{
483  /// Get or set the surface type by name token
484  const char *getSurfaceTypeName() const;
485  bool setSurfaceTypeName(const char *name);
486  /// @}
487 
488  bool isWrappedU() const { return flags.wrapu; }
489  bool isWrappedV() const { return flags.wrapv; }
490 
491  /// @{
492  /// Convenience method to set wrapping based on intrinsic properties
493  bool setWrapU(bool dowrap);
494  bool setWrapV(bool dowrap);
495  /// @}
496 
497  virtual void wrapU(int rounded = 1, int preserveShape = 0);
498  virtual void openU(int preserveShape = 0, int safe = 0);
499  virtual void wrapV(int rounded = 1, int preserveShape = 0);
500  virtual void openV(int preserveShape = 0, int safe = 0);
501 
502  virtual bool isClampedU() const;
503  virtual bool isClampedV() const;
504 
505  // Assuming the hull is closed in u/v, "unroll" it so that the CVs that are
506  // shared to form a wrapped surface are made unique. Also, the hull becomes
507  // open. The base class method only flips the open flag. If the face is
508  // not closed, the method returns -1. Otherwise it returns 0.
509  virtual int unrollU(int append_pts = 1);
510  virtual int unrollV(int append_pts = 1);
511 
512  bool hasEdge(const GA_Edge &edge) const override;
513 
514  // Check degenerate condition by testing face area in u and v
515  bool isDegenerate() const override;
516 
517 #if !GA_PRIMITIVE_VERTEXLIST
518  bool vertexApply(bool (*apply)(GA_Offset vtx, void *),
519  void *data = nullptr) const override;
520 #endif
521 
522  void iterateEdges(GA_IterateEdgesFunc apply_func) const override;
523  void iterateEdgesByVertex(GA_IterateEdgesByVertexFunc apply_func) const override;
524 
525 #if !GA_PRIMITIVE_VERTEXLIST
526  GA_Size getVertexCount() const override;
527  GA_Offset getVertexOffset(GA_Size index) const override;
528 #endif
529 
530  /// return the index of a vertex within our vertex list
531 #if GA_PRIMITIVE_VERTEXLIST
532  GA_Size findVertex(GA_Offset vtx) const { return myVertexList.find(vtx); }
533 #else
534  GA_Size findVertex(GA_Offset vtx) const { return myVertexMatx.find(vtx); }
535 #endif
536 
537  // Have we been deactivated and stashed?
538  void stashed(bool beingstashed,
539  GA_Offset offset = GA_INVALID_OFFSET) override;
540 
541  // Raise the number of CVs to match the newcount. The shape of the face
542  // (especially if parametric) should NOT change. Return 0 upon success
543  // and -1 otherwise. start and stop define which indices to examine
544  // if newcount is negative it is taken as a relative value.
545  virtual int loftU(int newcount, int start=-1, int stop=-1) = 0;
546  virtual int loftV(int newcount, int start=-1, int stop=-1) = 0;
547 
548 
549  // Convert the real domain values of the primitive to unit values to be
550  // used in the common evaluation methods:
551  void realToUnitPair(float ureal, float vreal,
552  float &uunit, float &vunit) const override;
553  // and vice versa
554  void unitToRealPair(float uunit, float vunit,
555  float &ureal, float &vreal) const override;
556 
557  // Go from a normalized domain ([0,1]) to the real domain or vice versa.
558  // In the base class (i.e. here) the real domain ranges from 0 to
559  // vertexcount - 1 + isWrapped() for u and v respectively.
560  virtual void unitToRealDomain(float u_unit, float v_unit,
561  float &u_real, float &v_real) const;
562  virtual void realToUnitDomain(float u_real, float v_real,
563  float &u_unit, float &v_unit) const;
564 
565  // Calculate the real domains for n consecutive operations on the domain
566  // given n normalized domains and the operation
567 
568  virtual void unitToRealSequenceU(float *uunit, float *ureal,
569  int ulen) const;
570  virtual void unitToRealSequenceV(float *vunit, float *vreal,
571  int vlen) const;
572 
573  // Finds the vertex#'s of the end points of an edge.
574  // returns 0 if it fails (the edge is not on the hull) , 1 if it succeeds
575  virtual int findEdgePoints(const GA_Edge &edge,
576  int *pr0, int *pc0,
577  int *pr1, int *pc1) const;
578 
579  virtual int findEdgePoints(GA_Offset a, GA_Offset b,
580  int *pr0, int *pc0,
581  int *pr1, int *pc1) const;
582 
583  // This method fills the horizontal and vertical edge matrices
584  // based on the input linked list. An element of the matrix is
585  // non-zero if one of the selected edges exists on that spot on the
586  // hull, and zero otherwise. It returns 0 if no edges are on the hull,
587  // and 1 if at least one edge matches.
588  int makeEdgeMatrix(const GA_EdgeGroup &edges,
589  GEO_SubHull &subhull);
590 
591  // Append n points equally spaced between the 1st and last vertex.
592  void sampleEndsU(int n);
593  void sampleEndsV(int n);
594 
595  // Return the bounds of the valid evaluation interval in domain space:
596  // For meshes this refers to cv indices.
597  virtual void validURange(float &ua, float &ub) const;
598  virtual void validVRange(float &va, float &vb) const;
599  virtual void validUInterval(int &a, int &b) const;
600  virtual void validVInterval(int &a, int &b) const;
601 
602  // Find enclosing integral values(c1, c2) which validly enclose c
603  // and return the distance to c1
604  float getIndices(float c, int &c1, int &c2,
605  int maxIndex, int wrap) const;
606 
607  // Reverse the roles of rows and columns
608  virtual void transpose();
609 
610  // Return the surrounding values of the real-space u,v parameters.
611  // Returns 1 if succesful, 0 if out-of-range.
612  int parametricBBox(float u, float v,
613  float *u0, float *u1,
614  float *v0, float *v1) override;
615 
616  // Find distance in parameter space, aware of wrapping.
617  float uvDist(float u1, float v1, float u2, float v2) const override;
618 
619  virtual void weights(unsigned short onOff);
620 
621  fpreal calcVolume(const UT_Vector3 &refpt) const override;
622  fpreal calcArea() const override;
623  fpreal calcPerimeter() const override;
624 
625  template <typename S>
626  static const inline UT_Vector3T<S> quadNormal(
627  const UT_Vector3T<S> &p1, const UT_Vector3T<S> &p2,
628  const UT_Vector3T<S> &p3, const UT_Vector3T<S> &p4)
629  {
630  UT_Vector3T<S> nml(0, 0, 0);
631  nml.normal(p1, p2);
632  nml.normal(p2, p3);
633  nml.normal(p3, p4);
634  nml.normal(p4, p1);
635 
636  nml.normalize();
637  return nml;
638  }
639 
640  /// This is a wrapper for a single quad of a GEO_Hull, so that
641  /// it can be treated like a GEO_PrimPoly in a template.
642  class Poly {
643  public:
644  Poly(const GEO_Hull &hull, const exint row, const exint col)
645  : myHull(hull)
646  , myRow(row)
647  , myCol(col)
648  , myRowP1((row+1 == hull.getNumRows()) ? 0 : (row+1))
649  , myColP1((col+1 == hull.getNumCols()) ? 0 : (col+1))
650  {}
652  { return 4; }
654  { return myHull.getVertexOffset((i >= 2) ? myRowP1 : myRow, (i==1 || i==2) ? myColP1 : myCol); }
656  { return myHull.getPointOffset((i >= 2) ? myRowP1 : myRow, (i==1 || i==2) ? myColP1 : myCol); }
658  { return myHull.getPos3((i >= 2) ? myRowP1 : myRow, (i==1 || i==2) ? myColP1 : myCol); }
660  { return true; }
661  float calcArea() const
662  {
663  UT_Vector3 p[4];
664  for (GA_Size i = 0; i < getFastVertexCount(); ++i)
665  p[i] = getPos3(i);
666  float area = cross(p[0]-p[1],p[2]-p[1]).length()
667  + cross(p[0]-p[3],p[2]-p[3]).length();
668  area *= 0.5f;
669  return area;
670  }
671  private:
672  const GEO_Hull &myHull;
673  const exint myRow;
674  const exint myRowP1;
675  const exint myCol;
676  const exint myColP1;
677  };
678 
679 protected:
680 #if !GA_PRIMITIVE_VERTEXLIST
681  void clearForDeletion() override;
682 #endif
683 
684  template <typename T, typename NORMALCOMP>
685  void internalComputeNormal(NORMALCOMP &output) const;
686  template <typename T>
687  UT_Vector3T<T> internalComputeNormal() const;
688  template <typename T>
689  fpreal internalCalcVolume(const UT_Vector3T<T> &refpt) const;
690  template <typename T>
691  fpreal internalCalcArea() const;
692  template <typename T>
693  fpreal internalCalcPerimeter() const;
694 
695  void cycleOffsetListRows(int shift);
696  void cycleOffsetListCols(int shift);
697 
699  { return GEO_FAMILY_HULL; }
700 
701  // Declare intrinsic attribute functions
702  GA_DECLARE_INTRINSICS(override);
703 
704  // The following three methods are used by removeEdges to
705  // remove all possible selected edges from a hull.
706 
707  // This computes where the hull needs to be split, recursing downwards
708  // if necessary. It calls getSubHull to split the hulls. Returns 1 if
709  // the hull needs to be deleted as a result of breaking.
710  int breakHull(GEO_SubHull &subhull,
711  int top, int left, int bottom, int right,
712  GEO_SubHullFlags break_flags);
713 
714  // This figures out which edges were actually used in the edge deletion.
715  // It returns 1 if all the selected edges were used, 0 if some were not
716  int checkUsedEdges(UT_BitArray *remove_edges,
717  const GEO_SubHull &subhull);
718 
719  // Implemented in GU. Gets a part of this hull, creating a new one
720  // if break_flags.recurse is set.
721  virtual GEO_Hull *getSubHull(int top, int left, int bottom, int right,
722  GEO_SubHullFlags break_flags) = 0;
723 
724  // Speacial save and load methods for the sub-classes:
725  virtual bool savePrivateH9(std::ostream &os, bool binary) const = 0;
726  virtual bool loadPrivateH9(UT_IStream &is) = 0;
727  virtual bool saveExtraH9 (std::ostream &os, bool binary) const = 0;
728  virtual bool loadExtraH9 (UT_IStream &is) = 0;
729 
730  // Check the validity of the data. Meant to be called especially at loading
731  // time. The method returns 1 if OK and 0 if trouble.
732  virtual bool validate() const = 0;
733 
734  // Clip or wrap c to find enclosing integral values(c1, c2)
735  // and return the distance to c1
736  float getLRIndex(float c, int &c1, int &c2,
737  int minIndex, int maxIndex, int wrap) const;
738 
739  /// @warning vertexPoint() doesn't check the bounds. Use with caution.
741  {
742  UT_ASSERT_P(r < getNumRows() && c < getNumCols());
743 #if GA_PRIMITIVE_VERTEXLIST
744  return getDetail().vertexPoint(getVertexOffset(r*exint(myCols) + c));
745 #else
746  return getDetail().vertexPoint(myVertexMatx(r,c));
747 #endif
748  }
749 
750 #if !GA_PRIMITIVE_VERTEXLIST
751  /// Defragmentation
752  void swapVertexOffsets(const GA_Defragment &defrag) override;
753 #endif
754 
755 #if GA_PRIMITIVE_VERTEXLIST
757  GA_Size matrixIndex(int r, int c) const
758  {
759  UT_ASSERT_P(r < getNumRows() && c < getNumCols());
760  return r*exint(myCols) + c;
761  }
762 
763  int myRows;
764  int myCols;
765 #else
767 #endif
770 
771  bool evaluateBaryCenterRefMap(GA_Offset result_vertex,
772  GA_AttributeRefMap &map) const override;
773 
774  // Evaluate one point (when du=dv=0), or the du-th dv-th derivative.
775  // Return 0 if successful, and -1 otherwise.
776  virtual bool evaluateIndexRefMap(fpreal u, fpreal v, GA_Offset result_vtx,
777  GA_AttributeRefMap &hlist,
778  unsigned du, unsigned dv) const;
779  virtual int evaluateIndexV4(float iu, float iv, UT_Vector4 &pos,
780  unsigned du=0, unsigned dv=0) const;
781 
782  virtual int subdivideURefMap(float u, GA_AttributeRefMap &map);
783  virtual int subdivideUFloat(float u);
784  virtual int subdivideVRefMap(float u, GA_AttributeRefMap &map);
785  virtual int subdivideVFloat(float u);
786 
787  // Refine numdivs times in each span.
788  virtual void spanRefineURefMap(GA_AttributeRefMap &map,
789  int numdivs=1) = 0;
790  virtual void spanRefineUInt( int numdivs=1) = 0;
791  virtual void spanRefineVRefMap(GA_AttributeRefMap &map,
792  int numdivs=1) = 0;
793  virtual void spanRefineVInt( int numdivs=1) = 0;
794 
795  virtual int unrefineURefMap(int kidx, GA_AttributeRefMap &h,
796  int mult=0, float tol=1e-4f,
797  GA_PointGroup *delgroup=0);
798  virtual int unrefineUFloat(int kidx, int mult = 0,
799  float tol = 1e-4F,
800  GA_PointGroup *delgroup = 0);
801  virtual int unrefineVRefMap(int kidx, GA_AttributeRefMap &h,
802  int mult=0, float tol=1e-4f,
803  GA_PointGroup *delgroup=0);
804  virtual int unrefineVFloat(int kidx, int mult = 0,
805  float tol = 1e-4F,
806  GA_PointGroup *delgroup = 0);
807 
808 #if !GA_PRIMITIVE_VERTEXLIST
809  /// Report approximate memory usage for myVertexMatx (exclusive)
810  int64 getBaseMemoryUsage() const;
811 
812  // This is called by the subclasses to count the
813  // memory used by myVertexMatx (exclusive)
814  void countBaseMemory(UT_MemoryCounter &counter) const;
815 #endif
816 
817 private:
818  friend std::ostream &operator<<(std::ostream &os, const GEO_Hull &d)
819  {
820  d.saveH9(os, 0,
823  return os;
824  }
825  void increaseDensityInRows(GA_AttributeRefMap &m,
826  int numdivs, GA_PointGroup *pgp);
827  void increaseDensityInCols(GA_AttributeRefMap &m,
828  int numdivs, GA_PointGroup *pgp);
830 };
832 #endif
bool isWrappedU() const
Definition: GEO_Hull.h:488
SYS_FORCE_INLINE void setPos3(unsigned int r, unsigned int c, const UT_Vector3 &pos) const
Definition: GEO_Hull.h:453
fpreal calcPerimeter() const override
GLbitfield flags
Definition: glcorearb.h:1596
virtual GEO_Primitive * copy(int preserve_shared_pts=0) const
bool findEdgePoints(GA_Offset ptoff0, GA_Offset ptoff1, GA_Size &vtx0, GA_Size &vtx1) const
void spanRefineU(GA_AttributeRefMap &map, int numdivs=1)
Definition: GEO_Hull.h:324
SYS_FORCE_INLINE GA_Offset getPointOffset(GA_Size i) const
Definition: GA_Primitive.h:254
virtual UT_Vector3 baryCenter() const
SYS_FORCE_INLINE GA_Detail & getDetail() const
Definition: GA_Primitive.h:141
virtual void copyPrimitive(const GEO_Primitive *src)=0
SYS_FORCE_INLINE GA_Index getVertexIndex(unsigned int r, unsigned int c) const
Definition: GEO_Hull.h:429
bool isWrappedV() const
Definition: GEO_Hull.h:489
virtual void clearForDeletion()
Definition: GA_Primitive.h:682
Used to pass options and map offset values during saving.
Definition: GA_SaveMap.h:48
void spanRefineU(int numdivs=1)
Definition: GEO_Hull.h:327
SYS_FORCE_INLINE GA_Size getVertexCount() const
Return the number of vertices used by this primitive.
Definition: GA_Primitive.h:232
int unrefineU(int kidx, GA_AttributeRefMap &h, int mult=0, float tol=1e-4f, GA_PointGroup *delgroup=0)
Definition: GEO_Hull.h:337
GA_OffsetMatrix myVertexMatx
Definition: GEO_Hull.h:766
GEO_Vertex getVertexElement(GA_Size i) const
virtual UT_Vector3D computeNormalD() const =0
virtual void computeInteriorPointWeights(UT_Array< GA_Offset > &vtxlist, UT_Array< float > &weightlist, fpreal u, fpreal v, fpreal w) const
GLint left
Definition: glcorearb.h:2005
const GLdouble * v
Definition: glcorearb.h:837
#define SYS_DEPRECATED_PUSH_DISABLE()
UT_Vector4 getPos4(GA_Offset ptoff) const
The ptoff passed is the point offset.
Definition: GA_Detail.h:292
#define SYS_DEPRECATED_POP_DISABLE()
virtual void copySubclassData(const GA_Primitive *source)
Definition: GA_Primitive.h:508
GLuint start
Definition: glcorearb.h:475
bool GAisValid(GA_Size v)
Definition: GA_Types.h:649
SYS_FORCE_INLINE GA_Size getFastVertexCount() const
Definition: GEO_Hull.h:462
int unrefineU(int kidx, int mult=0, float tol=1e-4F, GA_PointGroup *delgroup=0)
Definition: GEO_Hull.h:342
const GLuint GLenum const void * binary
Definition: glcorearb.h:1924
fpreal calcVolume(const UT_Vector3 &) const override
static GA_PrimitiveFamilyMask buildFamilyMask()
Definition: GEO_Hull.h:698
GLdouble right
Definition: glad.h:2817
SYS_FORCE_INLINE GA_Size getFastVertexCount() const
Definition: GEO_Hull.h:651
GEO_SurfaceType surfaceType
Definition: GEO_Hull.h:769
SYS_FORCE_INLINE void setPointOffset(GA_Size i, GA_Offset ptoff)
Definition: GA_Primitive.h:260
int64 exint
Definition: SYS_Types.h:125
SYS_FORCE_INLINE GA_Offset getVertexOffset(unsigned int r, unsigned int c) const
Definition: GEO_Hull.h:418
SYS_FORCE_INLINE GA_Index getPointIndex(unsigned int r, unsigned int c) const
Definition: GEO_Hull.h:445
SYS_FORCE_INLINE void initHullData(int rows, int cols, bool wrapv, bool wrapu)
Definition: GEO_Hull.h:390
GLboolean GLboolean GLboolean GLboolean a
Definition: glcorearb.h:1222
int appendCol(bool appendPts=true)
Definition: GEO_Hull.h:224
int h_rows
Definition: GEO_Hull.h:112
virtual GA_DereferenceStatus dereferencePoint(GA_Offset point, bool dry_run=false)=0
JSON reader class which handles parsing of JSON or bJSON files.
Definition: UT_JSONParser.h:87
void reverse() override=0
Reverse the order of vertices.
#define GA_DECLARE_INTRINSICS(OVERRIDE)
Definition: GA_Primitive.h:80
SYS_FORCE_INLINE GA_Offset getPointOffset(unsigned int r, unsigned int c) const
Definition: GEO_Hull.h:435
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:37
SYS_FORCE_INLINE void setPos4(unsigned int r, unsigned int c, const UT_Vector4 &pos) const
Definition: GEO_Hull.h:457
Abstract base class for a range membership query object.
SYS_FORCE_INLINE UT_Vector3 getPos3(GA_Offset ptoff) const
The ptoff passed is the point offset.
Definition: GA_Detail.h:185
SYS_FORCE_INLINE bool isClosed() const
Definition: GEO_Hull.h:659
GLfloat GLfloat GLfloat v2
Definition: glcorearb.h:818
UT_Function< bool(const GA_Edge &edge)> GA_IterateEdgesFunc
Definition: GA_Primitive.h:73
int unrefineV(int kidx, int mult=0, float tol=1e-4F, GA_PointGroup *delgroup=0)
Definition: GEO_Hull.h:352
virtual int parametricBBox(float u, float v, float *u0, float *u1, float *v0, float *v1)
float calcArea() const
Definition: GEO_Hull.h:661
fpreal calcArea() const override
virtual void realToUnitPair(float ureal, float vreal, float &uunit, float &vunit) const
GLdouble u1
Definition: glad.h:2676
void setVertexPoint(GA_Offset vertex, GA_Offset ptoff)
Given a vertex, set the corresponding point offset.
Definition: GA_Detail.h:536
#define GEO_FAMILY_HULL
Definition: GEO_PrimType.h:78
virtual void swapVertexOffsets(const GA_Defragment &defrag)
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:235
SYS_FORCE_INLINE int64 getBaseMemoryUsage() const
Report approximate memory usage for myVertexList for subclasses.
Definition: GA_Primitive.h:840
SYS_FORCE_INLINE GA_Offset getPointOffset(GA_Size i) const
Definition: GEO_Hull.h:655
virtual bool loadH9(UT_IStream &is, const UT_Array< GA_AttribLoadDataH9 > &prim_attribs, const UT_Array< GA_AttribLoadDataH9 > &vtx_attribs)
GA_PrimitiveFamilyMask
bool saveH9(std::ostream &os, bool binary, const UT_Array< GA_AttribSaveDataH9 > &prim_attribs, const UT_Array< GA_AttribSaveDataH9 > &vtx_attribs) const override
virtual UT_Vector3 computeNormal() const =0
Return a normal vector for the primitive.
#define GA_INVALID_OFFSET
Definition: GA_Types.h:678
virtual void normal(NormalComp &output) const =0
bool evaluateIndex(fpreal u, fpreal v, GA_Offset result_vtx, GA_AttributeRefMap &hlist, unsigned du, unsigned dv) const
Definition: GEO_Hull.h:148
GEO_SurfaceType getSurfaceType() const
Definition: GEO_Hull.h:479
virtual bool isDegenerate() const =0
Is the primitive degenerate.
GA_Size GA_Offset
Definition: GA_Types.h:641
GLsizei GLboolean transpose
Definition: glcorearb.h:832
vint4 blend(const vint4 &a, const vint4 &b, const vbool4 &mask)
Definition: simd.h:4784
bool hasEdge(const GA_Edge &edge) const override
Method to determine if a primitive has an edge (undirected).
Poly(const GEO_Hull &hull, const exint row, const exint col)
Definition: GEO_Hull.h:644
GLdouble n
Definition: glcorearb.h:2008
GLfloat f
Definition: glcorearb.h:1926
int v_rows
Definition: GEO_Hull.h:111
GLintptr offset
Definition: glcorearb.h:665
void setPos4(GA_Offset ptoff, const UT_Vector4 &pos)
Set P from a UT_Vector4.
Definition: GA_Detail.h:302
int subdivideU(float u)
Definition: GEO_Hull.h:257
SIM_DerScalar length() const
friend std::ostream & operator<<(std::ostream &os, const GEO_Hull &d)
Definition: GEO_Hull.h:818
virtual UT_Vector3D baryCenterD() const
#define UT_ASSERT_P(ZZ)
Definition: UT_Assert.h:155
int evaluateIndex(float iu, float iv, UT_Vector4 &pos, unsigned du=0, unsigned dv=0) const
Definition: GEO_Hull.h:152
SYS_FORCE_INLINE int getNumRows() const
Definition: GEO_Hull.h:368
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
GLsizei GLsizei GLchar * source
Definition: glcorearb.h:803
UT_Function< bool(GA_Size, GA_Size)> GA_IterateEdgesByVertexFunc
Definition: GA_Primitive.h:74
bool operator==(const GEO_SubHullPart &p) const
Definition: GEO_Hull.h:95
int appendRow(bool appendPts=true)
Definition: GEO_Hull.h:215
#define GEO_API
Definition: GEO_API.h:14
void setVertexPoint(unsigned int r, unsigned int c, GA_Offset pt)
Definition: GEO_Hull.h:466
long long int64
Definition: SYS_Types.h:116
A handle to simplify manipulation of multiple attributes.
virtual void iterateEdges(GA_IterateEdgesFunc apply_func) const
Definition: GA_Primitive.h:362
SYS_FORCE_INLINE GA_Index vertexIndex(GA_Offset offset) const
Given a vertex's data offset, return its index.
Definition: GA_Detail.h:519
Options during loading.
Definition: GA_LoadMap.h:42
virtual float uvDist(float u1, float v1, float u2, float v2) const
Defragmentation of IndexMaps.
Definition: GA_Defragment.h:45
SYS_FORCE_INLINE GA_Offset vertexPoint(GA_Offset vertex) const
Given a vertex, return the point it references.
Definition: GA_Detail.h:529
void addPointRefToGroup(GA_PointGroup &grp) const
GLuint const GLchar * name
Definition: glcorearb.h:786
#define SYS_DEPRECATED_HDK(__V__)
GLdouble GLdouble u2
Definition: glad.h:2676
bool operator!=(const GEO_SubHullPart &p) const
Definition: GEO_Hull.h:101
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1222
GA_Size GA_Index
Define the strictness of GA_Offset/GA_Index.
Definition: GA_Types.h:635
virtual GA_DereferenceStatus dereferencePoints(const GA_RangeMemberQuery &pt_q, bool dry_run=false)=0
virtual bool saveH9(std::ostream &os, bool binary, const UT_Array< GA_AttribSaveDataH9 > &prim_attribs, const UT_Array< GA_AttribSaveDataH9 > &vtx_attribs) const
void spanRefineV(int numdivs=1)
Definition: GEO_Hull.h:332
GLdouble t
Definition: glad.h:2397
GLfloat v0
Definition: glcorearb.h:816
virtual bool evaluateBaryCenterRefMap(GA_Offset result_vtx, GA_AttributeRefMap &map) const
GLint GLint bottom
Definition: glcorearb.h:2005
SYS_FORCE_INLINE GA_Index pointIndex(GA_Offset offset) const
Given a point's data offset, return its index.
Definition: GA_Detail.h:349
virtual bool vertexApply(bool(*apply)(GA_Offset vtx, void *), void *data=0) const
GLfloat GLfloat GLfloat GLfloat h
Definition: glcorearb.h:2002
int subdivideU(float u, GA_AttributeRefMap &map)
Definition: GEO_Hull.h:255
void spanRefineV(GA_AttributeRefMap &map, int numdivs=1)
Definition: GEO_Hull.h:329
virtual int detachPoints(GA_PointGroup &grp)=0
SYS_FORCE_INLINE GA_Offset vertexPoint(GA_Size r, GA_Size c) const
Definition: GEO_Hull.h:740
SYS_FORCE_INLINE void setPos3(GA_Offset ptoff, const UT_Vector3 &pos)
Set P from a UT_Vector3.
Definition: GA_Detail.h:237
static const UT_Array< GA_AttribSaveDataH9 > & theEmptySaveAttribs
Convience objects to pass as arguments to saveH9()/loadH9().
fpreal64 fpreal
Definition: SYS_Types.h:277
int d_rows
Definition: GEO_Hull.h:113
virtual bool getBBox(UT_BoundingBox *bbox) const =0
GLuint index
Definition: glcorearb.h:786
virtual void unitToRealPair(float uunit, float vunit, float &ureal, float &vreal) const
SYS_FORCE_INLINE UT_Vector3 getPos3(unsigned int r, unsigned int c) const
Definition: GEO_Hull.h:451
GLfloat GLfloat v1
Definition: glcorearb.h:817
virtual int evaluateNormalVector(UT_Vector3 &nml, float u, float v=0, float w=0) const
SYS_FORCE_INLINE GA_Offset getVertexOffset(GA_Size primvertexnum) const
Definition: GA_Primitive.h:240
if(num_boxed_items<=0)
Definition: UT_RTreeImpl.h:697
#define GA_INVALID_INDEX
Definition: GA_Types.h:677
#define GA_PRIMITIVE_VERTEXLIST
Definition: GA_Primitive.h:16
GLdouble GLdouble GLdouble top
Definition: glad.h:2817
virtual void addToBSphere(UT_BoundingSphere *bsphere) const
SYS_FORCE_INLINE void setPointOffset(unsigned int r, unsigned int c, GA_Offset ptoff) const
Definition: GEO_Hull.h:459
GEO_SurfaceType
SYS_FORCE_INLINE UT_Vector3 getPos3(GA_Size i) const
Definition: GEO_Hull.h:657
Container class for all geometry.
Definition: GA_Detail.h:96
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:857
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
SYS_FORCE_INLINE int getNumCols() const
Definition: GEO_Hull.h:375
SYS_FORCE_INLINE UT_StorageMathFloat_t< T > normalize() noexcept
Definition: UT_Vector3.h:376
GLenum GLenum GLsizei void * row
Definition: glad.h:5135
ImageBuf OIIO_API warp(const ImageBuf &src, const Imath::M33f &M, string_view filtername=string_view(), float filterwidth=0.0f, bool recompute_roi=false, ImageBuf::WrapMode wrap=ImageBuf::WrapDefault, ROI roi={}, int nthreads=0)
int unrefineV(int kidx, GA_AttributeRefMap &h, int mult=0, float tol=1e-4f, GA_PointGroup *delgroup=0)
Definition: GEO_Hull.h:347
GLboolean r
Definition: glcorearb.h:1222
#define const
Definition: zconf.h:214
SIM_API const UT_StringHolder distance
SYS_FORCE_INLINE void normal(const UT_Vector3T< T > &va, const UT_Vector3T< T > &vb)
Definition: UT_Vector3.h:539
void countBaseMemory(UT_MemoryCounter &counter) const
UT_RefMatrix< GEO_SubHullPart > mat
Definition: GEO_Hull.h:110
SIM_DerVector3 cross(const SIM_DerVector3 &lhs, const SIM_DerVector3 &rhs)
virtual void iterateEdgesByVertex(GA_IterateEdgesByVertexFunc apply_func) const
Definition: GA_Primitive.h:372
GA_Size findVertex(GA_Offset vtx) const
return the index of a vertex within our vertex list
Definition: GEO_Hull.h:534
SYS_FORCE_INLINE UT_Vector4 getPos4(unsigned int r, unsigned int c) const
Definition: GEO_Hull.h:455
GEO_Hull(GA_Detail *d, GA_Offset offset=GA_INVALID_OFFSET)
Definition: GEO_Hull.h:121
virtual void stashed(bool beingstashed, GA_Offset offset=GA_INVALID_OFFSET)
int subdivideV(float u)
Definition: GEO_Hull.h:261
Definition: format.h:895
int subdivideV(float u, GA_AttributeRefMap &map)
Definition: GEO_Hull.h:259
GA_API const UT_StringHolder area
GEO_HullFlags flags
Definition: GEO_Hull.h:768
void setSurfaceType(GEO_SurfaceType t)
Definition: GEO_Hull.h:480
SYS_FORCE_INLINE GA_Offset getFastVertexOffset(GA_Size i) const
Definition: GEO_Hull.h:653
static const UT_Vector3T< S > quadNormal(const UT_Vector3T< S > &p1, const UT_Vector3T< S > &p2, const UT_Vector3T< S > &p3, const UT_Vector3T< S > &p4)
Definition: GEO_Hull.h:626
GLenum src
Definition: glcorearb.h:1793