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