HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_PolyBevel.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: GU_PolyBevel.h (GU Library, C++)
7  *
8  * COMMENTS:
9  *
10  */
11 
12 
13 #ifndef __GU_PolyBevel_h__
14 #define __GU_PolyBevel_h__
15 
16 #include "GU_API.h"
17 #include "GU_Detail.h"
18 #include "GU_Decompose.h"
19 #include <GEO/GEO_Hedge.h>
20 #include <GA/GA_Handle.h>
21 #include <GA/GA_Types.h>
22 #include <UT/UT_Array.h>
23 #include <UT/UT_BitArray.h>
24 #include <UT/UT_Vector3.h>
25 #include <UT/UT_VectorTypes.h>
26 #include <UT/UT_StringStream.h>
27 #include <SYS/SYS_Inline.h>
28 
29 #include <math.h>
30 
31 class Profile;
32 class GU_Decompose;
33 class GU_Insetter;
34 class GU_PolyBevelParms;
35 
37 class GEO_Face;
38 class GEO_PolyCounts;
39 class GEO_PrimPoly;
40 
41 class GA_Attribute;
42 class GA_EdgeGroup;
43 class GA_PointGroup;
44 class GA_PointWrangler;
45 class GA_PrimitiveGroup;
47 class GA_VertexWrangler;
48 
49 
50 #define EXPLICIT_ELEMENT_INDEX 1
51 
52 
54 {
55 public:
57  {
58  NONE = 0,
63  PROFILE
64  };
65 
67  {
68  FIXED_DISTANCE = 0,
70  RELATIVE_DISTANCE
71  };
72 
74  {
75  UNIFORM = 0,
77  CONTROL_POINTS
78  };
79 
80  explicit GU_PolyBevel(GU_Detail *gdp,
81  const GU_Detail *rest_gdp = nullptr,
82  const GEO_DetachedHedgeInterface *h = nullptr);
83 
84  ~GU_PolyBevel();
85 
86  void bevelEdges(fpreal offset,
87  const GA_EdgeGroup *edges,
88  OffsetMode mode,
89  FilletShape shape,
90  int divs,
91  const GU_PolyBevelParms *parms);
92 
93  void bevelPoints(fpreal offset,
94  const GA_PointGroup *points,
95  FilletShape shape,
96  int divs,
97  const GU_PolyBevelParms *parms);
98 
99  void saveMeshBoundaryEdgesToDetailArray(const char *name);
100  void saveBevelPointsToDetailArray(const char *name);
101  void saveMeshInteriorEdgesToDetailArray(const char *name);
102  void saveLimitPtCoordsToDetailArray(const char *attrib_name);
103 
104  const
105  UT_Fpreal32Array &getLimitPtCoords() { return myLimitPtCoords; }
106 
108  { return myWarnings.str().toStdString(); }
109 
110  struct PatchSet;
111  struct UVPatchSet;
112  class Positioner;
113 
114 #if EXPLICIT_ELEMENT_INDEX
116  {
117  explicit ElementIndex() = default;
118  explicit ElementIndex(int index) : myIndex(index) { }
119 
120  explicit
121  operator int() const { return myIndex; }
122 
123  bool operator==(const ElementIndex &other) const
124  { return myIndex == other.myIndex; }
125 
126  bool operator!=(const ElementIndex &other) const
127  { return myIndex != other.myIndex; }
128 
129  private:
130  int myIndex;
131  };
132 
133  struct Patch : public ElementIndex
134  {
135  using ElementIndex::ElementIndex;
136  };
137 
138  struct Mesh: public ElementIndex
139  {
140  using ElementIndex::ElementIndex;
141  };
142 
143 #else
144  typedef int ElementIndex;
145  typedef ElementIndex Patch;
146  typedef ElementIndex Mesh;
147 #endif
148 
149 private:
150 
151  struct SplitRecord;
152  struct SplitDraft;
153  struct FanEdge;
154  struct VertexFanHandle;
155  struct VertexFanChain;
156  struct SliceInfo;
157  struct EdgeOffset;
158 
160 
161  void bevel(fpreal offset, FilletShape shape, int divs);
162 
163  void buildRimTopology(FilletShape shape);
164 
165  void buildFilletTopology(FilletShape shape,
166  int divisions,
167  GA_PrimitiveGroup *edge_prims,
168  GA_PrimitiveGroup *corner_prims);
169 
170  void registerRimHedge(GA_Offset vtx, UT_Vector3 vel,
171  uint flags);
172 
173  UT_Vector3 offsetVector(const EdgeOffset &o0,
174  const EdgeOffset &o1);
175 
176  UT_Vector3 divergentOffsetVector(const EdgeOffset &o0,
177  const EdgeOffset &o1);
178 
179  bool canOffsetAlongFold(const EdgeOffset &e0,
180  const EdgeOffset &e1,
181  const VertexFanHandle &fan,
182  UT_Vector3 &v);
183 
184  fpreal offsetRatio(const EdgeOffset &e0,
185  const EdgeOffset &e1,
186  const VertexFanHandle &fan,
187  UT_Vector3 &v);
188 
189  void draftPointBevelRimVertexSplits(SplitDraft &draft,
190  FilletShape shape);
191 
192 #if 0
193  void draftEdgeBevelRimVertexSplits(SplitDraft &draft,
194  GU_Decompose &euler_paths);
195 #endif
196  void draftEdgeBevelRimVertexSplits(SplitDraft &draft,
197  EulerPaths &euler_paths);
198 
199  void splitPointBevelRimVertices(const SplitDraft &draft);
200 
201 #if 0
202  void splitEdgeBevelRimVertices(const SplitDraft &draft,
203  GU_Decompose &euler_paths);
204 #endif
205  void splitEdgeBevelRimVertices(const SplitDraft &draft,
206  EulerPaths &euler_paths);
207 
208 
209 
210  void deleteRedundantHubs();
211 
212  void offsetFilletBoundary(fpreal inset_amount);
213 
214  void rebuildHedgeInterface(GA_PrimitiveGroup *prims
215  = nullptr);
216 
217 
218  enum EdgeError
219  {
220  EDGE_ERROR_NONE = 0,
221  EDGE_ERROR_DEGENERATE,
222  EDGE_ERROR_BOUNDARY,
223  EDGE_ERROR_NONMANIFOLD,
224  EDGE_ERROR_BADMANIFOLD,
225  EDGE_ERROR_TOO_SHORT,
226  EDGE_ERROR_TOO_SHARP,
227  EDGE_ERROR_NONMANIFOLD_ENDPOINT
228  };
229 
231  void addHedgeToBevelHedges(GEO_Hedge h,
232  bool ignore_flat = false,
233  fpreal flat_cos = 0.9999,
234  bool doing_all = false);
235 
237  EdgeError verifyHedgeForBevelling(GEO_Hedge h,
238  bool ignore_flat = false,
239  fpreal flat_cos = 0.9999);
240 
242  void addPointToBevelPoints(GA_Offset pt);
243 
244 
246  int numRimComponents() const
247  { return int(myRimCompStarts.entries()) - 1; }
248 
250  int rimCompSize(int k) const
251  { return int(myRimCompStarts(k + 1)
252  - myRimCompStarts(k)); }
253 
254  // Index of the i-th edge in the k-th rim component
256  int rimCompHedgeIndex(int k, int i) const
257  { return myRimCompStarts(k) + i; }
258 
260  int mateIndex(int i) const
261  { return myRimHedgeMate(i); }
262 
264  int rimCompHedgeMateIndex(int k, int i) const
265  { return mateIndex(rimCompHedgeIndex(k, i)); }
266 
267  // The i-th edge in the k-th rim component
269  GEO_Hedge rimCompHedge(int k, int i) const
270  { return myRimHedges(rimCompHedgeIndex(k, i)); }
271 
272  // The i-th edge in the k-th rim component
274  GEO_Hedge rimCompHedgeMate(int k, int i) const
275  {
276  return myRimHedges(rimCompHedgeMateIndex(k, i));
277  }
278 
280  int numRimHedges() const
281  { return int(myRimHedges.size()); }
282 
284  GEO_Hedge rimHedge(int i) const
285  { return myRimHedges(i); }
286 
288  UT_Vector3 rimHedgeSrcVel(int i) const
289  { return myRimHedgeSrcVel(i); }
290 
292  uint32 rimHedgeFlags(int i, uint32 mask = ~(uint32(0))) const
293  { return (mask & myRimHedgeFlags(i)); }
294 
296  Patch rimHedgePatch(int i) const
297  { return myRimHedgePatch(i); }
298 
300  Patch rimCompHedgePatch(int k, int j) const
301  { return myRimHedgePatch(rimCompHedgeIndex(k, j)); }
302 
304  Patch rimCompHedgeMatePatch(int k, int j) const
305  { return myRimHedgePatch(rimCompHedgeMateIndex(k, j)); }
306 
307  UT_Vector3 rotateHedge(GEO_Hedge h_ref, fpreal angle,
308  fpreal base_angle, fpreal weight = 1.0) const;
309 
310  void dumpHedge(GEO_Hedge h) const;
311  void dumpRimComponents();
312  void dumpPatches();
313 
314  bool hasTargetedTangent(int side, Patch pach);
315  bool needsMesh(int side, FilletShape shape, Patch ptch);
316 
317  int calcSlices(VertexFanHandle fan,
318  int span_start, int span_end,
319  int num_slices,
320  fpreal start_angle, fpreal slice_angle,
321  fpreal wt,
322  SliceInfo *sinfo);
323 
324  int calcSplitLocations(VertexFanHandle fan,
325  int span_start, int span_end,
326  int num_slices,
327  fpreal start_angle, fpreal slice_angle,
328  fpreal wt,
329  SliceInfo *sinfo);
330 
331  bool sliceFlatFanSpan(VertexFanHandle fan,
332  SplitDraft &draft,
333  int span_start, int span_end,
334  fpreal outer_slice_angle,
335  fpreal inner_slice_angle,
336  fpreal wt);
337 
338  void sliceClosedFanSpan(VertexFanHandle fan,
339  SplitDraft &draft,
340  int span_start, int span_end,
341  fpreal outer_slice_angle,
342  fpreal inner_slice_angle,
343  fpreal wt);
344 
345  void closedFanSplit(VertexFanHandle fan,
346  SplitDraft &draft,
347  bool on_open_poly);
348 
349  void fullCircleSplit(VertexFanHandle fan,
350  SplitDraft &draft);
351 
352  void unisplit(const EdgeOffset &e0, const EdgeOffset &e1,
353  VertexFanHandle fan, SplitDraft &draft,
354  UT_Vector3 vel, fpreal os0, fpreal os1);
355 
356  bool isFanBisector(const EdgeOffset &e0,
357  const EdgeOffset &e1, const UT_Vector3 &vf,
358  fpreal &a0, fpreal &a1);
359 
360  int mirrorFoldVector(const EdgeOffset &e0,
361  const EdgeOffset &e1,
362  const UT_Vector3 &vf, UT_Vector3 &vm);
363 
364  void bisplitFold(const EdgeOffset &e0, const EdgeOffset &e1,
365  VertexFanHandle fan, SplitDraft &draft,
366  fpreal os0, fpreal os1);
367 
368  void bisplitFlat(const EdgeOffset &e0, const EdgeOffset &e1,
369  VertexFanHandle fan, SplitDraft &draft,
370  fpreal os0, fpreal os1);
371 
372 
373  void multisplit(const EdgeOffset &e0, const EdgeOffset &e1,
374  VertexFanHandle fan, SplitDraft &draft,
375  fpreal os0, fpreal os1);
376 
377 
378  int findNextFold(VertexFanHandle fan, int idx0,
379  fpreal *angle_sum = nullptr);
380 
381  int rewireToNextFold(VertexFanHandle fan,
382  SplitDraft &draft,
383  GEO_Hedge base_hedge, int idx0,
384  bool rewire_first, bool rewire_last,
385  fpreal bisect_angle = 0.0,
386  UT_Vector3 bisector
387  = UT_Vector3(0.0f, 0.0f, 0.0f),
388  uint32 flags = 0, fpreal span_angle_sum = -1.0);
389 
390  int rewireFanSpanToNextFold(VertexFanHandle fan,
391  SplitDraft &draft,
392  GEO_Hedge base_hedge, int idx0,
393  bool rewire_first, bool rewire_last);
394 
396  bool isUVSeam(GEO_Hedge h);
397 
398  int scanVertexFan(GEO_Hedge h0, GEO_Hedge h1,
399  VertexFanChain &fan_chain,
400  bool choose_ends = false);
401 
402  void dumpVertexFan(VertexFanHandle fan);
403 
404  void draftSplitVertexFan(const EdgeOffset &e0,
405  const EdgeOffset &e1,
406  VertexFanHandle fan,
407  SplitDraft &draft, bool force_split,
408  UT_Vector3 offset_vector,
409  fpreal os0, fpreal os1);
410 
411  inline int numHubs() const
412  { return int(myHubs.size()); }
413 
414  inline int hubIndex(GA_Offset pt) const
415  { return myHubIndex.get(pt); }
416 
417  inline GA_Offset hub(GA_Offset pt) const
418  { return myHubs(hubIndex(pt)); }
419 
420  inline int hubDegree(GA_Offset pt) const
421  { return myHubDegrees(hubIndex(pt)); }
422 
423  inline GA_Offset restPointOffset(GA_Offset pt) const
424  { return GA_Offset(myRestPtOff.get(pt)); }
425 
426  inline UT_Vector3 hubPos(GA_Offset pt) const
427  { return myRestGdp->getPos3(restPointOffset(pt)); }
428 
429  void setupPatchAxes(FilletShape shape,
430  int divisions,
431  GA_Offset &baseoffset);
432 
433  // void dumpPatch(Patch ptch);
434  void dumpPatchAxes(int divs);
435 
436  void meshPatchInterior(Patch ptch, FilletShape shape,
437  GA_Offset &base_pt, GA_Offset &base_prim,
438  GEO_PolyCounts &poly_size_list,
439  UT_IntArray &poly_pt_nums,
440  GA_OffsetArray *edge_prim_offs,
441  GA_OffsetArray *corner_prim_offs);
442 
443  void meshPatchJoint(Patch lbp, Patch rbp,
444  GA_Offset &base_pt, GA_Offset &base_prim,
445  GEO_PolyCounts &poly_size_list,
446  UT_IntArray &poly_pt_nums,
447  GA_OffsetArray *edge_prim_offs,
448  GA_OffsetArray *corner_prim_offs);
449 
450  void setupEdgePatchAxes(Patch bp,
451  bool even_divs, bool mesh_left,
452  bool mesh_right, GA_Offset &base_pt);
453 
454  void setupVertexPatchAxes(Patch bp, bool even_divs,
455  bool mesh_left, bool mesh_right,
456  GA_Offset &base_pt);
457 
458  GA_Offset axisEndOnLeftBoundary(Patch bp);
459  GA_Offset axisEndOnRightBoundary(Patch bp);
460 
461  void meshEdgePatchMidDiv(Patch ptch, GA_Offset &base_prim,
462  GEO_PolyCounts &poly_size_list,
463  UT_IntArray &poly_pt_nums,
464  GA_OffsetArray *edge_prim_offs,
465  GA_OffsetArray *corner_prim_offs);
466 
467  void generateHubCapPrim(GA_Offset hub, FilletShape shape,
468  Patch ptch, GA_Offset &base_prim,
469  GEO_PolyCounts &poly_size_list,
470  UT_IntArray &poly_pt_nums,
471  GA_OffsetArray *edge_prim_offs,
472  GA_OffsetArray *corner_prim_offs);
473 
474  void meshMiddleDivisions(FilletShape shape,
475  GA_Offset &base_prim,
476  GEO_PolyCounts &poly_size_list,
477  UT_IntArray &poly_pt_nums,
478  GA_OffsetArray *edge_prim_offs,
479  GA_OffsetArray *corner_prim_offs);
480 
481  void assignEdgePatchMates();
482  void generatePatches(int divs, FilletShape shape);
483 
484  void generateMeshes(FilletShape shape,
485  int divs,
486  GA_Offset &base_pt,
487  GA_Offset &base_prim,
488  GEO_PolyCounts &poly_size_list,
489  UT_IntArray &poly_pt_nums,
490  GA_OffsetArray *edge_prim_offs,
491  GA_OffsetArray *corner_prim_offs);
492 
493  void stitchFilletGapsToRim(int divisions);
494 
495 
496  UT_Vector3 tangentTowardsMate(int side, Patch ptch);
497 
498  UT_Vector3 vectorOverFold(UT_Vector3 v0, UT_Vector3 n0,
499  UT_Vector3 n1);
500 
501  void updateAffectedNormals(const GA_PrimitiveGroup *,
502  const GA_PrimitiveGroup *);
503 
504  void applyPointScale();
505 
506  fpreal locateUVTriangle(const UT_Vector3 &x, int prim_idx,
507  GA_Offset &va, GA_Offset &vb, GA_Offset &vc,
508  fpreal &ga, fpreal &gb, fpreal &gc);
509 
510  UT_Vector3 calcRimVertexUV(GA_Offset vtx);
511  UT_Vector3 barycentricVertexUV(GA_Offset vtx, GA_Offset vta,
512  GA_Offset vtb, GA_Offset vtc);
513 
514  void findRimTriangleVtxs(GA_Offset vtx,
515  GA_Offset &vtx_prev, GA_Offset &vtx_next,
516  UT_Vector3 &rest_pos, UT_Vector3 &rest_pos_prev,
517  UT_Vector3 &rest_pos_next);
518 
519  UT_Vector3 radialRimVertexUV(GA_Offset vtx);
520 
521  UVPatchSet *constructUVPatchSet();
522 
523  void calcEdgePatchInternalUVs(Patch ptch,
524  UVPatchSet *uvpatches);
525 
526  void calcVertexPatchInternalUVs(Patch ptch,
527  UVPatchSet *uvpatches);
528 
529  void calcVertexPatchMidDivUVs(Patch ptch,
530  UVPatchSet *uvpatches);
531 
532  GA_Offset hubPrimPoint(GA_Offset hub, Patch ptch, int side);
533 
534  GA_Offset hubPrimAdjacentVertex(GA_Offset hub, Patch ptch,
535  int side);
536 
537 
538 
539  void calcHubCapPrimUVs(int i);
540 
541  GA_Offset edgePatchDivVertex(int side, Patch ptch, int i,
542  UVPatchSet *uvpatches = nullptr);
543 
544  void vertexPatchDivMeshVtxs(int side, Patch ptch, int div,
545  GA_Offset &lv, GA_Offset &uv);
546 
547  void calcMeshUVs(Mesh mesh,
548  UVPatchSet *uvpatches);
549 
550  void calcEdgePatchMidDivUVs(Patch ptch,
551  UVPatchSet *uvpatches);
552 
553  void calcPatchAxisEndUVs(Patch ptch,
554  UVPatchSet *uvpatches);
555 
556  void offsetRimVertexUVs(UVPatchSet *uvpatches);
557  void updateAffectedUVs(UVPatchSet *uvpatches,
558  FilletShape shape);
559 
560  void wrangleAttributes(FilletShape shape);
561 
562  void copyPointAttributes(GA_Offset pt, Patch start_ptch,
563  GA_PointWrangler *ptw);
564 
565  void copyMeshPointAttributes(Mesh m, GA_Offset pt,
566  GA_PointWrangler *ptw);
567 
568  void copyPatchAxisPointAttributes(int side, Patch ptch,
569  GA_Offset pt, GA_PointWrangler *ptw);
570 
571  void lerpAttribsOnEdgePatch(Patch ptch,
573  GA_VertexWrangler *vw,
575  GA_VertexWrangler *vwx,
576  UT_IntArray &contribs,
578  GA_VertexWrangler *vws);
579 
580  void lerpAttribsOnVertexPatch(Patch ptch,
582  GA_VertexWrangler *vw,
584  GA_VertexWrangler *vwi,
586  GA_VertexWrangler *vws);
587 
588  void lerpAttribsOnMidDivs(Patch ptch,
590  GA_VertexWrangler *vw,
592  GA_VertexWrangler *vws );
593 
594  void copyHubCapPrimAttributes(int i,
596  GA_VertexWrangler *vw,
598  GA_VertexWrangler *vws);
599 
600  void lerpAttribsOnMesh(Mesh mesh,
602  GA_VertexWrangler *vw,
604  GA_VertexWrangler *vwi,
606  GA_VertexWrangler *vws);
607 
608  template <typename T>
609  void applyPositioner(T& positioner);
610 
611  void positionFilletPoints(FilletShape shape,
612  const Profile *profile);
613 
614  void addVisBoundaryEdge(GA_Offset p0, GA_Offset p1);
615  void addVisInteriorEdge(GA_Offset p0, GA_Offset p1);
616 
618  bool haveWeightedEdges() const;
619 
621  fpreal hedgeWeight(GEO_Hedge h) const;
622 
624  UT_Vector3 hedgeVector(GEO_Hedge h) const;
625 
627  UT_Vector3 hedgeNormal(GEO_Hedge h) const;
628 
630  int rimPrimID(GA_Offset primoff) const;
631 
633  int hedgePrimID(GEO_Hedge h) const;
634 
636  bool isHedgeOnBoundaryCap(GEO_Hedge h) const;
637 
639  GA_Offset primFirstTriangle(int prim_idx) const
640  { return myRimPolyFirstTri(prim_idx); }
641 
643  GA_Offset triangleToNextTriangle(GA_Offset tri) const
644  { return myRimPolyNextTri(tri); }
645 
647  GEO_PrimPoly *getPoly(GA_Offset primoff)
648  { return (GEO_PrimPoly *)
649  myGdp->getPrimitive(primoff); }
650 
651 
652  void prepareHubs();
653  void constructRimPolyTriLists(int num_primitives);
654 
655  GA_PrimitiveGroup *capBoundaryBevelPoints();
656 
657  void processRimPrims();
658  void prepareRimPrims(const GA_EdgeGroup *edges);
659  void prepareRimPrims(GA_PointGroup *points,
660  bool bevel_open_poly_pts);
661 
662  void prepareBevelEdges(const GA_EdgeGroup *edges,
663  bool ignore_flat, fpreal flat_normal_diff);
664 
665  void prepareBevelPoints(const GA_PointGroup *points);
666  void consolidateIncidentPrims();
667  void restoreOriginalPrimitiveIndices();
668 
669  void markDegeneratePatches(FilletShape shape);
670  void trivialBevelEdges();
671  void reopenInputOpenPolys();
672  void cleanup();
673 
674  typedef UT_Array<Patch> PatchArray;
675 
676  struct OpenPoly
677  {
678  GA_Index myPoly;
679  GA_Index myFirstPt;
680  };
681 
682  UT_Array<OpenPoly> myOpenPolys;
683 
684  const GU_Detail *myRestGdp;
685  GU_Detail *myGdp;
686 
687  PatchSet *myPatches;
688 
689  GA_RWHandleV3 myPrimNormal;
690 
691  UT_BitArray myRedundantHubs;
692  GA_OffsetArray myHubs;
693  GA_OffsetArray myHubCapPrims;
694  GA_RWHandleI myHubIndex;
695  GA_RWHandleI myRestPtOff;
696  UT_IntArray myHubDegrees;
697  UT_Array<Patch> myHubFirstPatch;
698 
699  GA_RWHandleF myHedgeWeight;
700 
701  GA_PointGroup *myBevelPoints;
702  GA_VertexGroup *myBevelHedges; // accepted input half-edges
703  GA_PrimitiveGroup *myRimPrims;
704  GA_PointGroup *myBoundaryPts;
705 
706  GA_VertexGroup *myBridgeHedges;
707 
708  GA_PrimitiveGroup *myBoundaryCapPrims;
709 
710  UT_IntArray myRimCompStarts;
711 
712  // parallel arrays for rim hedges
713  UT_Array<GEO_Hedge> myRimHedges; // rim hedges by index
714  UT_Vector3Array myRimHedgeSrcVel; // velocity of ith rim hedge
715  PatchArray myRimHedgePatch; // patch of ith rim hedge
716  UT_IntArray myRimHedgeMate; // mate of ith rim hedge
717  UT_Int32Array myRimHedgeFlags; // flags of ith rim hedge
718 
719 
720  OffsetMode myOffsetMode;
721  bool myOwnHedgeInterface;
722 
723  GA_OffsetArray myVisBevelPoints;
724  GA_OffsetArray myVisBoundaryEdges;
725  GA_OffsetArray myVisInteriorEdges;
726  GA_OffsetArray myVisRejectedEdges;
727 
728  UT_Fpreal32Array myLimitPtCoords;
729 
730  fpreal myRadialInc;
731 
732  GA_RWHandleV3 myUV;
733  GA_ROHandleF myOffsetScale;
734 
735  GA_RWHandleI myRimPrimID;
736 
737  UT_IntArray myRimPolyClass;
738  GA_OffsetArray myRimPolyFirstTri;
739  GA_OffsetArray myRimPolyNextTri;
740 
741  GA_Offset myCapPoint;
742 
743  UT_StringStream myWarnings;
744 
745  const GU_PolyBevelParms *myParms;
746  const GEO_DetachedHedgeInterface *myHip;
747 };
748 
749 
751 {
752 public:
756 
757  GU_PolyBevelParms() = default;
758 
759  inline bool ignoreFlat() const { return myIgnoreFlat; }
760  void ignoreFlat(bool b) { myIgnoreFlat = b; }
761 
762  inline bool commonLimit() const { return myCommonLimit; }
763  void commonLimit(bool b) { myCommonLimit = b; }
764 
765  inline bool allowSplits() const { return myAllowSplits; }
766  void allowSplits(bool b) { myAllowSplits = b; }
767 
768  inline bool splitSingleFolds() const { return mySplitSingleFolds; }
769  void splitSingleFolds(bool b) { mySplitSingleFolds = b; }
770 
771  inline bool splitFlatEdges() const { return mySplitFlatEdges; }
772  void splitFlatEdges(bool b) { mySplitFlatEdges = b; }
773 
774  inline bool symmetrizeProfile() const
775  { return mySymmetrizeProfile; }
776  void symmetrizeProfile(bool b)
777  { mySymmetrizeProfile = b; }
778 
779  inline bool reverseProfile() const { return myReverseProfile; }
780  void reverseProfile(bool b) { myReverseProfile = b; }
781 
782  inline fpreal flatAngle() const { return myFlatAngle; }
783  void flatAngle(fpreal f) { myFlatAngle = f; }
784 
785  inline fpreal radialInc() const { return myRadialInc; }
786  void radialInc(fpreal f) { myRadialInc = f; }
787 
788  GA_Attribute *offsetScale() const { return myOffsetScale; }
789  void offsetScale(GA_Attribute *a) { myOffsetScale = a; }
790 
791  GA_Attribute *pointScale() const { return myPointScale; }
792  void pointScale(GA_Attribute *a) { myPointScale = a; }
793 
794  GA_PrimitiveGroup *edgePrims() const { return myEdgePrims; }
795  void edgePrims(GA_PrimitiveGroup *g) { myEdgePrims = g; }
796 
797  GA_PrimitiveGroup *cornerPrims() const { return myCornerPrims; }
799  { myCornerPrims = grp; }
800 
801  fpreal roundness() const { return myRoundness; }
802  void roundness(fpreal f) { myRoundness = f; }
803 
804  const UT_Ramp *profileRamp() const { return myProfileRamp; }
805  void profileRamp(const UT_Ramp *r) { myProfileRamp = r; }
806 
807  const GEO_Face *profileCurve() const { return myProfileCurve; }
808  void profileCurve(const GEO_Face *c) { myProfileCurve = c; }
809 
810  fpreal profileScale() const { return myProfileScale; }
811  void profileScale(fpreal f) { myProfileScale = f; }
812 
813  ProfileSampling profileSampling() const { return myProfileSampling; }
815  { myProfileSampling = s; }
816 
817 private:
818  bool myIgnoreFlat = false;
819  bool myAllowSplits = true;
820  bool mySplitSingleFolds = false;
821  bool mySplitFlatEdges = false;
822  bool mySymmetrizeProfile = false;
823  bool myReverseProfile = false;
824  bool myCommonLimit = false;
825  fpreal myFlatAngle = 0.03490658503989; // 2 degrees
826  fpreal myRadialInc = M_PI_2;
827  GA_Attribute *myOffsetScale = nullptr;
828  GA_Attribute *myPointScale = nullptr;
829  GA_PrimitiveGroup *myEdgePrims = nullptr;
830  GA_PrimitiveGroup *myCornerPrims = nullptr;
831  fpreal myRoundness = 1.0;
832  const UT_Ramp *myProfileRamp = nullptr;
833  const GEO_Face *myProfileCurve = nullptr;
834  fpreal myProfileScale = 1.0;
835  ProfileSampling myProfileSampling = GU_PolyBevel::UNIFORM;
836 
837 };
838 
839 #endif
void allowSplits(bool b)
Definition: GU_PolyBevel.h:766
typedef int(APIENTRYP RE_PFNGLXSWAPINTERVALSGIPROC)(int)
Definition of a geometry attribute.
Definition: GA_Attribute.h:198
GA_API const UT_StringHolder div
Definition: Mesh.h:240
GLbitfield flags
Definition: glcorearb.h:1596
const UT_Ramp * profileRamp() const
Definition: GU_PolyBevel.h:804
GLdouble GLdouble GLint GLint const GLdouble * points
Definition: glad.h:2676
void profileScale(fpreal f)
Definition: GU_PolyBevel.h:811
void roundness(fpreal f)
Definition: GU_PolyBevel.h:802
void profileRamp(const UT_Ramp *r)
Definition: GU_PolyBevel.h:805
SIM_API const UT_StringHolder angle
void edgePrims(GA_PrimitiveGroup *g)
Definition: GU_PolyBevel.h:795
GA_API const UT_StringHolder uv
const GLdouble * v
Definition: glcorearb.h:837
GLsizei const GLchar *const * string
Definition: glcorearb.h:814
GA_PrimitiveGroup * cornerPrims() const
Definition: GU_PolyBevel.h:797
#define M_PI_2
Definition: fmath.h:93
void splitSingleFolds(bool b)
Definition: GU_PolyBevel.h:769
UT_Vector3T< float > UT_Vector3
ProfileSampling profileSampling() const
Definition: GU_PolyBevel.h:813
GLboolean GLboolean g
Definition: glcorearb.h:1222
fpreal flatAngle() const
Definition: GU_PolyBevel.h:782
GLboolean GLboolean GLboolean GLboolean a
Definition: glcorearb.h:1222
GLdouble s
Definition: glad.h:3009
void ignoreFlat(bool b)
Definition: GU_PolyBevel.h:760
bool ignoreFlat() const
Definition: GU_PolyBevel.h:759
bool commonLimit() const
Definition: GU_PolyBevel.h:762
bool operator!=(const ElementIndex &other) const
Definition: GU_PolyBevel.h:126
fpreal radialInc() const
Definition: GU_PolyBevel.h:785
GA_Size GA_Offset
Definition: GA_Types.h:646
bool symmetrizeProfile() const
Definition: GU_PolyBevel.h:774
void profileCurve(const GEO_Face *c)
Definition: GU_PolyBevel.h:808
GA_Attribute * offsetScale() const
Definition: GU_PolyBevel.h:788
GLfloat f
Definition: glcorearb.h:1926
bool splitFlatEdges() const
Definition: GU_PolyBevel.h:771
GA_Attribute * pointScale() const
Definition: GU_PolyBevel.h:791
GLintptr offset
Definition: glcorearb.h:665
GU_PolyBevel::FilletShape FilletShape
Definition: GU_PolyBevel.h:755
GEO_Hedge encapsulates a half-edge (hedge) which is the restriction of.
Definition: GEO_Hedge.h:47
bool operator==(const ElementIndex &other) const
Definition: GU_PolyBevel.h:123
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
void symmetrizeProfile(bool b)
Definition: GU_PolyBevel.h:776
An bi-directional stream object that owns its own string buffer storage.
GLint GLuint mask
Definition: glcorearb.h:124
GU_PolyBevel::ProfileSampling ProfileSampling
Definition: GU_PolyBevel.h:753
bool reverseProfile() const
Definition: GU_PolyBevel.h:779
#define GU_API
Definition: GU_API.h:14
GLuint const GLchar * name
Definition: glcorearb.h:786
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1222
GA_Size GA_Index
Define the strictness of GA_Offset/GA_Index.
Definition: GA_Types.h:640
GLint GLenum GLint x
Definition: glcorearb.h:409
void profileSampling(ProfileSampling s)
Definition: GU_PolyBevel.h:814
const UT_Fpreal32Array & getLimitPtCoords()
Definition: GU_PolyBevel.h:105
void radialInc(fpreal f)
Definition: GU_PolyBevel.h:786
GLenum mode
Definition: glcorearb.h:99
IMATH_HOSTDEVICE constexpr int divs(int x, int y) IMATH_NOEXCEPT
Definition: ImathFun.h:140
GLfloat v0
Definition: glcorearb.h:816
void splitFlatEdges(bool b)
Definition: GU_PolyBevel.h:772
const GEO_Face * profileCurve() const
Definition: GU_PolyBevel.h:807
GLint j
Definition: glad.h:2733
GU_API exint fan(GU_Detail *gdp, UT_Array< GA_OffsetArray > &rings, UT_Array< GA_OffsetArray > &ringOrigs, GA_PrimitiveGroup *patchgroup=nullptr, GA_PrimitiveGroup *loopgroup=nullptr, exint degree=3, bool deformpatch=false, fpreal ctrTranslation=0.0, bool edgeloop=false, fpreal edgelooppercentage=0.5)
GLfloat GLfloat GLfloat GLfloat h
Definition: glcorearb.h:2002
void cornerPrims(GA_PrimitiveGroup *grp)
Definition: GU_PolyBevel.h:798
void reverseProfile(bool b)
Definition: GU_PolyBevel.h:780
void flatAngle(fpreal f)
Definition: GU_PolyBevel.h:783
fpreal64 fpreal
Definition: SYS_Types.h:277
Utility class for containing a color ramp.
Definition: UT_Ramp.h:92
void commonLimit(bool b)
Definition: GU_PolyBevel.h:763
GLuint index
Definition: glcorearb.h:786
void pointScale(GA_Attribute *a)
Definition: GU_PolyBevel.h:792
unsigned int uint32
Definition: SYS_Types.h:40
fpreal profileScale() const
Definition: GU_PolyBevel.h:810
const std::string getWarningMessage()
Definition: GU_PolyBevel.h:107
fpreal roundness() const
Definition: GU_PolyBevel.h:801
GLboolean r
Definition: glcorearb.h:1222
bool splitSingleFolds() const
Definition: GU_PolyBevel.h:768
void offsetScale(GA_Attribute *a)
Definition: GU_PolyBevel.h:789
GU_PolyBevel::OffsetMode OffsetMode
Definition: GU_PolyBevel.h:754
unsigned int uint
Definition: SYS_Types.h:45
GA_PrimitiveGroup * edgePrims() const
Definition: GU_PolyBevel.h:794
bool allowSplits() const
Definition: GU_PolyBevel.h:765