HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_Detail.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_Detail.h (GU Library, C++)
7  *
8  * COMMENTS:
9  * GU_Detail represents a container for geometry. It contains primitives,
10  * points, vertices, etc. and all of the attributes. It also provides some
11  * conventient methods for manipulating geometry.
12  *
13  */
14 
15 #pragma once
16 
17 #ifndef __GU_Detail_h__
18 #define __GU_Detail_h__
19 
20 #include "GU_API.h"
21 #include "GU_Error.h"
22 #include "GU_PrimitiveFactory.h"
23 #include "GU_SelectType.h"
24 #include "GU_Types.h"
25 
26 #include <GEO/GEO_Detail.h>
27 #include <GEO/GEO_PrimType.h>
28 #include <GEO/GEO_SurfaceType.h>
29 
30 #include <GA/GA_Detail.h>
31 #include <GA/GA_ElementGroup.h>
32 #include <GA/GA_Handle.h>
33 #include <GA/GA_IntrinsicManager.h>
34 #include <GA/GA_OffsetList.h>
35 #include <GA/GA_PrimitiveTypeId.h>
36 #include <GA/GA_Range.h>
37 #include <GA/GA_Types.h>
38 
39 #include <UT/UT_Array.h>
40 #include <UT/UT_ArraySet.h>
41 #include <UT/UT_ErrorManager.h> // for UTgetErrorManager()
42 #include <UT/UT_Map.h>
43 #include <UT/UT_StringHolder.h>
44 #include <UT/UT_Vector2.h>
45 #include <UT/UT_Vector3.h>
46 #include <UT/UT_VectorTypes.h>
47 
48 #include <SYS/SYS_Deprecated.h>
49 #include <SYS/SYS_Types.h>
50 #include <SYS/SYS_Visibility.h>
51 
52 #include <iosfwd>
53 
54 
55 class UT_BitArray;
56 class UT_MemoryCounter;
57 template <typename T> class UT_OBBoxT;
59 class UT_StringArray;
60 class UT_WorkBuffer;
61 class UT_XformOrder;
62 template <typename T> class UT_RefMatrix;
63 template <typename T> class UT_VectorT;
65 
66 class GA_Attribute;
67 class GA_BreakpointGroup;
68 class GA_EdgeGroup;
70 class GA_Group;
71 class GA_IndexMap;
72 class GA_NUBBasis;
73 class GA_OffsetMatrix;
74 class GA_Primitive;
76 class GA_SaveOptions;
77 class GA_Stat;
78 namespace GA_PrimCompat { class TypeMask; }
79 
80 class GEO_ConvertParms;
81 class GEO_Curve;
82 class GEO_Delta;
83 class GEO_Face;
84 class GEO_Hull;
85 class GEO_IOTranslator;
87 class GEO_PolySoupParms;
88 class GEO_Primitive;
89 class GEO_PrimPoly;
90 class GEO_PrimPolySoup;
91 class GEO_Rolloff;
93 class GEO_TPSurf;
94 
95 class GU_EdgeDiv;
96 class GU_SplitLoc;
97 
98 class GU_PrimMesh;
99 class GU_PrimNURBSurf;
100 class GU_PrimPoly;
101 class GU_PrimPolySoup;
102 class GU_PrimRBezSurf;
103 
104 class GU_CookSelectionReplaceStash;
105 
106 // Parameter classes for methods
107 class GU_AlignParms;
108 class GU_CameraParms;
109 class GU_CapOptions;
110 class GU_CapParms;
111 class GU_CreepParms;
112 class GU_CurveClayParms;
114 class GU_EdgeCreaseParms;
115 class GU_ExtrudeParms;
116 class GU_FilletParms;
117 class GU_GridParms;
118 class GU_JoinParms;
119 class GU_LoftParms;
120 class GU_LSystemParms;
121 class GU_MagnetParms;
122 class GU_OffsetParms;
123 class GU_PolyExtrudeParms;
124 class GU_PolypatchParms;
125 class GU_PolyReduceParms;
126 class GU_PolysplineParms;
127 class GU_RailParms;
128 class GU_RevolveParms;
129 class GU_RoundFilletParms;
130 class GU_RuledParms;
131 class GU_SkinCache;
132 class GU_SkinParms;
133 class GU_StitchParms;
134 class GU_SuperQuadParms;
135 class GU_SweepParms;
136 class GU_TorusParms;
137 class GU_TraceParms;
138 class GU_TrimFilletParms;
139 class GU_TwistParms;
141 
142 
143 
145 
146 extern "C" {
147  SYS_VISIBILITY_EXPORT extern void newGeometryIO(void *);
149 }
150 
151 class gu_ValueLookupCache;
152 
154 {
155 public:
156  /// NOTE: Need an explicit default constructor to work around internal
157  /// compiler error in Visual Studio 2015 Update 3.
158  /// See: https://connect.microsoft.com/VisualStudio/feedback/details/2869531
159  GU_Detail() : GU_Detail(true) {}
160  explicit GU_Detail(bool full_topology)
161  : GEO_Detail(GUgetFactory(), full_topology)
162  {
163  construct();
164  }
165  /// See GEO_Detail::merge() for documentation of the data_id_strategy
166  /// argument.
167  explicit GU_Detail(const GU_Detail *src, GA_PrimitiveGroup *primGroup,
168  GA_DataIdStrategy data_id_strategy = GA_DATA_ID_BUMP)
170  {
171  construct();
172  merge(*src, primGroup,
173  /*mergePrimGroup*/true, /*insertPrimsAtHead*/false,
174  /*dest_to_src_ptarray*/nullptr,
175  /*keep_internal_groups*/true,
176  data_id_strategy);
177  }
178  /// See GEO_Detail::copy() for documentation of the data_id_strategy
179  /// argument.
180  explicit GU_Detail(const GU_Detail *src,
181  GA_DataIdStrategy data_id_strategy = GA_DATA_ID_BUMP)
183  {
184  construct();
185  copy(*src, GEO_COPY_ONCE,
186  /*collapse_on_end*/false,
187  /*keep_internal_groups*/true,
188  data_id_strategy);
189  }
190 
191  ~GU_Detail() override;
192 
193  /// Compute memory usage (includes all shared memory)
194  int64 getMemoryUsage(bool inclusive) const override;
195 
196  /// Count memory usage using a UT_MemoryCounter in order to count
197  /// shared memory correctly.
198  /// If inclusive is true, the size of this object is counted,
199  /// else only memory owned by this object is counted.
200  /// If this is pointed to by the calling object, inclusive should be true.
201  /// If this is contained in the calling object, inclusive should be false.
202  /// (Its memory was already counted in the size of the calling object.)
203  void countMemory(UT_MemoryCounter &counter, bool inclusive) const override;
204 
205  /// This clears any caches that subclasses of GA_Detail may have, so that
206  /// replacing the content of the detail doesn't cause crashes.
207  void clearCaches() override;
208 
209  void duplicate(const GU_Detail& gdp, int = 0,
210  GA_DataIdStrategy data_id_strategy = GA_DATA_ID_BUMP);
211 
212  /// Create a new detail that has all the same attributes, groups, etc. but
213  /// has no elements.
214  /// Subclasses should look at: cloneCopyGroupsAndAttributes()
215  GA_Detail *cloneEmptyDetail(bool clone_attributes) const override;
216 
217  class RingRef
218  {
219  public:
221  const UT_IntArray &ringvalence)
222  : myRingZero(ringzero)
223  , myRingValence(ringvalence)
224  {
225  }
226 
228  { return myRingZero; }
229  const UT_IntArray & ringValence() const
230  { return myRingValence; }
231 
232  public:
235  };
236 
237  /// This initializes the passed in int array so it is 0 where
238  /// points are a boundary and 1 where they are not a boundary.
239  /// This handles meshes, etc, properly. It doesn't handle non-manifold
240  /// properly. The checkuv flag determines if it should check uv
241  /// boundaries, if set, it will mark as 1 any points which have
242  /// differing UV texture coordinates in their vertices.
243  /// For efficiency, you may call buildRingZero() once and pass the built
244  /// data structures to it.
245  void findBoundaryPoints(
246  UT_BitArray &isboundary,
247  bool checkuv,
248  const RingRef *ringref = nullptr,
249  const UT_StringHolder &uvattribname = "uv"_UTsh) const;
250 
251  /// This takes an array which should be the same size as the number
252  /// of points, and has 1 wherever a point is to be considered
253  /// selected. It then initializes & sets 1 in the isboundary array
254  /// any point which is on the 8-way boundary of the selection.
255  void findSelectionBoundaryPoints(
256  const UT_BitArray &pointselection,
257  UT_BitArray &isboundary) const;
258 
259  /// Fills the ringzero array, (which is indexed by point GA_Index,
260  /// not GA_Offset), with the GA_Offsets of each point's neighbours,
261  /// (i.e. they share an edge in some primitive). It avoids
262  /// duplicates within each point's list of neighbours.
263  /// If ringvalence is non-nullptr, it is filled with the number of
264  /// half-edges each point is part of, i.e. including duplicates
265  /// and both directions.
266  void buildRingZeroPoints(
267  UT_Array<GA_OffsetArray> &ringzero,
268  UT_IntArray *ringvalence = 0) const;
269 
270  /// Fills the ringzero array, (which is indexed by point GA_Index,
271  /// not GA_Offset), with the GA_Offsets of each point's neighbours,
272  /// (i.e. they share an edge in some primitive). It avoids
273  /// duplicates within each point's list of neighbours.
274  /// If ringvalence is non-nullptr, it is filled with the number of
275  /// half-edges each point is part of, i.e. including duplicates
276  /// and both directions.
277  ///
278  /// In this version, an edge is only counted if it is in a primitive
279  /// in primgroup (if non-nullptr). Although only entries for
280  /// points in ptgroup (if non-nullptr) are written-to in ringzero
281  /// and ringvalence (if non-nullptr), neighbours outside of ptgroup
282  /// will be listed.
283  void buildRingZeroPoints(
284  const GA_PointGroup *ptgroup,
285  UT_Array<GA_OffsetArray> &ringzero,
286  UT_IntArray *ringvalence = 0,
287  const GA_PrimitiveGroup *primgroup = 0) const;
288 
289  /// NOTE: Unlike buildRingZeroPoints, the array in buildRingZeroVertices
290  /// is indexed by GA_Offset, not GA_Index, for simplicity.
291  void buildRingZeroVertices(
292  UT_Array<GA_OffsetArray> &ringzero,
293  const GA_PrimitiveGroup *prims=0) const;
294 
295  void buildRingZeroPrimitives(
296  UT_Array<GA_OffsetArray> &ringzero) const;
297 
298  //
299  // Build various geometries. Returns the first primitive of the new
300  // geometry.
301  //
302 
303  /// Creates a polygon cube in this detail.
304  /// NOTE: Set doConsolidatePoints to true in order to have
305  /// correctly connected polygons. The default behaviour
306  /// produces disconnected sides!
307  GU_PrimPoly *cube(float xmin = -1, float xmax = 1,
308  float ymin = -1, float ymax = 1,
309  float zmin = -1, float zmax = 1,
310  int xdiv = 0, int ydiv = 0, int zdiv = 0,
311  int enforcementBars = 0,
312  int doConsolidatePoints = 0);
313 
314  GU_PrimNURBSurf *nurbCube(int xdiv, int ydiv, int zdiv,
315  int orderx = 4, int ordery = 4, int orderz=4,
316  float xmin = -0.5F, float xmax = 0.5F,
317  float ymin = -0.5F, float ymax = 0.5F,
318  float zmin = -0.5F, float zmax = 0.5F,
320  bool consolidate = false);
321 
322  GU_PrimRBezSurf *bezCube(int xdiv, int ydiv, int zdiv,
323  int orderx = 4, int ordery = 4, int orderz=4,
324  float xmin = -0.5F, float xmax = 0.5F,
325  float ymin = -0.5F, float ymax = 0.5F,
326  float zmin = -0.5F, float zmax = 0.5F,
328  bool consolidate = false);
329 
330  GU_PrimMesh *meshCube(int xdiv, int ydiv, int zdiv,
331  float xmin = -0.5F, float xmax = 0.5F,
332  float ymin = -0.5F, float ymax = 0.5F,
333  float zmin = -0.5F, float zmax = 0.5F,
335  bool consolidate = false);
336 
337  GU_PrimPoly *polymeshCube(int xdiv, int ydiv, int zdiv,
338  float xmin = -0.5F, float xmax = 0.5F,
339  float ymin = -0.5F, float ymax = 0.5F,
340  float zmin = -0.5F, float zmax = 0.5F,
342  bool consolidate = false);
343 
344  /// Creates a grid in this detail based on parms.
345  /// Returns the offset of the first polygon primitive.
348 
349  /// Creates a grid of points in this detail.
350  /// NOTE: If startpoint is valid, it must refer to a *contiguous*
351  /// block of rows*cols point offsets, in which case, this
352  /// just sets point positions, so can be used on polygon
353  /// or polysoup grids with a consistent point order too.
354  /// NOTE: When plane is GU_PLANE_XY, cols corresponds with x, and
355  /// rows corresponds with y.
356  GA_Offset pointGrid(int rows, int cols,
357  float xsize=1, float ysize=1,
358  float xc = 0, float yc = 0, float zc = 0,
360  GA_Offset startpoint = GA_INVALID_OFFSET);
361 
362  /// Creates a grid of polygons in this detail.
363  /// Returns the offset of the first polygon primitive.
364  GA_Offset polyGrid(int rows, int cols,
365  float xsize=1, float ysize=1,
366  float xc = 0, float yc = 0, float zc = 0,
369  /// Creates a grid that is a single polygon soup in this detail.
370  GU_PrimPolySoup *polySoupGrid(int rows, int cols,
371  float xsize=1, float ysize=1,
372  float xc = 0, float yc = 0, float zc = 0,
375  GU_PrimMesh *meshGrid(int rows, int cols,
376  float xsize=1, float ysize=1,
377  float xc = 0, float yc = 0, float zc = 0,
380  int wrapu = 0, int wrapv = 0);
381  GU_PrimNURBSurf *nurbGrid(int rows, int cols,
382  int orderu = 4, int orderv = 4,
383  int interpEndsU = 1, int interpEndsV = 1,
384  float xsize=1, float ysize=1,
385  float xc = 0, float yc = 0, float zc = 0,
388  int wrapu = 0, int wrapv = 0);
389  GU_PrimRBezSurf *bezGrid(int rows, int cols,
390  int orderu = 4, int orderv = 4,
391  float xsize=1, float ysize=1,
392  float xc = 0, float yc = 0, float zc = 0,
395  int wrapu = 0, int wrapv = 0);
396 
397  /// Creates a torus in this detail, based on parms.
398  /// type is one of the values in the enum in GA_PrimitiveTypes.h .
399  /// GA_PRIMPOLY, GA_PRIMPOLYSOUP, GA_PRIMMESH, GA_PRIMBEZSURF,
400  /// and GA_PRIMNURBSURF are supported.
401  void torus(unsigned type, GU_TorusParms &parms);
402 
403  /// poly-iso surfaces
404  /// To find the primitives created, place
405  /// GA_IndexMap::Marker marker(gdp->getPrimitiveMap());
406  /// before the call, and call marker.getRange() afterward.
407  void polyIsoSurface(
408  float (*ptOutside)(const UT_Vector3 &, void *),
409  void *data,
410  const UT_BoundingBox &bbox,
411  int xdiv, int ydiv, int zdiv,
412  bool makepolysoup = false);
413 
414  /// When building a meta-surface, the new surface is built in this
415  /// gdp. If desired, src can be "this" as well...
416  void buildMetaSurface(const GU_Detail *src, float lod,
417  const GA_PrimitiveGroup *primGroup = 0,
418  bool makepolysoup = false);
419 
420  void buildMetaSurface(const GU_Detail *src,
421  int divx, int divy, int divz,
422  const GA_PrimitiveGroup *primGroup = 0,
423  bool makepolysoup = false);
424 
425  /// A faster way of conversion is to build cross sections. However, this
426  /// doesn't build real surfaces
427  void buildMetaXsection(
428  const GU_Detail *src,
429  int nsections,
430  int axis = 2,
431  int maxdepth = 4,
432  const GA_PrimitiveGroup *primGroup = nullptr);
433 
434  //
435  // Geometry filters
436  //
437 
438 
439  /// orient all the polygonal faces to have the same winding direction
440  void orient(const GA_PrimitiveGroup *group = 0);
441 
442  /// inset and extrude a face
443  void extrude(GU_ExtrudeParms &parms);
444 
445  /// create a weighted sum of two source inputs
446  /// This bumps data IDs of any attributes that are modified, and of
447  /// the primitive list, if any primitives are modified.
448  void blend(const GU_Detail *source, float weight,
449  bool doPos, bool doClr, bool doNml, bool doTxt,
450  bool doVoxels, bool doSlerp,
451  const char *ptidattr, const char *primidattr);
452 
453 
454  /// create a weighted sum of size source inputs
455  /// Return 1 if at least one pasted surface was involved in the blend,
456  /// else 0.
457  /// This bumps data IDs of any attributes that are modified, and of
458  /// the primitive list, if any primitives are modified.
459  int blend(const GU_Detail *gdps[], const float weights[],
460  int size, bool doPos, bool doClr,
461  bool doNml, bool doTxt,
462  bool doVoxels, bool doSlerp,
463  const char *ptidattr, const char *primidattr,
464  const GA_PointGroup *ptGroup);
465 
466  /// Transform points to follow surface of path input
467  void creep(GU_CreepParms &parms);
468 
469  /// Consolidate points within a specified distance (returns num done)
470  /// If a point group is specified, then, only points in that
471  /// group are consolidated. If the forceConsAll flag is set then
472  /// all points will be consolidated in a greedy fashion using a
473  /// branch and bound algorithm.
474  SYS_DEPRECATED_HDK_REPLACE(17.5,GU_Snap)
475  GA_Size consolidatePoints(fpreal distance,
476  const GA_PointGroup *ptGrp = 0,
477  bool forceConsAll = false,
478  bool mark = false,
479  bool accurate = false);
480 
481  /// Performs fast consolidation by calling onlyConsolidatePoints.
482  /// By default, calls removeUnused when done to remove any unused points
483  /// When deleteConsOnly is set, then only consolidated points are removed.
484  SYS_DEPRECATED_HDK_REPLACE(17.5,GU_Snap)
485  GA_Size fastConsolidatePoints(fpreal distance,
486  const GA_PointGroup *ptGrp=0,
487  bool mark = false,
488  bool accurate = false);
489 
490  /// Specifies methods by which points after consolidation will
491  /// get their group names. ONLYCONS_GRP_PROP_LEAST means that the
492  /// points will belong to the same group as the original point
493  /// with least point number. ONLYCONS_GRP_PROP_UNION means that the
494  /// points will belong to the full set of groups represented
495  /// by the original points (so if orig. point 1 is in group A, B and
496  /// orig. point 2 is in group B, C, the final point will be in A B C).
497  /// INTERSECT means the point will only belong in groups that are common
498  /// to all original points. With the example above, it will belong in
499  /// B.
501  {
502  ONLYCONS_GRP_PROP_LEAST = 0,
504  ONLYCONS_GRP_PROP_INTERSECT
505  };
506  /// This does fast consolidation but does *not* call removeUnused when
507  /// done. This means that degenerate primitives will be left along
508  /// with orphaned points. If deleteconsolidated is set, the consolidated
509  /// points only will be deleted. grouppropagate controls which groups
510  /// the new points will belong to.
511  SYS_DEPRECATED_HDK_REPLACE(17.5,GU_Snap)
512  GA_Size onlyConsolidatePoints(fpreal distance,
513  const GA_PointGroup *ptgrp = 0,
514  bool mark = false,
515  bool deleteconsolidated = false,
516  OnlyConsGroupPropagateType
517  grouppropagate =
518  ONLYCONS_GRP_PROP_LEAST,
519  bool accurate = false);
520 
521  GA_Size consolidateNormals(fpreal distance,
522  const GA_PointGroup *ptGrp = 0,
523  bool forceConsAll = false,
524  bool accurate = false);
525  GA_Size fastConsolidateNormals(fpreal distance,
526  const GA_PointGroup *ptGrp = 0,
527  bool accurate = false);
528  /// Consolidate UV attributes within a specified distance.
529  /// This distance can be in UV space or XYZ space.
530  /// There are various methods of placing the consolidated UVs.
531  ///
532  /// metric: 0 => UV space
533  /// 1 => XYZ space
534  ///
535  /// method: 0 => Average
536  /// 1 => First in Group
537  /// 2 => Specify uvw coordinate
538  SYS_DEPRECATED_HDK_REPLACE(17.5,GU_Snap)
539  int fastConsolidatePointUVs(float distance,
540  const GA_PointGroup &ptGrp,
541  const GU_MetricType metric,
542  int method,
543  UT_Vector3 &uvw);
544  SYS_DEPRECATED_HDK_REPLACE(17.5,GU_Snap)
545  int fastConsolidatePointUVs(const GA_RWHandleV3 &uvattrib,
546  float distance,
547  const GA_PointGroup &ptGrp,
548  const GU_MetricType metric,
549  int method,
550  UT_Vector3 &uvw);
551  int fastConsolidateVertexUVs(float distance,
552  const GA_VertexGroup &vtxGrp,
553  const GU_MetricType metric,
554  int method,
555  UT_Vector3 &uvw);
556  int fastConsolidateVertexUVs(const GA_RWHandleV3 &uvattrib,
557  float distance,
558  const GA_VertexGroup &vtxGrp,
559  const GU_MetricType metric,
560  int method,
561  UT_Vector3 &uvw);
562 
563  /// Snap points within a specified distance (returns num done)
564  /// If a point group is specified, then, only points in that
565  /// group are consolidated.
566  /// Snapping doesn't fuse the points together, just makes their
567  /// positions match.
568  /// The type is 0 for average, 1 for round to lowest point number
569  /// and 2 for highest point number.
570  /// snappointpos controls whether the point positions will be
571  /// snapped.
572  /// snapptattribs can be set to indicate that point attributes
573  /// are to be snapped.
574  /// ptattribhandles is a list of attribute handles for the
575  /// attributes that will be snapped.
576  SYS_DEPRECATED_HDK_REPLACE(17.5,GU_Snap)
577  GA_Size snapPoints(int type, fpreal distance,
578  const GA_PointGroup *ptgrp=0,
579  bool snapptpos = true,
580  UT_Array<GA_Attribute *> *ptattribs = 0,
581  bool accurate = true);
582 
583  /// Methods for snapping attributes (for use with snapAttributes).
584  /// SNAP_ATTRIBUTE_AVERAGE averages the attributes together.
585  /// SNAP_ATTRIBUTE_INDEX tells snapAttributes to use an index
586  /// into the list of snapped points to set the attributes for
587  /// other points.
589  {
590  SNAP_ATTRIBUTES_AVERAGE = 0,
591  SNAP_ATTRIBUTES_INDEX
592  };
593 
594  /// This version of snapping snaps onto grid coordinates. You specify
595  /// the number of lines per HUnit, so "2" for example will snap to 0.5
596  /// boundaries.
597  /// type is 0 for round nearest, 1 for round down, 2 for round up.
598  /// 0.5 rounds up in nearest.
599  SYS_DEPRECATED_HDK_REPLACE(17.5,GU_Snap)
600  void snapGrid(int type,
601  float xlines, float ylines, float zlines,
602  float xoff, float yoff, float zoff,
603  float tol,
604  const GA_PointGroup *ptGrp=0);
605  /// Same as above, but with UVs...
606  SYS_DEPRECATED_HDK_REPLACE(17.5,GU_Snap)
607  void snapGridPointUVs(int type,
608  float xlines, float ylines, float zlines,
609  float xoff, float yoff, float zoff,
610  float tol,
611  const GA_PointGroup *ptGrp=0);
612  SYS_DEPRECATED_HDK_REPLACE(17.5,GU_Snap)
613  void snapGridPointUVs(
614  const GA_RWHandleV3 &uvattrib, int type,
615  float xlines, float ylines, float zlines,
616  float xoff, float yoff, float zoff,
617  float tol,
618  const GA_PointGroup *ptGrp=0);
619  SYS_DEPRECATED_HDK_REPLACE(17.5,GU_Snap)
620  void snapGridVertexUVs(int type,
621  float xlines, float ylines, float zlines,
622  float xoff, float yoff, float zoff,
623  float tol,
624  const GA_VertexGroup *vtxGrp=0);
625  SYS_DEPRECATED_HDK_REPLACE(17.5,GU_Snap)
626  void snapGridVertexUVs(
627  const GA_RWHandleV3 &uvattrib, int type,
628  float xlines, float ylines, float zlines,
629  float xoff, float yoff, float zoff,
630  float tol,
631  const GA_VertexGroup *vtxGrp=0);
632 
633  /// Build holes in the geometry by bridging the holes to their outlines
634  /// The angle should be specified as the angle (in degrees) between
635  /// the normals.
636  int buildHoles(float dist = 0.001F, float angle = 0.2F,
637  int snapFace=0,
638  const GA_PrimitiveGroup *primGroup=0);
639 
640  /// Remove bridged holes from other than polygons
641  void unHole(const GA_PrimitiveGroup *primGroup=0);
642 
643  /// Unique all points in the detail. If a point group is specified,
644  /// then only points in that group are uniqued
645  /// If a primitive group is specified, only those primitives will
646  /// have their points uniqued.
648  void uniquePoints(const GA_PointGroup *group=0);
649 
650  /// Unique all the points that are in this primitive, even if referenced
651  /// by other primitives.
653  void uniquePrimitive(GEO_Primitive *prim);
654 
655  /// Remove repeated references of vertices in the faces, then remove all
656  /// degenerate primitives regardless of their type.
657  /// Set removeRepPoints flag to remove the repeat points as well and
658  /// the deletePoints flag to delete the points that were part of the
659  /// degenerate primitive.
660  GA_Size cleanData (const GA_PrimitiveGroup *primGrp=0,
661  bool removeRepPoints = false,
662  float tol = 0.001F,
663  bool deleteDegenPrimPoints = false,
664  bool deleteOrphanedPoints = false,
665  bool deleteDegenerateBridges = false);
666 
667  /// Identify dirty data, which is the degenerate primitives that would
668  /// be deleted by cleanData. Return them in the returnGrp, and return
669  /// the number of dirty primitives. If returnGrp is nullptr then only
670  /// return the count.
671  GA_Size getDirtyData (GA_PrimitiveGroup *returnGrp,
672  const GA_PrimitiveGroup *primGrp=0,
673  bool checkRepPoints = false,
674  float tol = 0.001F);
675 
676  /// If the applyToVertex is less than 0, the "natural" place will be use,
677  /// otherwise 0 = point attrib, 1 = vertex attrib
678  /// Returns false if the attribute failed to be created, else true.
679  bool applyTexture(GU_TextureType type, GU_AxisType axis,
680  const GA_PrimitiveGroup *primGroup=0,
681  int applyToVertex = -1, int fixPolySeams = 0,
682  const GU_CameraParms *userData = 0);
683  /// If the applyToVertex is less than 0, the "natural" place will be use,
684  /// otherwise 0 = point attrib, 1 = vertex attrib
685  /// Returns false if the attribute failed to be created, else true.
686  bool applyTexture(const UT_StringRef &uvattribname,
687  GU_TextureType type, GU_AxisType axis,
688  const GA_PrimitiveGroup *primGroup=0,
689  int applyToVertex = -1, int fixPolySeams = 0,
690  const GU_CameraParms *userData = 0);
691  /// The scaleTexture() and rotateTexture() methods are depreciated. Please
692  /// use the GU_MODIFY_TEX projection and simply create the approprate
693  /// post-transform.
694  /// Returns false if the attribute failed to be created, else true.
695  bool scaleTexture(float umult = 1, float uoff = 0,
696  float vmult = 1, float voff = 0,
697  float wmult = 1, float woff = 0,
698  const GA_PrimitiveGroup *primGroup=0);
699  bool scaleTexture(const UT_StringRef &uvattribname,
700  float umult = 1, float uoff = 0,
701  float vmult = 1, float voff = 0,
702  float wmult = 1, float woff = 0,
703  const GA_PrimitiveGroup *primGroup=0);
704  bool rotateTexture(float angle,
705  const GA_PrimitiveGroup *primGroup=0);
706  bool rotateTexture(const UT_StringRef &uvattribname,
707  float angle,
708  const GA_PrimitiveGroup *primGroup=0);
709 
710  /// Methods for transforming point and vertex texture attributes:
711  void transformPointTexture(const UT_Matrix4& mat,
712  const GA_PointGroup *ptGroup=nullptr,
713  GEO_Delta *geodelta=0);
714 
715  void transformPointTexture(
716  const GA_RWHandleV3 &pth,
717  const UT_Matrix4& mat,
718  const GA_PointGroup *ptGroup=nullptr,
719  GEO_Delta *geodelta=0);
720 
721  /// Precompute a list of points to soft transform, along with
722  /// the distance (squared) to the closest "hard" point.
723  /// The metric specifies how distance is measured in space.
724  void computeSoftTransformPointTextureCache(
725  GEO_SoftTransformCache &cache,
726  const GA_PointGroup *ptgroup,
727  const GEO_Rolloff &rolloff,
728  const GU_MetricType metric) const;
729 
730  /// Precompute a list of points to soft transform, along with
731  /// the distance (squared) to the closest "hard" point.
732  /// The metric specifies how distance is measured in space.
733  void computeSoftTransformPointTextureCache(
734  const GA_ROHandleV3 &pttxth,
735  GEO_SoftTransformCache &cache,
736  const GA_PointGroup *ptgroup,
737  const GEO_Rolloff &rolloff,
738  const GU_MetricType metric) const;
739 
740  /// falloff_output - any non-zero falloffs used during this call will be
741  /// written to this attribute when provided
742  /// falloff_written - will be set to true when provided if falloff_output
743  /// is provided, and this call did not skip processing
744  /// any non-zero falloffs. If not set, you must call
745  /// computeSoftPointFalloff() to obtain the falloffs.
746  void softTransformPointTexture(
747  const UT_XformOrder &order,
748  float tx, float ty, float tz,
749  float rx, float ry, float rz,
750  float sx, float sy, float sz,
751  float s_xy, float s_xz, float s_yz,
752  float px, float py, float pz,
753  const GEO_SoftTransformCache &cache,
754  const GEO_Rolloff &rolloff,
755  GEO_Delta *geodelta = 0,
756  const GA_RWHandleF *falloff_output = nullptr,
757  bool *falloff_written = nullptr);
758 
759  /// falloff_output - any non-zero falloffs used during this call will be
760  /// written to this attribute when provided
761  /// falloff_written - will be set to true when provided if falloff_output
762  /// is provided, and this call did not skip processing
763  /// any non-zero falloffs. If not set, you must call
764  /// computeSoftPointFalloff() to obtain the falloffs.
765  void softTransformPointTexture(
766  const GA_RWHandleV3 &ptattr,
767  const UT_XformOrder &order,
768  float tx, float ty, float tz,
769  float rx, float ry, float rz,
770  float sx, float sy, float sz,
771  float s_xy, float s_xz, float s_yz,
772  float px, float py, float pz,
773  const GEO_SoftTransformCache &cache,
774  const GEO_Rolloff &rolloff,
775  GEO_Delta *geodelta = 0,
776  const GA_RWHandleF *falloff_output = nullptr,
777  bool *falloff_written = nullptr);
778 
779  void transformVertexTexture(const UT_Matrix4& mat,
780  const GA_VertexGroup *vertexGroup=nullptr,
781  GEO_Delta *geodelta=0);
782 
783  void transformVertexTexture(
784  const GA_RWHandleV3 &vtxh,
785  const UT_Matrix4& mat,
786  const GA_VertexGroup *vertexGroup=nullptr,
787  GEO_Delta *geodelta=0);
788 
789  /// Precompute a list of vertices to soft transform, along with
790  /// the distance (squared) to the closest "hard" point.
791  /// The metric specifies how distance is measured in space.
792  /// ignore_uv_connectivity controls whether we affect vertices
793  /// which are not in the same uvw-wise connected component.
794  void computeSoftTransformVertexTextureCache(
795  GEO_SoftTransformCache &cache,
796  const GA_VertexGroup *vtxgroup,
797  const GEO_Rolloff &rolloff,
798  const GU_MetricType metric,
799  bool ignore_uv_connectivity) const;
800 
801  /// Precompute a list of vertices to soft transform, along with
802  /// the distance (squared) to the closest "hard" point.
803  /// The metric specifies how distance is measured in space.
804  /// ignore_uv_connectivity controls whether we affect vertices
805  /// which are not in the same uvw-wise connected component.
806  void computeSoftTransformVertexTextureCache(
807  const GA_ROHandleV3 &vtxh,
808  GEO_SoftTransformCache &cache,
809  const GA_VertexGroup *vtxgroup,
810  const GEO_Rolloff &rolloff,
811  const GU_MetricType metric,
812  bool ignore_uv_connectivity) const;
813 
814  /// falloff_output - any non-zero falloffs used during this call will be
815  /// written to this attribute when provided
816  /// falloff_written - will be set to true when provided if falloff_output
817  /// is provided, and this call did not skip processing
818  /// any non-zero falloffs. If not set, you must call
819  /// computeSoftPointFalloff() to obtain the falloffs.
820  void softTransformVertexTexture(
821  const UT_XformOrder &order,
822  float tx, float ty, float tz,
823  float rx, float ry, float rz,
824  float sx, float sy, float sz,
825  float s_xy, float s_xz, float s_yz,
826  float px, float py, float pz,
827  const GEO_SoftTransformCache &cache,
828  const GEO_Rolloff &rolloff,
829  GEO_Delta *geodelta = 0,
830  const GA_RWHandleF *falloff_output = nullptr,
831  bool *falloff_written = nullptr);
832 
833  /// falloff_output - any non-zero falloffs used during this call will be
834  /// written to this attribute when provided
835  /// falloff_written - will be set to true when provided if falloff_output
836  /// is provided, and this call did not skip processing
837  /// any non-zero falloffs. If not set, you must call
838  /// computeSoftPointFalloff() to obtain the falloffs.
839  void softTransformVertexTexture(
840  const GA_RWHandleV3 &vtxh,
841  const UT_XformOrder &order,
842  float tx, float ty, float tz,
843  float rx, float ry, float rz,
844  float sx, float sy, float sz,
845  float s_xy, float s_xz, float s_yz,
846  float px, float py, float pz,
847  const GEO_SoftTransformCache &cache,
848  const GEO_Rolloff &rolloff,
849  GEO_Delta *geodelta = 0,
850  const GA_RWHandleF *falloff_output = nullptr,
851  bool *falloff_written = nullptr);
852 
853  /// This routine will compute the average normal of a group of points.
854  /// Returns true on success and false on failure.
855  /// NOTE: The version that doesn't take a point normal attribute handle
856  /// will temporarily create a detached point normal attribute if a point N
857  /// doesn't already exist. The caller may or may not want to cache
858  /// a detached attribute and pass it in, instead.
859  /// @{
860  bool computeAvgNormal(
861  const GA_PointGroup *group,
862  const GA_ROHandleV3 &normals,
863  UT_Vector3 &avg_normal) const;
864  bool computeAvgNormal(
865  const GA_PointGroup *group,
866  UT_Vector3 &avg_normal) const;
867  /// @}
868 
869  /// Reverse polygons
870  void reversePolys(const GA_PrimitiveGroup *prmGrp=0);
871 
872  /// Conversion Routines - to convert from one primitive to another
873  /// @{
874  void convert(GEO_ConvertParms &parms);
875  void convertNew(GEO_ConvertParms &parms);
876  /// @}
877 
878  /// This routine only converts metaballs using a more comprehensive set
879  /// of parameters.
880  void convertMetaballs(
881  GEO_MetaConvertParms &parms,
882  const GA_PrimitiveGroup *prim_grp = nullptr);
883 
884  //
885  // SORTING
886  //
887 
888  /// Sort by the specified dominant axis
889  /// @{
890  void sortPoints(GA_IndexMap &array,
891  GU_AxisType axis = GU_XAXIS)
892  { sortPoints(array, GA_Range(array), axis); }
893  void sortPoints(GA_IndexMap &array, const GA_Range &range,
894  GU_AxisType axis);
895  void sortPoints(GA_OffsetArray &array,
896  GU_AxisType axis = GU_XAXIS);
898  GU_AxisType axis = GU_XAXIS)
899  { sortPrims(array, GA_Range(array), axis); }
900  void sortPrims(GA_IndexMap &array, const GA_Range &range,
901  GU_AxisType axis);
903  { sortPoints(getIndexMap(GA_ATTRIB_POINT), axis); }
905  { sortPrims(getIndexMap(GA_ATTRIB_PRIMITIVE), axis); }
906  /// @}
907 
908  /// Sorting by spatial locality. The points and primitives will be
909  /// sorted in a way that tries to assign nearby primitives closer
910  /// primitive ids.
911  /// @{
913  { sortPointsSpatial(GA_Range(getPointMap())); }
914  void sortPointsSpatial(const GA_Range &range);
916  { sortPrimsSpatial(GA_Range(getPrimitiveMap())); }
917  void sortPrimsSpatial(const GA_Range &range);
918  /// @}
919 
920  /// Sort along an arbitrary vector
921  /// @{
923  const UT_Vector3 &o, const UT_Vector3 &d)
924  { sortPoints(array, GA_Range(array), o, d); }
925  void sortPoints(GA_IndexMap &array, const GA_Range &range,
926  const UT_Vector3 &o, const UT_Vector3 &d);
928  const UT_Vector3 &o, const UT_Vector3 &d)
929  { sortPrims(array, GA_Range(array), o, d); }
930  void sortPrims(GA_IndexMap &array, const GA_Range &range,
931  const UT_Vector3 &o, const UT_Vector3 &d);
932  void sortPointList(const UT_Vector3 &o, const UT_Vector3 &d)
933  { sortPoints(getIndexMap(GA_ATTRIB_POINT), o, d); }
935  const UT_Vector3 &d)
936  { sortPrims(getIndexMap(GA_ATTRIB_PRIMITIVE), o, d); }
937  /// @}
938 
939  /// Sort in random order
940  /// @{
941  void sortPoints(GA_IndexMap &array, int seed);
942  void sortPrims(GA_IndexMap &array, int seed);
943  void sortPointList(int seed)
944  { sortPoints(getIndexMap(GA_ATTRIB_POINT), seed); }
945  void sortPrimitiveList(int seed)
946  { sortPrims(getIndexMap(GA_ATTRIB_PRIMITIVE), seed); }
947  /// @}
948 
949  /// Sorting according to a provided value list
950  /// The order is indexed by the GA_Index of the elemnents, NOT the
951  /// GA_Offset or order within the range.
952  /// @{
954  { sortElements(array, GA_Range(array), order); }
956  { sortElements(array, GA_Range(array), order); }
957  void sortElements(GA_IndexMap &array, const GA_Range &range,
958  fpreal *order);
959  void sortElements(GA_IndexMap &array, const GA_Range &range,
960  exint *order);
962  { sortElements(getIndexMap(GA_ATTRIB_POINT), order); }
964  { sortElements(getIndexMap(GA_ATTRIB_POINT), order); }
966  { sortElements(getIndexMap(GA_ATTRIB_PRIMITIVE), order); }
968  { sortElements(getIndexMap(GA_ATTRIB_PRIMITIVE), order); }
969  /// @}
970 
971  /// "Rotate" (cycle) the order of vertices for all primitives in the group,
972  /// by the specified number of places.
973  void shift(int uoffset, int voffset,
974  const GA_PrimitiveGroup *group = nullptr);
975 
976  /// "Rotate" (cycle) the order of points or primitives in the detail, by the
977  /// specified number of places.
978  /// @{
980  { shiftPoints(map, GA_Range(map), offset); }
982  { shiftPrims(map, GA_Range(map), offset); }
983  void shiftPoints(GA_IndexMap &map, const GA_Range &range,
984  GA_Size offset);
985  void shiftPrims(GA_IndexMap &map, const GA_Range &range,
986  GA_Size offset);
987  void shiftPointList(GA_Size aoffset)
988  { shiftPoints(getIndexMap(GA_ATTRIB_POINT), aoffset); }
990  { shiftPrims(getIndexMap(GA_ATTRIB_PRIMITIVE), aoffset); }
991  /// @}
992 
993  /// Reverse vertices for all primitives in the group
994  /// This sill also reverse point normals, vertex normals, and correct
995  /// creaseweight attriutes if update_attributes is requested.
996  void reverse(const GA_PrimitiveGroup *group = nullptr,
997  bool update_attributes = true);
998 
999  /// Reverse order of points or primitives in the detail.
1000  /// @{
1002  { reversePoints(map, GA_Range(map)); }
1004  { reversePrims(map, GA_Range(map)); }
1005  void reversePoints(GA_IndexMap &map, const GA_Range &range);
1006  void reversePrims(GA_IndexMap &map, const GA_Range &range);
1008  { reversePoints(getIndexMap(GA_ATTRIB_POINT)); }
1010  { reversePrims(getIndexMap(GA_ATTRIB_PRIMITIVE)); }
1011  /// @}
1012 
1013  /// Sort points or primitives by proximity to a position
1014  /// @{
1016  const UT_Vector3 &point)
1017  { proximityPoints(points, GA_Range(points), point); }
1018  void proximityPrims(GA_IndexMap &primitives,
1019  const UT_Vector3 &point)
1020  { proximityPrims(primitives, GA_Range(primitives), point); }
1021  void proximityPoints(GA_IndexMap &points,
1022  const GA_Range &range,
1023  const UT_Vector3 &point);
1024  void proximityPrims(GA_IndexMap &primitives,
1025  const GA_Range &range,
1026  const UT_Vector3 &point);
1028  { proximityPoints(getIndexMap(GA_ATTRIB_POINT), point); }
1030  { proximityPrims(getIndexMap(GA_ATTRIB_PRIMITIVE), point); }
1031  /// @}
1032 
1033  /// Sort points by the order in which they are first referred-to by
1034  /// vertices.
1035  /// @{
1037  { vertexOrder(points, GA_Range(points)); }
1038  void vertexOrder(GA_IndexMap &points, const GA_Range &range);
1040  { vertexOrder(getIndexMap(GA_ATTRIB_POINT)); }
1041  /// @}
1042 
1043  /// Create a mesh primitive or polygon primitives representing a
1044  /// super-quadric surface specified by parms.
1045  void superEllipsoid(const GU_SuperQuadParms &parms);
1046 
1047  /// Split the specified polygon into convex polygons with at most
1048  /// maxpts vertices each. By default, this triangulates the polygon.
1049  /// If flipedges is true, it will flip edges to get the Delaunay
1050  /// triangulation, avoiding small angles where possible.
1051  /// If avoiddegeneracy is true, degenerate triangles will not be generated;
1052  /// note that this means that the mesh may not be watertight or even
1053  /// connected.
1054  void convexPoly(GEO_PrimPoly *pp, GA_ElementWranglerCache &wranglers,
1055  GA_Size maxpts = 3, const GA_Detail *restgdp=0,
1056  bool flipedges = false, bool avoiddegeneracy = false);
1057  /// Split polygons in the specified polygon soup into convex polygons
1058  /// with at most maxpts vertices each. By default, this triangulates the
1059  /// polygon. If flipedges is true, it will flip edges to get the Delaunay
1060  /// triangulation, avoiding small angles where possible.
1061  /// If avoiddegeneracy is true, degenerate triangles will not be generated;
1062  /// note that this means that the mesh may not be watertight or even
1063  /// connected.
1064  void convexPolySoup(GEO_PrimPolySoup *polysoup,
1065  GA_Size maxpts = 3, const GA_Detail*restgdp=0,
1066  bool flipedges = false,
1067  bool avoiddegeneracy = false);
1068  /// Split polygons (including in polygon soups) in the detail into convex
1069  /// polygons with at most maxpts vertices each. By default, this
1070  /// triangulates the polygon. If flipedges is true, it will flip edges to
1071  /// get the Delaunay triangulation, avoiding small angles where possible.
1072  /// If avoiddegeneracy is true, degenerate triangles will not be generated;
1073  /// note that this means that the mesh may not be watertight or even
1074  /// connected.
1075  void convex(GA_Size maxpts=3, GA_PrimitiveGroup *primGroup=0,
1076  const GA_Detail *restgdp=0, bool flipedges = false,
1077  bool avoiddegeneracy = false);
1078 
1079  /// Add non-planar polygon primitives to nonplanargroup.
1080  GA_Size findNonPlanar(
1081  GA_PrimitiveGroup *nonplanargroup,
1082  float tol = 0.0001F,
1083  const GA_PrimitiveGroup *searchprimgroup = nullptr);
1084 
1085  /// Clip primitives, keeping everything where dot(normal, P) >= d.
1086  /// If clippts is true, disconnected points are also clipped.
1087  void clip(UT_Vector3 &normal, float d = 0, int normlize = 0,
1088  const GA_PrimitiveGroup *primGroup = 0,
1089  bool clippts = false);
1090 
1091 //
1092 // Polygon creasing
1093  void crease(UT_Vector3 &normal, float d = 0,
1094  int normlize = 0, int outputGroups = 0,
1095  GA_PrimitiveGroup *above = 0,
1096  GA_PrimitiveGroup *below = 0,
1097  const GA_PrimitiveGroup *creaseGroup = 0);
1098 //
1099 // fractals
1100  void fractalize(int seed = 1, float roughness = 0.6F,
1101  float scaleby=1, int divs=1,
1102  int fixedBoundry = 1, int useVtxNorms = 0,
1103  float nx = 0, float ny = 0, float nz = 1,
1104  const GA_PrimitiveGroup *fractalGroup = 0);
1105 
1106  //
1107  // Shrink Wrap and tools
1108 
1109  /// This routine is originally developed for the Bullet RBD solver to adjust
1110  /// the geometry of a convex 3D polygon to remove the space around the geometry
1111  /// caused by the collision margin required for the Bullet solver.
1112  void shrink( fpreal distance,
1113  fpreal clip_tolerance = 0.0001,
1114  fpreal consilidate_tolerance = 0.001);
1115 
1116  /// preliminary routine to setup the gdp to be shrunk by the shrink routine
1117  bool tetrahedralizeForShrink( const GA_PointGroup *ptGroup = 0,
1118  GU_Detail *gdp = 0 );
1119 
1120 
1121  /// Twist operations. The method returns 0 if everything goes OK, else -1.
1122  /// "pasted" returns 1 if at least one pasted surface was involved in
1123  /// the deformation, else 0.
1124  int nonLinearDeform(GU_DeformType type,const GU_TwistParms &parms,
1125  int &pasted);
1126 
1127  /// NOTE: This is something specific to NURBS surfaces and it uses
1128  /// pasted surface primitives, so it's probably not what you want!!!
1129  /// Creates an offset surface from the specified surface & radius.
1130  GEO_Hull *offset(const GU_OffsetParms &parms);
1131 
1132  /// Create a Gordon surface out of the given bi-linear network of faces.
1133  /// The faces don't have to be the same type or order or anything.
1134  /// We return the surface if OK and 0 otherwise. If the u or v faces
1135  /// contain only one face, we automatically generate a final curve. If
1136  /// both u faces and vfaces have 1 curve or one has 2 and the other 1,
1137  /// we generate a Coons surface. "accurate" is used when the curves do not
1138  /// intersect (i.e. when we must compute their min distances).
1139  /// @{
1140  GEO_Hull *gordon(GEO_SurfaceType surftype, int accurate,
1141  const GA_PrimitiveGroup &ufaces,
1142  const GA_PrimitiveGroup &vfaces,
1143  int reparameterize = 0);
1144  GEO_Hull *gordon(GEO_SurfaceType surftype, int accurate,
1145  const UT_Array<GEO_Primitive*> &uprims_in,
1146  const UT_Array<GEO_Primitive*> &vprims_in,
1147  GU_SkinCache& skin_cache,
1148  int reparameterize = 0);
1149  /// @}
1150 
1151  /// Generate a Coons surface out of up to 4 boundary curves. Return a
1152  /// pointer to the surface if successful and 0 otherwise. The faces do
1153  /// not have to have the same type or order.
1154  GEO_Hull *coons(GEO_SurfaceType surftype,
1155  const GEO_Face &uface1, const GEO_Face &vface1,
1156  const GEO_Face *uface2 = 0, const GEO_Face *vface2 = 0);
1157 
1158  /// Generate a skinned surface out of a set of cross-sections. The faces
1159  /// don't have to be the same type or order. We return the surface is OK
1160  /// and 0 otherwise. Specifying a vorder of 0 tells the method to
1161  /// come up with a legal default value for the surface. If "doskin" is
1162  /// true, the cross-sections will be right on the surface; otherwise, we
1163  /// build a ruled surface, which simply steals the curves' CVs and assigns
1164  /// them to the surface.
1165  GEO_Hull *skin(GU_SkinParms &parms, GU_SkinCache& skin_cache);
1166 
1167  /// This restrictive skinning method assumes the faces are of the same type
1168  /// and have the same number of CVs. order 0 means pick most suitable one.
1169  /// If doskin is false, we build a ruled surface. nprims is the number
1170  /// of faces in the group; we compute it if -1. We return the resulting
1171  /// surface and do not delete the input faces. We also assume that if
1172  /// nprims > 2 and vorder != 2 and doskin, all the faces are nonrational.
1173  /// Finally, the provided vParmValues if given specifies what v coordinate
1174  /// each of the provided faces should interpolate.
1175  /// @{
1176  GEO_Hull *skin(const GA_PrimitiveGroup &ucfaces,
1177  GEO_SurfaceType surftype = GEO_PATCH_QUADS,
1178  unsigned vorder = 0, int vwrap = 0,
1179  int doskin = 1, int nprims = -1,
1180  const UT_Vector *vParmValues = 0);
1181  GEO_Hull *skin(const UT_Array<GEO_Primitive*> & prims_in,
1182  GU_SkinCache& skin_cache,
1183  GEO_SurfaceType surftype = GEO_PATCH_QUADS,
1184  unsigned vorder = 0, int vwrap = 0,
1185  int doskin = 1, int nprims = -1,
1186  const UT_Vector *vParmValues = 0);
1187  /// @}
1188 
1189  /// See GU_Ruled.h for the various closure and interpolation types
1190  /// which are valid. Specifying an orderv of 0 makes the routine
1191  /// come up with a legal default value for the surface.
1192  int ruled( GEO_Hull *&surface, const GU_RuledParms &p,
1193  const GU_CapOptions &caps);
1194 
1195  /// This is what the Skin SOP and Sweep SOP use for skinning
1196  /// cross-sections.
1197  /// See GU_CurveNetwork.h for parameter types. This method generates
1198  /// a skinned surface, a Coons surface, or a Gordon surface depending on
1199  /// the primitive groups it is given. Specifying an orderv of 0 makes the
1200  /// routine come up with a legal default value for the surface.
1201  int curveNetwork(GEO_Hull *&hull, GU_CurveNetworkParms &p,
1202  int &count, GU_SkinCache& skin_cache);
1203 
1204  GU_ERROR sweep( GU_SweepParms parms );
1205  void rails( GU_RailParms parms );
1206 
1207  /// Join more faces or surfaces together.
1209 
1210  /// Generate a fillet between two curves on surfaces:
1211  GEO_Hull *filletTrims(GU_TrimFilletParms &parms, int &count);
1212 
1213  /// Generate a rounded fillet:
1214  GEO_Hull *filletRound(GU_RoundFilletParms &parms);
1215  /// NOTE: The first 5 columns of the matrix must be GEO_Curve*,
1216  /// and the other 2 columns of the matrix must be GEO_TPSurf*.
1217  void filletRoundNetwork(
1218  const UT_RefMatrix<GEO_Primitive *> &facematrix,
1219  GU_RoundFilletParms &parms);
1220 
1221  /// Fillet a set of faces/hulls
1222  /// Return 0 if OK, -1 otherwise (non face/hull types)
1223  int fillet(GU_FilletParms &parms, int &count);
1224 
1225  /// Loft (stitch) a number of polygons together without changing the number
1226  /// of points in the detail.
1227  /// @{
1228  void loft(GU_LoftParms &p, const GA_PointGroup &g1,
1229  const GA_PointGroup &g2);
1230  void loft(GU_LoftParms &p,
1231  const GA_PrimitiveGroup *group = 0);
1232  /// @}
1233 
1234  /// Revolves all curves in the given gdp (or only curves in the
1235  /// group if the group is given) around a line given by the center
1236  /// and axis. Only polygonal curves use the divisions. NURBS and
1237  /// Bezier curves are revolved a special way to create a perfectly
1238  /// round surface with a minimum number of revolution copies.
1239  int revolve( const GU_RevolveParms &parms,
1240  const GU_CapOptions &caps, int &count);
1241 
1242  /// Warp curves or surfaces. Return 0 if successful and -1 otherwise.
1243  int warp(GU_WarpParms &parms);
1244 
1245  /// Curve Clay it!
1246  GU_ERROR curveClay(const GU_CurveClayParms &ccparm);
1247 
1248  /// This puts endcaps on the specified hull
1249  int endCap(GEO_Hull &hull, const GU_CapParms &parms);
1250  int endCap(GEO_Face &face, const GU_CapParms &parms);
1251 
1252  /// This places all caps on the hull
1253  int setCaps(GEO_Hull &hull, const GU_CapOptions &parms, int &count);
1254  int setCaps(GEO_Face &face, const GU_CapOptions &parms, int &count);
1255 
1256  /// Creates a deformed copy of a source detail given a pair of
1257  /// rest and deform details. Return 1 if a pasted surface was deformed,
1258  /// else 0. If 'deform_history' is passed in, every time we deform a point
1259  /// from our source, we mark this by setting the bit in 'deform_history'
1260  /// whose index corresponds to the point's number to 1. Useful if you want
1261  /// to know which points we deformed.
1262  int lattice(const GU_Detail *source, const GU_Detail *rest,
1263  const GU_Detail *deform, int xdiv, int ydiv, int zdiv,
1264  const GA_PointGroup *ptgroup = 0,
1265  UT_BitArray *deform_history = nullptr,
1267 
1268  /// All points of the gdp are deformed according to the meta source
1269  /// field that surrounds it. The deformation is controlled by a
1270  /// transformation matrix.
1271  int magnet( const GU_MagnetParms &parms );
1272 
1273  /// trace a raster image to form closed polygons
1274  float trace(GU_TraceParms *parms);
1275 
1276  /// add point texture attributes to traced geometry
1277  void applyTraceTexture(float xres, float yres, float resolution);
1278 
1279 
1280  /// fit a sequence of discrete points to a series of bezier curves
1281  void fit2DCurve(const GU_Detail *source, float error_squared,
1282  GA_PrimitiveGroup *primGroup = 0);
1283 
1284  /// Fit a curve through its breakpoints
1285  /// @{
1286  GEO_Curve *interpCurveBreakpoints(const GEO_Face &face,
1288  int order=4,
1290  GEO_Curve *interpCurveBreakpoints(const GA_OffsetList &point_offsets,
1292  int order=4, int wrapped=0,
1294  GEO_Curve *interpCurveBreakpoints(const UT_Vector4Array &v4Data,
1296  int order=4, int wrapped=0,
1298  const bool elevate_order_if_required = true);
1299  /// @}
1300 
1301  /// interpolation data points
1302  /// @{
1303  GEO_Curve *interpCurveGlobal(const GEO_Face &face,
1305  int order=4,
1308  GEO_Curve *interpCurveGlobal(const GA_OffsetList &point_offsets,
1310  int order=4, int wrapped=0,
1313  GEO_Curve *interpCurveGlobal(const GA_Range &point_range,
1315  int order=4, int wrapped=0,
1318  GEO_Curve *interpCurveGlobal(const UT_Vector4Array &v4Data,
1320  int order=4, int wrapped=0,
1323  const bool elevate_order_if_required = true);
1324  GEO_Curve *interpCurveLocal(const GEO_Face &face,
1326  int order = 4, int corner=0);
1327  GEO_Curve *interpCurveLocal(const UT_Array<GA_Offset> &goData,
1329  int order = 4, int wrapped=0, int corner=0);
1330  GEO_Curve *interpCurveLocal(const UT_Vector4Array &v4Data,
1332  int order = 4, int wrapped=0, int corner=0);
1333 
1334  GEO_TPSurf *interpSurfGlobal(const GEO_Hull &mesh,
1336  int uOrder=4, int vOrder=4,
1342  const UT_Vector *uParmValues = 0,
1343  const UT_Vector *vParmValues = 0);
1344 
1345  GEO_TPSurf *interpSurfGlobal(const GA_OffsetMatrix &goMesh,
1347  int uOrder=4, int vOrder=4,
1348  bool uWrapped=false, bool vWrapped=false,
1354  const UT_Vector *uParmValues = 0,
1355  const UT_Vector *vParmValues = 0);
1356 
1357  GEO_TPSurf *interpSurfBreakpoints(const GEO_Hull &mesh,
1359  int uOrder=4, int vOrder=4,
1365  const UT_Vector *uParmValues = 0,
1366  const UT_Vector *vParmValues = 0);
1367 
1368  GEO_TPSurf *interpSurfBreakpoints(const GA_OffsetMatrix &goMesh,
1370  int uOrder=4, int vOrder=4,
1371  bool uWrapped=false, bool vWrapped=false,
1377  const UT_Vector *uParmValues = 0,
1378  const UT_Vector *vParmValues = 0);
1379  /// @}
1380 
1381  /// Approximate data points given a tolerance.
1382  /// Only for open endinterpolated surface.
1383  /// @{
1384  GEO_Curve *approxCurveGlobal(const GEO_Face &face,
1386  int order=4,
1387  float tol=1e-1F, float smooth=0.0F,
1388  int noMultipleKnots=1);
1389  GEO_Curve *approxCurveGlobal(const UT_Vector4Array &v4Data,
1391  int order=4, int wrapped=0,
1392  float tol=1e-1F, float smooth=0.0F,
1393  int noMultipleKnots=1);
1394 
1395  GEO_TPSurf *approxSurfGlobal(const GEO_Hull &mesh,
1397  int uOrder=4, int vOrder=4,
1399  float tol=1e-1F, float smooth=0.0F,
1400  int uNoMultipleKnots=1,
1401  int vNoMultipleKnots=1);
1402  GEO_TPSurf *approxSurfGlobal(const GA_OffsetMatrix &gpMesh,
1404  int uOrder=4, int vOrder=4,
1405  int uWrapped=0, int vWrapped=0,
1407  float tol=1e-1F, float smooth=0.0F,
1408  int uNoMultipleKnots=1,
1409  int vNoMultipleKnots=1);
1410  /// @}
1411 
1412  /// methods to refine face and hull types
1413  /// @{
1414  void refine(float *uunit, int ulen,
1415  float *vunit, int vlen,
1416  int countu=1, int countv=1,
1417  int arcspacing = 0,
1418  const GA_PrimitiveGroup *primGroup = 0);
1419 
1420  void unrefine(float umin, float umax,
1421  float vmin, float vmax,
1422  int countu=1, int countv=1,
1423  float utol=0.001F, float vtol=0.001F,
1424  const GA_PrimitiveGroup *primGroup = 0);
1425 
1426  void subdivide(float *uunit, int ulen,
1427  float *vunit, int vlen,
1428  int arcspacing = 0,
1429  const GA_PrimitiveGroup *primGroup = 0);
1430 
1431  /// op = {0 = isoparms, 1 = points, 2 = profiles}
1432  int extract(float *uunit, int ulen,
1433  float *vunit, int vlen,
1434  const GA_PrimitiveGroup *primGroup = 0,
1435  GA_PointGroup *newPoints = 0,
1436  int op = 0, int keepOriginal = 0,
1437  int atbreakpoints = 0, int use_arc_length = 0);
1438 
1439  void extractIsoParms(float *uunit, int ulen,
1440  float *vunit, int vlen,
1441  GA_PrimitiveGroup *newPrims = 0,
1442  const GA_PrimitiveGroup *primGroup = 0);
1443 
1444  void extractPoints(float *uunit, int ulen,
1445  float *vunit, int vlen,
1446  GA_PointGroup *newPoints = 0,
1447  const GA_PrimitiveGroup *primGroup = 0);
1448 
1449  void extractProfiles(float *uunit, int ulen,
1450  float *vunit, int vlen,
1451  const GA_PrimitiveGroup *primGroup = 0);
1452 
1453  void extractIsoParmsAtBreak(float *uunit, int ulen,
1454  float *vunit, int vlen,
1455  GA_PrimitiveGroup *newPrims = 0,
1456  const GA_PrimitiveGroup *primGroup = 0);
1457 
1458  void extractPointsAtBreak(float *uunit, int ulen,
1459  float *vunit, int vlen,
1460  GA_PointGroup *newPoints = 0,
1461  const GA_PrimitiveGroup *primGroup = 0);
1462 
1463  void extractProfilesAtBreak(float *uunit, int ulen,
1464  float *vunit, int vlen,
1465  const GA_PrimitiveGroup *primGroup = 0);
1466 
1467 
1468  int cut(float *uunit, int ulen,
1469  float *vunit, int vlen,
1470  const GA_PrimitiveGroup *primGroup = 0,
1471  int keepin=1, int keepout=0, int atbreakpoints = 0,
1472  int allU = 0, int allV = 0, int use_arc_length = 0);
1473  /// @}
1474 
1475 
1476  /// approximate a spline by using polygonal hull inputs
1477  /// deletes existing polygons if deleteAll is true
1478  void polySpline(GU_PolysplineParms &parms,
1479  const GA_PrimitiveGroup *primGroup = 0,
1480  bool deleteAll = true);
1481 
1482  /// approximate a patch by using polygonal or mesh hull inputs
1483  /// Returns true on success, else false if an error occurred.
1484  bool polyPatch(GU_PolypatchParms &parms,
1485  const GA_PrimitiveGroup *primGroup = 0);
1486 
1487  /// reduce the number of polygons in a detail:
1488  int polyReduce(GU_PolyReduceParms &parms,
1489  const GA_PrimitiveGroup *primGroup = 0,
1490  int *pointIndexTable = 0);
1491 
1492  /// Create polygon soup(s), i.e. GU_PrimPolySoup, where possible in this detail
1493  void polySoup(const GEO_PolySoupParms &parms , const GU_Detail *srcdetail);
1494 
1495  /// Create geometry through premise and rule substitution
1496  void lsystem(GU_LSystemParms &lp);
1497 
1498  /// Get information about a GU_Detail
1499  /// If maxlines < 0, there will be no limit to the number of groups
1500  /// If overridememusage is positive, it will be used rather than the
1501  /// getMemoryUsage().
1502  int info(std::ostream &os,
1503  int max_group_lines=15,
1504  bool pretty=false,
1505  const UT::ArraySet<const void *> *dontcounttheseblocks = 0,
1506  bool instanced=false) const;
1507  /// Get information text for the geometry. This will @b append to the work
1508  /// buffer.
1509  void info(UT_WorkBuffer &wbuf,
1510  int max_group_lines=15,
1511  bool pretty=false,
1512  const UT::ArraySet<const void *> *dontcounttheseblocks = 0,
1513  bool instanced=false) const;
1514 
1515  /// Fills in a stat structure with the volume information.
1516  void statVolumes(GA_Stat &stat, uint level/*=0xffff*/) const override;
1517 
1518  /// @c intersectRay will find the closest intersection with a primitive
1519  /// in the detail. If the dist pointer is nil, then the first intersection
1520  /// found will be returned (instead of the closest). The nml will contain
1521  /// the normal for the primitive at the point of intersection.
1522  /// Accuracy of 0 is inaccurate, 1 is normal, 2 engages Algebraic pruning
1523  /// where available.
1524  ///
1525  /// @param o The ray origin
1526  /// @param d The ray directin
1527  /// @param tmax This can be used to limit the ray to intersections within
1528  /// the given radius.
1529  /// @param tol Intersection tolerance
1530  /// @param dist Return the distance from the origin to the hit
1531  /// @param pos Return the hit position (i.e. <tt>o + dist*d</tt>)
1532  /// @param nml Return the normal of the primitive at the hit position
1533  /// @param accurate Determine primitive intersection algorithms for NURBS
1534  /// @param u The u parametric coordinate of the hit surface
1535  /// @param v The v parametric coordinate of the hit surface
1536  /// @param ignoretrim Ignore trim inside/out tests for trimmed surfaces.
1537  ///
1538  /// @warning If the @c dist parameter is 0 the first hit found will be
1539  /// returned. This may @b not be the closest hit. This can be used to
1540  /// perform a quick check to see if @b any primitives intersect the ray
1541  /// (i.e. for shadow casting).
1542  ///
1543  /// @warning This function iterates over all primitives without any
1544  /// acceleration structure. If you need to send multiple rays, please see
1545  /// GU_RayIntersect.
1546  SYS_DEPRECATED_HDK(16.0)
1547  GEO_Primitive *intersectRay(const UT_Vector3 &o, const UT_Vector3 &d,
1548  float tmax = 1E17F, float tol = 1E-12F,
1549  float *dist = 0, UT_Vector3 *pos = 0,
1550  UT_Vector3 *nml = 0, int accurate = 0,
1551  float *u = 0, float *v = 0,
1552  int ignoretrim = 1) const;
1553 
1554  /// Figure out the parameters of the face/surface that all the given
1555  /// faces/surfaces should have in order to be fully compatible with one
1556  /// another. Return 0 if all the primitive types are faces/surfaces,
1557  /// and -1 otherwise.
1558  /// @{
1559  int commonFaceConfig(
1560  const GA_PrimitiveGroup &faceGroup,
1561  GA_PrimCompat::TypeMask &type, int &order,
1562  bool &open, bool &ends) const;
1563  int commonFaceConfig(
1564  const UT_Array<GEO_Primitive*> &faces_in,
1565  GA_PrimCompat::TypeMask &type, int &order,
1566  bool &open, bool &ends) const;
1567  int commonSurfaceConfig(const GA_PrimitiveGroup &surfs,
1568  GA_PrimCompat::TypeMask &type,
1569  int &orderu, int &orderv,
1570  bool &openu, bool &openv,
1571  bool &endsu, bool &endsv) const;
1572  /// @}
1573 
1574  /// Incompatible faces in infaces are made compatible and set in outfaces.
1575  /// Return 0 of OK, -1 otherwise. If extratype is not nil and the highest
1576  /// face type of the infaces is less than *extratype, replace the common
1577  /// type by *extratype. In the method that takes 2 input groups, we make
1578  /// sure that the primitives in the 2 groups have the same type. Set
1579  /// equalcvs to true make them all have the same number of CVs too.
1580  /// @{
1581  int makeFacesCompatible(
1582  const GA_PrimitiveGroup &infaces,
1583  GA_PrimitiveGroup &outfaces,
1584  bool mustopen = false,
1585  bool mustends = false,
1586  bool nonrational = false,
1587  GA_PrimCompat::TypeMask *extratype = 0,
1588  bool equalcvs = true);
1589  int makeFacesCompatible(
1590  const UT_Array<GEO_Primitive*> &prims_in,
1591  UT_Array<GEO_Primitive*>& prims_out,
1592  bool mustopen = false,
1593  bool mustends = false,
1594  bool nonrational = false,
1595  GA_PrimCompat::TypeMask *extratype = 0,
1596  bool equalcvs = true);
1597  int makeFacesCompatible(
1598  const GA_PrimitiveGroup &infacesU,
1599  const GA_PrimitiveGroup &infacesV,
1600  GA_PrimitiveGroup &outfacesU,
1601  GA_PrimitiveGroup &outfacesV,
1602  bool mustopen = false,
1603  bool mustends = false,
1604  bool nonrational = false,
1605  GA_PrimCompat::TypeMask *extratype = 0,
1606  bool equalcvs = true);
1607  int makeFacesCompatible(
1608  const UT_Array<GEO_Primitive*> &ufaces_array,
1609  const UT_Array<GEO_Primitive*> &vfaces_array,
1610  UT_Array<GEO_Primitive*> &ucfaces_array,
1611  UT_Array<GEO_Primitive*> &vcfaces_array,
1612  bool mustopen = false,
1613  bool mustends = false,
1614  bool nonrational = false,
1615  GA_PrimCompat::TypeMask *extratype = 0,
1616  bool equalcvs = true);
1617  /// @}
1618 
1619  /// Loft a subsection of each hull and update the vertex indices where
1620  /// the subsection occurs. Does partial nurb merging if the bases is given
1621  /// Assumes the two hulls have been properly reconfigured.
1622  static int loftHulls(GEO_Hull *left, GEO_Hull *right,
1623  float lwidth1, float lwidth2,
1624  float rwidth1, float rwidth2,
1625  int sharp, int &lstart, int &rstart,
1626  int &lmax, int &rmax,
1627  int loftU, GA_NUBBasis *nubbasis);
1628 
1629  /// Refine the hull at the unit domain value and return the
1630  /// row/col index where it occurs
1631  /// @{
1632  static int getSubdividedCV(GEO_Hull *hull, int udir, float unit);
1633  static int getSubdividedCV(GEO_Face *face, float unit);
1634  /// @}
1635 
1636  /// Methods for registering and unregistering geometry io converters.
1637  /// @{
1638  static void registerIOTranslator(GEO_IOTranslator *trans);
1639  static void unregisterIOTranslator(GEO_IOTranslator *trans);
1640  static exint getIOTranslatorCount();
1641  static const GEO_IOTranslator *getIOTranslator(exint i);
1642  /// @}
1643 
1644  GA_Detail::IOStatus saveH9File(const char *filename,
1645  const GA_SaveOptions *options) const;
1646  static GA_Detail::IOStatus statH9File(const char *filename,
1647  GA_Stat &sbuf, uint level);
1648 
1649  /// Returns true if filename is a recognized extension.
1650  static bool isFormatSupported(const char *filename);
1651 
1652  /// Allocate an IO handler for a filename, or return nullptr if the handler
1653  /// is the classic format. The returned translator must be deleted. The
1654  /// easiest way to do this is with a UT_UniquePtr: @code
1655  /// UT_UniquePtr<GEO_IOTranslator> xlate(getSupportedFormat(filename));
1656  /// if (xlate)
1657  /// xlate->fileSave(gdp, ...);
1658  /// @endcode
1659  static GEO_IOTranslator *getSupportedFormat(const char *filename);
1660 
1661  /// Align a set of primitives by rotation and translation
1662  void align(GU_AlignParms &parms);
1663 
1664  /// Align a set of faces/hulls at optional levels of continuity.
1665  /// face/hull pre/posttranslate + row stitching + row tangent
1666  /// Faces are aligned with faces, hulls with hulls.
1667  /// Return 0 if OK, -1 otherwise (non face/hull types)
1668  int stitch(GU_StitchParms &parms);
1669 
1670  /// Incompatible surfaces in insurfs are made compatible and set in outsurfs.
1671  /// Return 0 of OK, -1 otherwise. If extratype is not nil and the highest
1672  /// surface type of the insurfs is less than *extratype, replace the common
1673  /// type by *extratype. Set equalcvs to true make them all have the same number
1674  /// of CVs too.
1675  int makeSurfacesCompatible(
1676  const GA_PrimitiveGroup &insurfs,
1677  GA_PrimitiveGroup &outsurfs,
1678  bool mustopenu=false, bool mustopenv=false,
1679  bool mustendsu=false, bool mustendsv=false,
1680  bool equalcvsu=true, bool equalcvsv=true,
1681  GA_PrimCompat::TypeMask *extratype = 0);
1682 
1683  /// Error Routines
1684  /// @{
1685  GU_ERROR error() const
1686  {
1687  return UTgetErrorManager()->getSeverity();
1688  }
1689 
1691  const char *msg = 0) const
1692  {
1693  UTgetErrorManager()->addMessage("GU", code, msg);
1694  }
1696  const char *msg = 0) const
1697  {
1698  UTgetErrorManager()->addWarning("GU", code, msg);
1699  }
1700  void addError(GU_ErrorCodes code, const char *msg = 0) const
1701  {
1702  UTgetErrorManager()->addError("GU", code, msg);
1703  }
1704  /// @}
1705 
1706  /// Returns a cook selection to fill in. If an already existing cook
1707  /// selection exists, of the wrong type, it is removed, and a new one
1708  /// created. Otherwise the existing cook selection is optionally cleared
1709  /// and returned.
1710  ///
1711  /// The cook selection is the selection being manipulated and displayed
1712  /// by a node.
1713  GU_SelectionHandle getOrCreateCookSelection(GA_GroupType group_type,
1714  bool ordered = false,
1715  bool clear_matching = false);
1716 
1717  /// Returns the group type of the current cook selection, or
1718  /// GA_GROUP_INVALID if there isn't one.
1719  GA_GroupType getCookSelectionGroupType() const;
1720 
1721  /// Creates a cook selection that directly references the supplied group.
1722  /// Any changes to the cook selection later will copy this group and use
1723  /// that copy.
1724  ///
1725  /// You must call removeCookSelection() if this group is later destroyed
1726  /// and the cook selection is still referencing it, which can be checked
1727  /// by calling hasShallowCookSelectionReference(group).
1728  ///
1729  /// NB: Only use this method if you know what you're doing. Any gains in
1730  /// performance are likely not to be worth the management pain.
1731  GU_SelectionHandle createShallowCookSelection(GA_Group *group);
1732 
1733  /// Returns whether this detail has a shallow cook selection referencing
1734  /// the specified group.
1735  bool hasShallowCookSelectionReference(
1736  const GA_Group *group) const;
1737 
1738  /// Returns the current cook selection;
1739  GU_SelectionHandle cookSelection() const;
1740 
1741  /// Removes the current cook selection from this detail. Since the selection
1742  /// is a shared object, there's no guarantee that it will be immediately
1743  /// destroyed, but only that this detail is no longer associated with it.
1744  void removeCookSelection();
1745 
1746  /// Bumps the data ids of the internal groups used by the cook selection
1747  /// if the selection revision has changed.
1748  void updateCookSelectionDataIds();
1749 
1750  /// Call this before the replaceWith() call when intending to follow up
1751  /// with a replaceCookSelection() call.
1752  //
1753  /// Assumes a fresh GU_CookSelectionReplaceStash instance.
1754  void stashCookSelectionBeforeReplaceWith(
1755  GU_CookSelectionReplaceStash &stash) const;
1756 
1757  /// Replace the current cook selection with a copy of the source detail's,
1758  /// with optimizations to avoid copying things that are the same.
1759  ///
1760  /// This method is intended to be called as a follow up to replaceWith(),
1761  /// and assumes that this detail is already essentially a copy of the
1762  /// source, possibly with only a subset of the attributes and groups.
1763  ///
1764  /// An optional GU_CookSelectionReplaceStash, populated by a previous
1765  /// call to stashCookSelectionBeforeReplaceWith(), can allow reusing the
1766  /// original GU_CookSelection instance in certain situations.
1767  void replaceCookSelection(
1768  const GU_Detail &src,
1769  GU_CookSelectionReplaceStash *stash);
1770 
1771  /// Do not use this method unless you know EXACTLY what you are doing. It
1772  /// forces the use of the supplied cook selection.
1773  void forceCookSelection(GU_SelectionHandle sel);
1774 
1775  /// Do not use this method unless you know EXACTLY what you are doing. It
1776  /// removes the cook selection from the detail without orphaning it so the
1777  /// only safe thing to do is to return it later using forceCookSelection().
1778  GU_SelectionHandle stealCookSelection();
1779 
1780  /// Remove points from polygons if they lie on (within a tolerance)
1781  /// the line connecting the previous and next points.
1782  void removeInlinePoints(float tol,
1783  const GA_PrimitiveGroup *prims,
1784  const GA_PointGroup *pts = nullptr);
1785 
1786  /// Remove zero area polygons
1787  /// Returns number of polygons removed
1788  /// @{
1789  GA_Size removeZeroAreaFaces(GA_PrimitiveGroup *grp,
1790  bool ignoreOpenFaces = false,
1791  float tolerance = 0.001F,
1792  bool onlyPolys = true);
1793  GA_Size removeZeroAreaFaces(const UT_IntArray &primlist,
1794  bool ignoreOpenFaces = false,
1795  float tolerance = 0.001F,
1796  bool onlyPolys = true);
1797  /// @}
1798 
1799  /// Deletes the geometry in the given group, unlike deleteEdges,
1800  /// it doesn't repair the holes left behind.
1801  void deleteGroupGeometry(const GA_Group &group);
1802 
1803  /// Deletes edge geometry
1804  SYS_DEPRECATED_HDK(16.0)
1805  void deleteEdges(GA_EdgeGroup &edgegroup,
1806  bool del_inline_points,
1807  float inlinetol,
1808  bool del_unused_points = true,
1809  bool del_bridges = true);
1810 
1811  /// There are three different ways of handling situations where all edges
1812  /// that connect polygon boundaries are dissolved.
1813  /// - GU_BRIDGEMODE_BRIDGE @n
1814  /// Insert bridge edges to connect the boundary loops.
1815  /// - GU_BRIDGEMODE_DISJOINT @n
1816  /// Create a separate polygon for each boundary loop.
1817  /// - GU_BRIDGEMODE_DELETE @n
1818  /// Delete the polygons.
1820  {
1823  GU_BRIDGEMODE_DELETE
1824  };
1825  void dissolveEdges(const GA_EdgeGroup &edgegroup,
1826  bool del_inline_points,
1827  fpreal inlinetol,
1828  bool del_unused_points,
1829  BridgeMode bridge_mode,
1830  bool del_degenerate_bridges,
1831  bool boundary_curves);
1832 
1833  /// Flips edges
1834  void flipEdges(const GA_EdgeGroup &edgegroup,
1835  int rotations = 1,
1836  bool rotattribs = false,
1837  GA_EdgeGroup *outedges = 0);
1838  /// Splits edges
1839  /// This is the main method for the PolySplit SOP. The splitlocs are
1840  /// the positions along which you wish to split polygons. When quadcut
1841  /// is false, the Shortest Path algorithm is used, otherwise the Quad Cut
1842  /// algorithm is used. The forcecut flag is used with the Shortest Path
1843  /// algorithm to force it to perform cuts where the initial cut has failed.
1844  /// To form a complete path of edges, supply the first location again as
1845  /// the last location in the splitlocs array. If quadcomplete is true and
1846  /// quadcut is false, then in certain cases extra edges will be inserted so
1847  /// that faces which began as quads get split into faces which are quads. If
1848  /// outPositions is set, it will be filled with a list of points in the path
1849  /// in RE_PRIM_LINES fashion. If fixEnds is set, either end of the path that
1850  /// is on a face will be given an extra segment to connect it to the nearest
1851  /// point to ensure that the resulting polygons don't self-intersect.
1852  void edgeSplit(const GU_SplitLocArray &splitlocs,
1853  bool quadcut = false,
1854  bool forcecut = true,
1855  GA_EdgeGroup *outedges = 0,
1856  float tolerance = SYS_FTOLERANCE,
1857  bool quadcomplete = false,
1858  bool modifyGdp = true,
1859  UT_Fpreal32Array *outPositions = nullptr,
1860  bool fixEnds = false);
1861 
1862  /// Inserts points on edges
1863  /// @{
1864  void divideEdges(const GA_EdgeGroup &edgegroup, int numdivs = 1,
1865  bool applytoall = true,
1866  bool use_shared_points = false,
1867  GA_EdgeGroup *outedges = 0,
1868  UT_Array<GA_Offset> *new_points = 0,
1869  bool preserve_edge_dir = false);
1870  void divideEdges(const GA_EdgeGroup &edgegroup,
1871  int numdivs,
1872  bool applytoall,
1873  bool use_shared_points,
1874  GA_EdgeGroup *outedges,
1875  UT_Array<GA_Offset> *new_points,
1876  bool preserve_edge_dir,
1877  float fraction);
1878  /// @}
1879 
1880  /// Inserts points on edges, with a different fraction and number of
1881  /// divisions per edge.
1882  void divideEdges(const UT_Array<GU_EdgeDiv *> &divlocs,
1883  GA_PointGroup &outgrp);
1884 
1885  /// Transform breakpoints
1886  void transformBreakpoints(const UT_Matrix4 &mat,
1887  const GA_BreakpointGroup *grp = 0,
1888  int quickxform = 0);
1889 
1890 
1891  /// Extrude faces, uses local face spaces and tries to mirror extrusions.
1892  void polyExtrude(const GU_PolyExtrudeParms &parms);
1893 
1894  /// Collapse Edges
1895  void edgeCollapse(const GA_EdgeGroup &edgegroup,
1896  bool removedegen = true,
1897  bool updatenmls = true,
1898  GA_PointGroup *outpoints = nullptr,
1899  const UT_Array<GA_Attribute *> *connect_attrib = nullptr);
1900 
1901  /// Adds crease weights to edges
1902  void edgeCrease(const GU_EdgeCreaseParms &parms);
1903 
1904  /// Insets points
1905  void pointInset(const GA_PointGroup *ptgroup,
1906  float insetdist, float nmldist);
1907 
1908  /// Find the oriented bounding box that contains the given primitives.
1909  /// The box is returned as a rotate+translate matrix to the box's
1910  /// orientation and centre, and a vector containing the boxes extents
1911  /// along its primary axes. The extents are radii, ie, one-half
1912  /// of what a bounding box size() would be.
1913  ///
1914  /// Returns zero radii if the group contains no primitives.
1915  void getOBBox(const GA_PrimitiveGroup *grp,
1917  UT_Vector3 &radii) const;
1918  /// Return the oriented bounding box that contains the given primitives,
1919  /// returning a UT_OBBox, which contains translation and rotation information
1920  void getOBBoxForPrims(const GA_PrimitiveGroup *grp,
1921  UT_OBBoxD &obb) const;
1922  /// Return the oriented bounding box that contains the given points,
1923  /// returning a UT_OBBox, which contains translation and rotation information
1924  void getOBBoxForPoints(const GA_PointGroup *grp,
1925  UT_OBBoxD &obb) const;
1926 
1927  /// Get cached bounding box. This uses the meta cache count and the data
1928  /// id on P to determine whether the bounds need to be recomputed.
1929  ///
1930  /// It's possible that the cached bounds might be invalid in some cases
1931  /// (where the geometry is modified without updates to the meta cache count
1932  /// or the data id on P.
1933  bool getCachedBounds(UT_BoundingBox &box) const;
1934  /// Forcibly clear the cached bounds without having to update the meta
1935  /// cache count or data ID on P.
1936  void clearCachedBounds();
1937 
1938  /// Make each primitive planar, returns the number of primitives xformed
1939  GA_Size makePrimsPlanar(const GA_PrimitiveGroup *grp = 0);
1940 
1941  static void loadIODSOs();
1942 
1943  /// Create a list of all internal file extensions
1944  static void getFileExtensions(UT_StringArray &result);
1945 
1946  /// Check to see whether the file extension matches a known binary file
1947  /// extension. The argument is the full filename.
1948  static bool matchBinaryFileExtension(const UT_StringRef &filename);
1949 
1950  /// Check to see whether the file extension matches a known ASCII file
1951  /// extension. The argument is the full filename.
1952  static bool matchASCIIFileExtension(const UT_StringRef &filename);
1953 
1954 
1955  /// These methods assume no changes have been made to the geometry since the
1956  /// last call to incrementMetaCacheCount(). "attrib" should refer to a string
1957  /// or integer attribute.
1958  exint getUniqueValueCount(const GA_Attribute *attrib) const;
1959  exint getUniqueIntegerValue(const GA_Attribute *attrib, exint idx) const;
1960  const UT_StringHolder &getUniqueStringValue(const GA_Attribute *attrib, exint idx) const;
1961  GA_Range getRangeByValue(const GA_Attribute *attrib, exint v) const;
1962  GA_Range getRangeByValue(const GA_Attribute *attrib, const UT_StringRef &v) const;
1963 
1964 
1965  class AttribValueLookupTable;
1966  class AttribSingleValueLookupTable;
1967 
1968  const AttribValueLookupTable *getLookupTable(const GA_Attribute *attrib) const;
1969  const AttribSingleValueLookupTable *getSingleLookupTable(const GA_Attribute *attrib) const;
1970 
1971  // Creates a copy of the detail keeping the same UniqueId and
1972  // MetaCacheCount if copy_unique_id is true.
1973  // This is used by SOP_Cache to make different details act as the same.
1974  GU_Detail *cloneForCache(bool copy_unique_id) const;
1975 
1976  // Creates a copy of the detail keeping the same UniqueId and
1977  // MetaCacheCount if copy_unique_id is true.
1978  // This version Can write to an existing detail.
1979  // If copy_detail is false, the replaceWith call is skipped.
1980  void cloneForCache(GU_Detail &dest, bool copy_unique_id, bool copy_detail=true) const;
1981 
1982 protected:
1983  /// Register intrinsic attributes
1986 
1987 private:
1988  int twist (const GU_TwistParms &parms, int &p);
1989  int bend (const GU_TwistParms &parms, int &p);
1990  int squashStretch (const GU_TwistParms &parms, int &p);
1991  int shear (const GU_TwistParms &parms, int &p);
1992  int taper (const GU_TwistParms &parms, int &p);
1993  int linearTaper (const GU_TwistParms &parms, int &p);
1994 
1995  template <typename ArrayType>
1996  GEO_Curve * privateInterpCurveGlobal(
1997  const ArrayType &gpData,
1998  const GA_PrimitiveTypeId &type,
1999  int order, int wrapped,
2000  GA_ParameterizationType parmType,
2001  GA_KnotSpaceType knotSpaceType);
2002 
2003  void fillGrid(GEO_Hull &hull, int rows, int cols,
2004  float x_size, float y_size,
2005  float x_center, float y_center,
2006  float z_center,
2007  GU_OrientationType plane);
2008 
2009  void convertPolysToHull(
2010  GEO_ConvertParms &parms,
2011  bool keep_original);
2012  void convertToSoups(
2013  GEO_ConvertParms &parms,
2014  bool keep_original);
2015  void convertVolumesToVDBs(
2016  GEO_ConvertParms &parms,
2017  bool keep_original);
2018  void convertVDBsToVolumes(
2019  GEO_ConvertParms &parms,
2020  bool keep_original);
2021  void convertVolumesToPolys(
2022  GEO_ConvertParms &parms,
2023  bool keep_original);
2024  void convertMetasToPolys(
2025  GEO_ConvertParms &parms,
2026  bool keep_original);
2027  void convertTetsToPolys(
2028  GEO_ConvertParms &parms,
2029  bool keep_original);
2030  void doConversion(
2031  GEO_ConvertParms &parms,
2032  bool keep_original);
2033 
2034  void orientPoly(GEO_PrimPoly *poly,
2035  UT_BitArray &process,
2036  UT_BitArray &reverse);
2037 
2038  GEO_Primitive *surfCube(int xdiv, int ydiv, int zdiv,
2039  int orderx, int ordery, int orderz,
2040  float xmin, float xmax,
2041  float ymin, float ymax,
2042  float zmin, float zmax,
2043  GEO_SurfaceType type, int kind,
2044  bool consolidate);
2045 
2046  // Checks if a single primitive is dirty (see getDirtyData).
2047  bool isDirtySinglePrimitive(GA_Primitive *prim,
2048  bool checkRepPoints,
2049  float tol);
2050 
2051  void lodConvert(GA_PrimitiveGroup *grp,
2052  UT_BoundingBox &box, int cluster, float lod,
2053  bool makepolysoup = false);
2054  void divisionConvert(GA_PrimitiveGroup *grp, int adjust,
2055  UT_BoundingBox &box, int divx,int divy,int divz,
2057  bool makepolysoup = false);
2058  int adjustStepBox(float &min, float &max, float step);
2059  void stepSizeConvert(GA_PrimitiveGroup *grp, int adjust,
2060  UT_BoundingBox &box, float sx,float sy,float sz,
2062  bool makepolysoup = false);
2063 
2064  /// makes a single primitive planar (see makePrimsPlanar)
2065  bool primToPlane(GEO_Primitive *pprim,
2066  GA_PointGroup &fixedPoints);
2067 
2068  /// Prohibited to avoid accidentally passing by value.
2069  /// Use constructor that takes a const GU_Detail * if you
2070  /// really need to construct a copied detail.
2071  GU_Detail(const GU_Detail &src);
2072 
2073  friend class GU_PrimitiveFactory; // For intrinsic registration
2074 
2075  void construct()
2076  {
2077  myBoundingCache = nullptr;
2078  myValueLookupCache = nullptr;
2079  }
2080 
2081  /// The sole cook selection associated with this detail.
2082  GU_SelectionHandle myCookSelection;
2083 
2084  class BoundingCache; // Forward declare
2085  BoundingCache *myBoundingCache;
2086 
2087  mutable gu_ValueLookupCache *myValueLookupCache;
2088 };
2089 
2090 #endif
virtual void clearCaches()
Definition: GA_Detail.h:1915
A class to manage an ordered array which has fixed offset handles.
Definition: GA_IndexMap.h:63
void sortPrims(GA_IndexMap &array, const UT_Vector3 &o, const UT_Vector3 &d)
Definition: GU_Detail.h:927
UT_ErrorSeverity getSeverity()
GA_API const UT_StringHolder dist
Definition of a geometry attribute.
Definition: GA_Attribute.h:197
SYS_VISIBILITY_EXPORT void newGeometryIO(void *)
GT_API const UT_StringHolder filename
GLuint counter
Definition: glew.h:2745
GU_MetricType
Definition: GU_Types.h:87
GLuint GLdouble GLdouble GLint GLint order
Definition: glew.h:3460
void sortElements(GA_IndexMap &array, fpreal *order)
Definition: GU_Detail.h:953
const GA_IndexMap & getPrimitiveMap() const
Definition: GA_Detail.h:742
GU_DeformType
Definition: GU_Types.h:58
MatType shear(Axis axis0, Axis axis1, typename MatType::value_type shear)
Set the matrix to a shear along axis0 by a fraction of axis1.
Definition: Mat.h:710
#define SYS_VISIBILITY_EXPORT
void
Definition: png.h:1083
GLint left
Definition: glcorearb.h:2005
GA_DataIdStrategy
Definition: GA_Types.h:209
Transformation order of scales, rotates, and translates.
Definition: UT_XformOrder.h:23
const UT_IntArray & ringValence() const
Definition: GU_Detail.h:229
virtual GA_Detail * cloneEmptyDetail(bool clone_attributes) const =0
SYS_VISIBILITY_EXPORT void newGeometryPrim(GA_PrimitiveFactory *factory)
#define SYS_DEPRECATED_HDK_REPLACE(__V__, __R__)
void sortPoints(GA_IndexMap &array, const UT_Vector3 &o, const UT_Vector3 &d)
Definition: GU_Detail.h:922
void reversePrimitiveList()
Definition: GU_Detail.h:1009
GA_API const UT_StringHolder twist
int64 exint
Definition: SYS_Types.h:125
Arbitrarily Oriented Bounding (OBB)
Definition: GU_Detail.h:57
GLint level
Definition: glcorearb.h:108
A soup of polygons.
int64 getMemoryUsage(bool inclusive) const override
Compute memory usage (includes all shared memory)
void reversePointList()
Definition: GU_Detail.h:1007
OnlyConsGroupPropagateType
Definition: GU_Detail.h:500
void reverse(I begin, I end)
Definition: pugixml.cpp:7190
UT_ErrorSeverity
Definition: UT_Error.h:25
void shiftPrimitiveList(GA_Size aoffset)
Definition: GU_Detail.h:989
UT_API UT_ErrorManager * UTgetErrorManager()
void proximityPoints(GA_IndexMap &points, const UT_Vector3 &point)
Definition: GU_Detail.h:1015
void vertexOrder(GA_IndexMap &points)
Definition: GU_Detail.h:1036
ImageBuf OIIO_API min(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
void addWarning(GU_ErrorCodes code, const char *msg=0) const
Definition: GU_Detail.h:1695
Tto convert(const Tfrom &source)
void proximityPrims(GA_IndexMap &primitives, const UT_Vector3 &point)
Definition: GU_Detail.h:1018
Structure for the PolySouping code.
GLenum src
Definition: glcorearb.h:1793
GLfloat right
Definition: glew.h:15525
UT_ErrorSeverity addError(const char *type, int code, const char *msg=0, const UT_SourceLocation *loc=0)
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:234
SnapAttributesType
Definition: GU_Detail.h:588
GU_GridType
Definition: GU_Types.h:70
const UT_Array< GA_OffsetArray > & myRingZero
Definition: GU_Detail.h:233
GLuint GLuint GLfloat weight
Definition: glew.h:13892
#define GA_INVALID_OFFSET
Definition: GA_Types.h:677
A range of elements in an index-map.
Definition: GA_Range.h:42
GA_ParameterizationType
Definition: GA_Types.h:195
GU_LatticeType
Definition: GU_Types.h:109
GLsizeiptr size
Definition: glcorearb.h:664
GU_AxisType
Definition: GU_Types.h:24
GLuint GLenum GLenum transform
Definition: glew.h:15055
GA_Size GA_Offset
Definition: GA_Types.h:640
OIIO_FORCEINLINE bool extract(const vbool4 &a)
Definition: simd.h:3426
vint4 blend(const vint4 &a, const vint4 &b, const vbool4 &mask)
Definition: simd.h:4784
void sortPointList(exint *order)
Definition: GU_Detail.h:963
GLenum array
Definition: glew.h:9108
GU_API void snapPoints(GU_Detail &qgdp, const GU_Detail *tgdp, const PointSnapParms &parms)
GLuint64EXT * result
Definition: glew.h:14311
const GA_IndexMap & getPointMap() const
Definition: GA_Detail.h:740
GR_API RE_Geometry * buildGrid(RE_Render *r, UT_Vector3F center, UT_Vector2F size, Orientation orient, const char *cache_name=NULL)
GU_Detail(const GU_Detail *src, GA_DataIdStrategy data_id_strategy=GA_DATA_ID_BUMP)
Definition: GU_Detail.h:180
int open(float queuesize) override
GA_API const UT_StringHolder trans
GLsizei GLsizei GLfloat distance
Definition: glew.h:13923
void sortPointsSpatial()
Definition: GU_Detail.h:912
void reversePoints(GA_IndexMap &map)
Definition: GU_Detail.h:1001
GU_API void snapGrid(GU_Detail &gdp, const GridSnapParms &parms)
const GLdouble * v
Definition: glcorearb.h:837
GLsizei GLsizei GLchar * source
Definition: glcorearb.h:803
void reversePrims(GA_IndexMap &map)
Definition: GU_Detail.h:1003
void shiftPrims(GA_IndexMap &map, GA_Size offset)
Definition: GU_Detail.h:981
const GA_IndexMap & getIndexMap(GA_AttributeOwner owner) const
NURBS basis classes which maintain knot vectors.
Definition: GA_NUBBasis.h:44
void shiftPointList(GA_Size aoffset)
Definition: GU_Detail.h:987
virtual void statVolumes(GA_Stat &stat, uint level=0xffff) const
Fill out only the volume information.
long long int64
Definition: SYS_Types.h:116
void shiftPoints(GA_IndexMap &map, GA_Size offset)
Definition: GU_Detail.h:979
GLfloat GLfloat p
Definition: glew.h:16656
void sortPointList(fpreal *order)
Definition: GU_Detail.h:961
png_const_structrp png_const_inforp int * unit
Definition: png.h:2161
void sortPointList(int seed)
Definition: GU_Detail.h:943
GLint GLsizei count
Definition: glcorearb.h:405
#define GU_API
Definition: GU_API.h:14
HUSD_API const char * resolution()
#define SYS_DEPRECATED_HDK(__V__)
void sortPrimitiveList(const UT_Vector3 &o, const UT_Vector3 &d)
Definition: GU_Detail.h:934
void sortPointList(const UT_Vector3 &o, const UT_Vector3 &d)
Definition: GU_Detail.h:932
UT_Array< GU_SplitLoc * > GU_SplitLocArray
Definition: GU_Detail.h:140
bool copy(const GEO_Detail &src, GEO_CopyMethod method=GEO_COPY_ONCE, bool this_parameter_is_ignored=true, bool keep_internal_groups=true, GA_DataIdStrategy data_id_strategy=GA_DATA_ID_BUMP)
UT_SharedPtr< GU_Selection > GU_SelectionHandle
GA_API const UT_StringHolder orient
GU_OrientationType
Definition: GU_Types.h:32
GU_Detail(bool full_topology)
Definition: GU_Detail.h:160
void sortElements(GA_IndexMap &array, exint *order)
Definition: GU_Detail.h:955
IMATH_HOSTDEVICE constexpr int divs(int x, int y) IMATH_NOEXCEPT
Definition: ImathFun.h:140
void addMessage(GU_ErrorCodes code, const char *msg=0) const
Definition: GU_Detail.h:1690
GLuint GLdouble GLdouble GLint GLint const GLdouble * points
Definition: glew.h:3460
IFDmantra py
Definition: HDK_Image.dox:266
void sortPrimsSpatial()
Definition: GU_Detail.h:915
GLclampd zmax
Definition: glew.h:9063
Class to return information about a GA_Detail.
Definition: GA_Stat.h:50
ImageBuf OIIO_API cut(const ImageBuf &src, ROI roi={}, int nthreads=0)
virtual bool smooth(GA_AttributeOperand &d, GA_AttributeOperand &min, GA_AttributeOperand &max, GA_AttributeOperand &t) const
d = SYSsmooth(min, max, t);
GLsizei const GLint box[]
Definition: glew.h:11654
const UT_IntArray & myRingValence
Definition: GU_Detail.h:234
void sortPrimitiveList(int seed)
Definition: GU_Detail.h:945
GLfloat GLfloat GLfloat GLfloat nx
Definition: glew.h:16622
fpreal64 fpreal
Definition: SYS_Types.h:277
GLhalf GLhalf nz
Definition: glew.h:13506
UT_ErrorSeverity addWarning(const char *type, int code, const char *msg=0, const UT_SourceLocation *loc=0)
GA_GroupType
An ordinal enum for the different types of groups in GA.
Definition: GA_Types.h:159
RingRef(const UT_Array< GA_OffsetArray > &ringzero, const UT_IntArray &ringvalence)
Definition: GU_Detail.h:220
void countMemory(UT_MemoryCounter &counter, bool inclusive) const override
void proximityToPointList(const UT_Vector3 &point)
Definition: GU_Detail.h:1027
GLbyte * weights
Definition: glew.h:7581
ImageBuf OIIO_API max(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
void transformBreakpoints(const UT_Matrix4T< FLOAT_T > &mat, const GA_BreakpointGroup *grp=0, bool just_P=false, bool update_ptnormals=false, GEO_Delta *geodelta=0, bool updateaffectednormals=false, const char *attribpattern=NULL)
static GA_IntrinsicManager::Registrar registerIntrinsics(GA_PrimitiveFactory &factory)
GU_API GA_PrimitiveFactory & GUgetFactory()
void sortPrimitiveList(GU_AxisType axis)
Definition: GU_Detail.h:904
GLboolean GLuint group
Definition: glew.h:2750
GLenum GLint * range
Definition: glcorearb.h:1925
GEO_SurfaceType
Container class for all geometry.
Definition: GA_Detail.h:95
const UT_Array< GA_OffsetArray > & ringZero() const
Definition: GU_Detail.h:227
#define SYS_FTOLERANCE
Definition: SYS_Types.h:208
GLdouble angle
Definition: glew.h:9177
GLhalf ny
Definition: glew.h:13506
void proximityToPrimitiveList(const UT_Vector3 &point)
Definition: GU_Detail.h:1029
GA_Size GEO_API GEOsplitPoints(GEO_Detail *detail, const GA_ElementGroup *group=nullptr)
GLintptr offset
Definition: glcorearb.h:665
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)
GLuint GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint vorder
Definition: glew.h:3462
void sortPointList(GU_AxisType axis)
Definition: GU_Detail.h:902
GU_TextureType
Definition: GU_Types.h:94
#define const
Definition: zconf.h:214
void sortPrims(GA_IndexMap &array, GU_AxisType axis=GU_XAXIS)
Definition: GU_Detail.h:897
void sortByVertexOrder()
Definition: GU_Detail.h:1039
GU_Detail(const GU_Detail *src, GA_PrimitiveGroup *primGroup, GA_DataIdStrategy data_id_strategy=GA_DATA_ID_BUMP)
Definition: GU_Detail.h:167
type
Definition: core.h:1059
void sortPrimitiveList(fpreal *order)
Definition: GU_Detail.h:965
GA_API const UT_StringHolder rest
GA_KnotSpaceType
Definition: GA_Types.h:188
IMATH_INTERNAL_NAMESPACE_HEADER_ENTER IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T clip(const T &p, const Box< T > &box) IMATH_NOEXCEPT
Definition: ImathBoxAlgo.h:29
GLsizei GLuint * groups
Definition: glew.h:2749
unsigned int uint
Definition: SYS_Types.h:45
GLint lod
Definition: glcorearb.h:2765
void merge(const GEO_Detail &src, const GA_PrimitiveGroup *primGrp=nullptr, bool mergePrimGroup=true, bool insertPrimsAtHead=false, GA_GBPointRedirectArray *dest_to_src_ptarray=nullptr, bool keep_internal_groups=true, GA_DataIdStrategy data_id_strategy=GA_DATA_ID_BUMP)
GU_ErrorCodes
Definition: GU_Error.h:20
Definition: format.h:895
GLenum GLuint GLint GLenum face
Definition: glew.h:4630
auto join(It begin, Sentinel end, string_view sep) -> join_view< It, Sentinel >
Definition: format.h:2559
void addError(GU_ErrorCodes code, const char *msg=0) const
Definition: GU_Detail.h:1700
UT_ErrorSeverity addMessage(const char *type, int code, const char *msg=0, const UT_SourceLocation *loc=0)
void sortPrimitiveList(exint *order)
Definition: GU_Detail.h:967