HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GEO_PrimPolySoup.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: GEO_PrimPolySoup.h (GEO Library, C++)
7  *
8  * COMMENTS: Implements a set of polygons sharing primitive attributes
9  * and some vertices, to save memory
10  */
11 
12 #pragma once
13 
14 #ifndef __GEO_PrimPolySoup__
15 #define __GEO_PrimPolySoup__
16 
17 #include "GEO_TriMesh.h"
18 #include "GEO_PrimType.h"
19 #include "GEO_PrimTypeCompat.h"
20 #include "GEO_API.h"
21 #include "GEO_PolyCounts.h"
22 #include <GA/GA_Detail.h>
23 #include <GA/GA_ElementWrangler.h>
24 #include <GA/GA_Types.h>
25 #include <UT/UT_Array.h>
26 #include <UT/UT_SafeFloat.h>
27 #include <UT/UT_Vector3.h>
28 #include <UT/UT_VectorTypes.h>
29 #include <SYS/SYS_Deprecated.h>
30 #include <SYS/SYS_Inline.h>
31 
32 class GA_Detail;
33 class GEO_PolySoupParms;
34 class GA_PrimitiveGroup;
35 class GEO_PrimPoly;
36 
37 /// A soup of polygons
39 {
40 protected:
41  /// NOTE: The constructor should only be called from subclass
42  /// constructors.
44  : GEO_TriMesh(d, offset)
45  {}
46 
47  /// NOTE: The destructor should only be called from subclass
48  /// destructors.
49  ~GEO_PrimPolySoup() override {}
50 
51 public:
53  {
54  public:
57  : GA_PolyCounts::const_iterator(prim.myPolygonSizeList)
58  , myPrim(&prim)
59  {}
61  : GA_PolyCounts::const_iterator(prim.myPolygonSizeList, polygon)
62  , myPrim(&prim)
63  {}
64  SYS_FORCE_INLINE const GEO_PrimPolySoup &prim() const { return *myPrim; }
66  {
68  this->myPrim = that.myPrim;
69  return *this;
70  }
72  {
73  UT_ASSERT_P(i >= 0 && i < nvertices());
74  return myPrim->myPolygonVertexList(start()+i);
75  }
77  {
78  UT_ASSERT_P(i >= 0 && i < nvertices());
79  const GA_Detail &detail = myPrim->getDetail();
80  return detail.vertexIndex(myPrim->myPolygonVertexList(start()+i));
81  }
83  {
84  UT_ASSERT_P(i >= 0 && i < nvertices());
85  return myPrim->getDetail().vertexPoint(myPrim->myPolygonVertexList(start()+i));
86  }
88  {
89  UT_ASSERT_P(i >= 0 && i < nvertices());
90  const GA_Detail &detail = myPrim->getDetail();
91  return detail.pointIndex(detail.vertexPoint(myPrim->myPolygonVertexList(start()+i)));
92  }
94  {
95  UT_ASSERT_P(i >= 0 && i < nvertices());
96  const GA_Detail &detail = myPrim->getDetail();
97  return detail.getPos3(detail.vertexPoint(myPrim->myPolygonVertexList(start()+i)));
98  }
100  {
101  UT_ASSERT_P(i >= 0 && i < nvertices());
102  const GA_Detail &detail = myPrim->getDetail();
103  return detail.getPos4(detail.vertexPoint(myPrim->myPolygonVertexList(start()+i)));
104  }
106  { return myPrim->baryCenter(*this); }
108  { return myPrim->computeNormal(*this); }
110  { return myPrim->calcPerimeter(*this); }
112  { return myPrim->calcArea(*this); }
114  { return myPrim->calcVolume(refpt, *this); }
115  SYS_FORCE_INLINE float getW() const
116  { return UTpackIntToSafeFloat(polygon()); }
117 
118  /// These are just here for interchangeability with GEO_Face
120  { return getVertexOffset(i); }
122  { return nvertices(); }
124  { return nvertices(); }
126  { return true; }
127  private:
128  const GEO_PrimPolySoup *myPrim;
129  };
130 
132  {
133  public:
134  VertexIterator(const PolygonIterator &it, GA_Size vtxnum = 0)
135  : myPrim(it.prim())
136  , myIndex(it.start()+vtxnum)
137  , myEnd(it.start()+it.nvertices())
138  {}
139  bool atEnd() const
140  {
141  return myIndex == myEnd;
142  }
144  {
145  ++myIndex;
146  return *this;
147  }
149  {
150  --myIndex;
151  return *this;
152  }
154  {
155  return VertexIterator(myPrim, myIndex + i, myEnd);
156  }
158  {
159  return VertexIterator(myPrim, myIndex - i, myEnd);
160  }
161  GA_Size number() const
162  {
163  return myIndex;
164  }
166  {
167  return myPrim.myPolygonVertexList(myIndex);
168  }
169  private:
171  : myPrim(prim)
172  , myIndex(index)
173  , myEnd(end)
174  {}
175  const GEO_PrimPolySoup &myPrim;
176  GA_Size myIndex;
177  GA_Size myEnd;
178  };
179 
180  /// Have we been deactivated and stashed?
181  void stashed(bool beingstashed,
182  GA_Offset offset = GA_INVALID_OFFSET) override;
183 
184  /// @{
185  /// Interface from GEO_TriMesh
186  UT_Vector3 computeNormal() const override;
187  void reverse() override;
188 
189  fpreal calcVolume(const UT_Vector3 &refpt) const override;
190  fpreal calcArea() const override;
191  fpreal calcPerimeter() const override;
192  /// @}
193 
194  // This is here only to avoid a compile error on baryCenter(it) below
195  UT_Vector3 baryCenter() const override
196  { return GEO_TriMesh::baryCenter(); }
197 
198  UT_Vector3 computeNormal(const PolygonIterator &it) const;
199  UT_Vector3 baryCenter(const PolygonIterator &it) const;
200  fpreal calcVolume(const UT_Vector3 &refpt, const PolygonIterator &it) const;
201  fpreal calcArea(const PolygonIterator &it) const;
202  fpreal calcPerimeter(const PolygonIterator &it) const;
203 
204  /// Get number of polygons in the soup
206  {
207  return myPolygonSizeList.getNumPolygons();
208  }
209 
210  /// Get the number of vertices in the polygon
212  {
213  UT_ASSERT_P(myPolygonSizeList.getArray().entries() != 0);
214  return myPolygonSizeList.getSize(polygon);
215  }
216 
217  /// Get the start offset into myPolygonVertexList of vertices for a
218  /// single polygon in the soup and the number of vertices in the polygon
220  GA_Size &start,
221  GA_Size &count) const
222  {
223  UT_ASSERT_P(myPolygonSizeList.getArray().entries() != 0);
224  myPolygonSizeList.getVertexRange(polygon, start, count);
225  }
226 
228  GA_Size vertexofpolygon) const
229  {
230  GA_Size start;
231  GA_Size count;
232  getPolygonVertexRange(polygon, start, count);
233  UT_ASSERT_P(vertexofpolygon < count);
234  return myPolygonVertexList(start + vertexofpolygon);
235  }
236 
238  GA_Size vertexofpolygon) const
239  {
240  return myPolygonVertexList(it.start() + vertexofpolygon);
241  }
242 
244  GA_Offset &v0,
245  GA_Offset &v1,
246  GA_Offset &v2) const
247  {
248  v0 = myPolygonVertexList(start);
249  v1 = myPolygonVertexList(start+1);
250  v2 = myPolygonVertexList(start+2);
251  }
252 
254  GA_Offset &v0,
255  GA_Offset &v1,
256  GA_Offset &v2,
257  GA_Offset &v3) const
258  {
259  v0 = myPolygonVertexList(start);
260  v1 = myPolygonVertexList(start+1);
261  v2 = myPolygonVertexList(start+2);
262  v3 = myPolygonVertexList(start+3);
263  }
264 
265  /// Return the maximum number of vertices in any face
266  inline GA_Size getMaxPolygonSize() const
267  {
269  = myPolygonSizeList.getArray();
270  if (!array.entries())
271  return -1;
272  GA_Size mx = array(0).size();
273  for (GA_Size i = 1; i < array.entries(); ++i)
274  mx = SYSmax(mx, array(i).size());
275  return mx;
276  }
277 
278  /// Return the minimum number of vertices in any face
279  inline GA_Size getMinPolygonSize() const
280  {
282  = myPolygonSizeList.getArray();
283  if (!array.entries())
284  return -1;
285  GA_Size mn = array(0).size();
286  for (GA_Size i = 1; i < array.entries(); ++i)
287  mn = SYSmin(mn, array(i).size());
288  return mn;
289  }
290 
291  /// Return the minimum and maximum number of vertices for any face
292  inline void getMinMaxPolygonSize(GA_Size &mn, GA_Size &mx) const
293  {
295  = myPolygonSizeList.getArray();
296  if (!array.entries())
297  {
298  mn = mx = -1;
299  return;
300  }
301  mn = mx = array(0).size();
302  for (GA_Size i = 1; i < array.entries(); ++i)
303  {
304  mn = SYSmin(mn, array(i).size());
305  mx = SYSmax(mx, array(i).size());
306  }
307  }
308 
309  const GA_PrimitiveJSON *getJSON() const override;
310  /// @{
311  /// Save/Load polygon list to a JSON stream
312  bool savePolygonInfo(UT_JSONWriter &w,
313  const GA_SaveMap &map) const;
314  bool loadPolygonInfo(UT_JSONParser &p,
315  const GA_LoadMap &map);
316  /// @}
317 
318  /// Appends a copy of a single polygon to this PolySoup,
319  /// with all vertices unique
320  void appendPolygonCopyUnique(const GEO_PrimPoly *polygon,
321  GA_VertexWrangler &wrangler);
322  /// Appends a copy of a single polygon to this PolySoup,
323  /// with any vertices whose attributes match being shared among
324  /// polygons in this PolySoup
325  void appendPolygonCopyShared(const GEO_PrimPoly *polygon,
326  GA_VertexWrangler &wrangler, GA_AttributeRefMap &attributemap);
327  /// Appends a copy of a single polygon to this PolySoup,
328  /// with all vertices unique
329  void appendPolygonCopyUnique(
330  const GA_OffsetListRef &polygon, const GA_Detail &srcdetail,
331  GA_VertexWrangler &wrangler);
332  /// Appends a copy of a single polygon to this PolySoup,
333  /// with any vertices whose attributes match being shared among
334  /// polygons in this PolySoup
335  void appendPolygonCopyShared(
336  const GA_OffsetListRef &polygon, const GA_Detail &srcdetail,
337  GA_VertexWrangler &wrangler, GA_AttributeRefMap &attributemap);
338  /// Appends a copy of another PolySoup to this PolySoup,
339  /// with all vertices unique
340  void appendPolySoupCopyUnique(const GEO_PrimPolySoup *that,
341  GA_VertexWrangler &wrangler);
342  /// Appends a copy of another PolySoup to this PolySoup,
343  /// with any vertices whose attributes match being shared among
344  /// polygons in this PolySoup
345  void appendPolySoupCopyShared(const GEO_PrimPolySoup *that,
346  GA_VertexWrangler &wrangler, GA_AttributeRefMap &attributemap);
347 
348  /// Appends a polygon to this PolySoup from an array of vertex offsets
349  /// NOTE: This will not wire the vertices to points or to this primitive,
350  /// so that must be done manually. This assumes the vertices have
351  /// already been added to the GEO_TriMesh level with appendVertex
352  /// or appendVertices.
353  void appendPolygon(const UT_Array<GA_Offset> &vertices);
354 
355  /// Appends polygons to this PolySoup from an array of vertex offsets
356  /// NOTE: This will not wire the vertices to points or to this primitive,
357  /// so that must be done manually. This assumes the vertices have
358  /// already been added to the GEO_TriMesh level with appendVertex
359  /// or appendVertices.
360  void appendPolygons(const GA_PolyCounts &sizes,
361  const GA_OffsetList &vertices);
362 
363  /// Returns true iff none of the vertices of the PolySoup are shared
364  /// among multiple polygons in this PolySoup.
365  /// NOTE: This assumes that every vertex of the PolySoup is in at least
366  /// one polygon in this PolySoup.
367  bool areAllVerticesUnique() const
368  { return myPolygonVertexList.entries() == myVertexList.entries(); }
369 
370  /// Forces all vertices in this polysoup to be unshared, i.e. creates
371  /// new vertices if any are used by multiple polygons in this polysoup.
372  /// NOTE: This assumes that every vertex of the PolySoup is in at least
373  /// one polygon in this PolySoup, since it calls
374  /// areAllVerticesUnique().
375  void makeAllVerticesUnique();
376 
377  /// Optimizes the internal representation of the PolySoup
378  void optimize();
379 
380  /// Remove repeated point offsets in the polygon vertices, optionally
381  /// checking distance to remove points within a specified tolerance,
382  /// then remove all degenerate polygons.
383  GA_Size cleanData(const bool removeNearPoints = false, float tol = 0.001F,
384  bool deleteOrphanedPoints = true);
385 
386  /// Remove polygons that have 0, 1, or 2 vertices, optionally deleting
387  /// orphaned points.
388  GA_Size remove012(bool deleteOrphanedPoints = true);
389 
390  /// Remove vertices that are not used by any of the soup's polygons,
391  /// and optionally remove their points if they are also unused.
392  void deleteUnusedVertices(bool andpoints = true);
393 
394  /// Replaces specified polygons with new polygons using the same vertices,
395  /// which is necessary for convexing. polygonstoremesh must be monotone
396  /// increasing.
397  void remeshPolygons(const UT_Array<GA_Size> &polygonstoremesh,
398  const GA_OffsetList &newvertices,
399  const GA_PolyCounts &newpolygonsizelist);
400 
402  const GA_RangeMemberQuery &point_query,
403  bool dry_run) override;
404 
405  void copyPrimitive(const GEO_Primitive *psrc) override;
406  GEO_Primitive *copy(int preserve_shared_pts) const override;
407  void copySubclassData(const GA_Primitive *source) override;
408 
409  /// Defragmentation
410  void swapVertexOffsets(const GA_Defragment &defrag) override;
411 
412 #if 0
413  /// Converts myPolygonVertexList from storing GA_Offsets to storing
414  /// indices into myVertexList.
415  void offsetsToIndirection();
416  /// Converts myPolygonVertexList from indices of myVertexList back
417  /// into GA_Offsets
418  void indirectionToOffsets();
419 #endif
420 
422  {
423  return myPolygonVertexList.entries();
424  }
425 
426  /// These are only here because of C++ compilers erroring on the
427  /// appendVertex function below, thinking it should hide these.
428  /// NOTE: This will not add the vertex to myPolygonVertexList,
429  /// in case it is to be shared, so use
430  /// appendPolygon(const UT_Array<GA_Offset> &vertices)
431  /// to add a polygon with the vertex.
432  /// NOTE: If you leave vertices in the polysoup that are not used by any
433  /// polygons, areAllVerticesUnique() may return incorrect results,
434  /// since it just checks if the size of myPolygonVertexList is
435  /// larger than the size of myVertexList
437  { return GEO_TriMesh::appendVertex(ptoff); }
438 
439  /// This appends one vertex for each of nvertices points starting
440  /// from startptoff, in parallel, and wires them to the points and
441  /// this polysoup, then returns the starting vertex offset. Since
442  /// each point has only one vertex, this applies to making shared
443  /// vertices.
444  /// NOTE: The points can't be used by any other primitives at the
445  /// time that this is called.
446  /// NOTE: If you leave vertices in the polysoup that are not used by any
447  /// polygons, areAllVerticesUnique() may return incorrect results,
448  /// since it just checks if the size of myPolygonVertexList is
449  /// larger than the size of myVertexList
450  GA_Offset appendSharedVertices(GA_Offset startptoff, GA_Size nvertices);
451 
452  void iterateEdges(GA_IterateEdgesFunc apply_func) const override
453  {
454  GA_Detail &detail = getDetail();
455  for (PolygonIterator it(*this); !it.atEnd(); ++it)
456  {
457  if (it.nvertices() == 0)
458  continue;
459  VertexIterator vit(it);
460  const GA_Offset startptoff = detail.vertexPoint(vit.offset());
461  GA_Offset prevptoff = startptoff;
462  for (++vit; !vit.atEnd(); ++vit)
463  {
464  const GA_Offset currptoff = detail.vertexPoint(vit.offset());
465  if (!apply_func(GA_Edge(prevptoff, currptoff)))
466  return;
467  prevptoff = currptoff;
468  }
469  // NOTE: GEO_Face::edgeApply always has a wrapping edge for
470  // closed polygons, even with just 1 or 2 vertices.
471  //if (it.nvertices() > 2)
472  if (!apply_func(GA_Edge(prevptoff, startptoff)))
473  return;
474  }
475  }
476  void iterateEdgesByVertex(GA_IterateEdgesByVertexFunc apply_func) const override;
477 
478  /// This does a linear search through the whole soup.
479  /// You may regret calling it for each edge of a large soup.
480  bool hasEdge(const GA_Edge &edge) const override
481  {
482  GA_Offset a = edge.p0();
483  GA_Offset b = edge.p1();
484  for (PolygonIterator it(*this); !it.atEnd(); ++it)
485  {
486  GA_Size n = it.nvertices();
487  if (n == 0)
488  continue;
489  const GA_Offset startptoff = it.getPointOffset(0);
490  GA_Offset p0 = startptoff;
491  for (GA_Size i = 1; i < n; ++i)
492  {
493  GA_Offset p1 = it.getPointOffset(i);
494  if ( ((p0 == a) && (p1 == b)) || ((p0 == b) && (p1 == a)) )
495  return true;
496  p0 = p1;
497  }
498  // NOTE: GEO_Face::edgeApply always has a wrapping edge for
499  // closed polygons, even with just 1 or 2 vertices, even
500  // though GEO_Face::hasEdge doesn't accept the self-edge
501  // if there's only one vertex.
502  //if (it.nvertices() > 2)
503  GA_Offset p1 = startptoff;
504  if ( ((p0 == a) && (p1 == b)) || ((p0 == b) && (p1 == a)) )
505  return true;
506  }
507  return false;
508  }
509 
511  UT_Array<GA_Offset> &vtxlist,
512  UT_Array<float> &weightlist,
513  fpreal u, fpreal v, fpreal w) const override;
514 
515  /// Create polygon soup(s), i.e. GEO_PrimPolySoup, where possible in dest_detail.
516  /// src_detail *can* be the same as dest_detail.
517  static void convertDetail(GEO_Detail *dest_detail, const GEO_Detail *src_detail, const GEO_PolySoupParms &parms);
518 
519  virtual void convex(GA_Size maxpts = 3, const GA_Detail *restgdp = nullptr,
520  bool flipedges = false, bool avoiddegeneracy = false) = 0;
521 
522 protected:
524  { return GEO_TriMesh::buildFamilyMask(); }
525 
526  // Declare intrinsic definitions
527  GA_DECLARE_INTRINSICS(override)
528 
529  void appendUniqueVertexCopy(const GA_Offset vertex,
530  const GA_Detail &srcdetail,
531  GA_VertexWrangler &wrangler);
532  void appendSharedVertexCopy(const GA_Offset vertex,
533  const GA_Detail &srcdetail,
534  GA_VertexWrangler &wrangler,
535  GA_AttributeRefMap &attributemap);
536 
537  /// Evaluates the position at domain point (u,v) in the interior of the
538  /// geometry, rather than on the perimeter of the poly.
539  /// (Note that u, v don't have to be converted to unit domain. We assume
540  /// that the barycentric coords or bilinear interpolants are already
541  /// correctly scaled).
542  bool evaluateInteriorPointRefMap(GA_Offset result_vtx,
543  GA_AttributeRefMap &hlist,
544  fpreal u, fpreal v, fpreal w) const override;
545  int evaluateInteriorPointV4(UT_Vector4 &pos,
546  fpreal u, fpreal v, fpreal w) const override;
547  int evaluateNormalVector(UT_Vector3 &nml,
548  float u, float v, float w) const override;
549 
550  bool savePrivateH9(std::ostream &, bool binary) const override;
551  bool loadPrivateH9(UT_IStream &) override;
552 
553  GA_PolyCounts myPolygonSizeList;
554  GA_OffsetList myPolygonVertexList;
555 
556 private:
557  friend std::ostream &operator<<(std::ostream &os, const GEO_PrimPolySoup &d)
558  {
559  d.saveH9(os, 0,
562  return os;
563  }
565 };
567 
568 /// Structure for the PolySouping code
570 {
571 public:
575  int minPolys;
576  bool convex;
577  int maxSides;
581 
583  bool ignattr = false,
584  bool igngrp = false,
585  int minp = 1,
586  bool cvx = false,
587  int maxs = 3,
588  bool delprims = true,
590  bool mergeverts = true)
591  : primGroup(pg)
592  , ignorePrimAttributes(ignattr)
593  , ignorePrimGroups(igngrp)
594  , minPolys(minp)
595  , convex(cvx)
596  , maxSides(maxs)
597  , deleteSoupedPrimitives(delprims)
598  , typeMask(mask)
599  , mergeVertices(mergeverts)
600  { }
601 };
602 
603 #endif
604 
SYS_FORCE_INLINE float getW() const
#define SYSmax(a, b)
Definition: SYS_Math.h:1521
fpreal calcPerimeter() const override
GA_Size getPolygonVertexCount() const
virtual GEO_Primitive * copy(int preserve_shared_pts=0) const
GA_DereferenceStatus dereferencePoints(const GA_RangeMemberQuery &pt_q, bool dry_run=false) override
GLsizeiptr size
Definition: glew.h:1681
SYS_FORCE_INLINE GA_Detail & getDetail() const
Definition: GA_Primitive.h:141
void getTriangleVertexOffsets(GA_Size start, GA_Offset &v0, GA_Offset &v1, GA_Offset &v2) const
virtual void copyPrimitive(const GEO_Primitive *src)=0
Used to pass options and map offset values during saving.
Definition: GA_SaveMap.h:48
SYS_FORCE_INLINE PolygonIterator & operator=(const PolygonIterator &that)
*get result *(waiting if necessary)*A common idiom is to fire a bunch of sub tasks at the and then *wait for them to all complete We provide a helper class
Definition: thread.h:643
void getQuadVertexOffsets(GA_Size start, GA_Offset &v0, GA_Offset &v1, GA_Offset &v2, GA_Offset &v3) const
SYS_FORCE_INLINE fpreal calcPerimeter() const
void iterateEdges(GA_IterateEdgesFunc apply_func) const override
GA_PrimCompat::TypeMask typeMask
virtual void computeInteriorPointWeights(UT_Array< GA_Offset > &vtxlist, UT_Array< float > &weightlist, fpreal u, fpreal v, fpreal w) const
GA_Offset getPolygonVertexOffset(const PolygonIterator &it, GA_Size vertexofpolygon) const
GLuint index
Definition: glew.h:1814
GA_Size getPolygonCount() const
Get number of polygons in the soup.
SYS_FORCE_INLINE GA_Offset getPointOffset(GA_Size i) const
#define SYS_DEPRECATED_PUSH_DISABLE()
void getMinMaxPolygonSize(GA_Size &mn, GA_Size &mx) const
Return the minimum and maximum number of vertices for any face.
UT_Vector4 getPos4(GA_Offset ptoff) const
The ptoff passed is the point offset.
Definition: GA_Detail.h:252
#define SYS_DEPRECATED_POP_DISABLE()
virtual void copySubclassData(const GA_Primitive *source)
Definition: GA_Primitive.h:484
SYS_FORCE_INLINE UT_Vector3 baryCenter() const
GLboolean GLboolean GLboolean GLboolean a
Definition: glew.h:9477
fpreal calcVolume(const UT_Vector3 &) const override
SYS_FORCE_INLINE GA_Index getPointIndex(GA_Size i) const
SYS_FORCE_INLINE fpreal calcVolume(const UT_Vector3 &refpt) const
A soup of polygons.
GLsizei GLsizei GLchar * source
Definition: glew.h:1832
JSON reader class which handles parsing of JSON or bJSON files.
Definition: UT_JSONParser.h:76
void reverse() override=0
Reverse the order of vertices.
#define GA_DECLARE_INTRINSICS(OVERRIDE)
Definition: GA_Primitive.h:80
SYS_FORCE_INLINE GA_Size getVertexCount() const
SYS_FORCE_INLINE UT_Vector3 getPos3(GA_Size i) const
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:34
static GA_PrimitiveFamilyMask buildFamilyMask()
Abstract base class for a range membership query object.
const GLdouble * v
Definition: glew.h:1391
GLenum GLint GLuint mask
Definition: glew.h:1845
SYS_FORCE_INLINE UT_Vector3 getPos3(GA_Offset ptoff) const
The ptoff passed is the point offset.
Definition: GA_Detail.h:174
Structure for the PolySouping code.
GA_EdgeT< GA_Offset, false > GA_Edge
Definition: GA_Edge.h:91
SYS_FORCE_INLINE bool isClosed() const
VertexIterator operator-(GA_Size i)
fpreal calcArea() const override
virtual void swapVertexOffsets(const GA_Defragment &defrag)
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:233
GA_PrimitiveFamilyMask
virtual UT_Vector3 computeNormal() const =0
Return a normal vector for the primitive.
#define GA_INVALID_OFFSET
Definition: GA_Types.h:676
GA_Size appendVertex(GA_Offset ptoff) override
GA_Size getPolygonSize(GA_Size polygon) const
Get the number of vertices in the polygon.
GA_Size GA_Offset
Definition: GA_Types.h:639
SYS_FORCE_INLINE GA_Offset getFastVertexOffset(GA_Size i) const
These are just here for interchangeability with GEO_Face.
SYS_FORCE_INLINE GA_Offset getVertexOffset(GA_Size i) const
bool hasEdge(const GA_Edge &edge) const override
GLfloat GLfloat GLfloat v2
Definition: glew.h:1856
VertexIterator(const PolygonIterator &it, GA_Size vtxnum=0)
SYS_FORCE_INLINE UT_Vector4 getPos4(GA_Size i) const
~GEO_PrimPolySoup() override
SYS_FORCE_INLINE fpreal calcArea() const
GLuint GLsizei const GLuint const GLintptr const GLsizeiptr * sizes
Definition: glew.h:5268
virtual GA_Size appendVertex(GA_Offset ppt)
#define UT_ASSERT_P(ZZ)
Definition: UT_Assert.h:134
const GLuint GLenum const void * binary
Definition: glew.h:3502
GA_Size getMaxPolygonSize() const
Return the maximum number of vertices in any face.
bool areAllVerticesUnique() const
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
GLubyte GLubyte GLubyte GLubyte w
Definition: glew.h:1890
virtual const GA_PrimitiveJSON * getJSON() const =0
GLuint GLuint end
Definition: glew.h:1253
Provide a JSON interface to a primitive.
void
Definition: png.h:1083
GLsizei n
Definition: glew.h:4040
#define GEO_API
Definition: GEO_API.h:14
std::function< bool(const GA_Edge &edge)> GA_IterateEdgesFunc
Definition: GA_Primitive.h:73
A handle to simplify manipulation of multiple attributes.
SYS_FORCE_INLINE GA_Index vertexIndex(GA_Offset offset) const
Given a vertex's data offset, return its index.
Definition: GA_Detail.h:470
Options during loading.
Definition: GA_LoadMap.h:42
T p1() const
Definition: GA_Edge.h:33
Defragmentation of IndexMaps.
Definition: GA_Defragment.h:45
SYS_FORCE_INLINE GA_Offset vertexPoint(GA_Offset vertex) const
Given a vertex, return the point it references.
Definition: GA_Detail.h:480
std::function< bool(GA_Size, GA_Size)> GA_IterateEdgesByVertexFunc
Definition: GA_Primitive.h:74
GA_Size GA_Index
Define the strictness of GA_Offset/GA_Index.
Definition: GA_Types.h:633
const GA_PrimitiveGroup * primGroup
GA_Offset getPolygonVertexOffset(GA_Size polygon, GA_Size vertexofpolygon) const
UT_Vector3 baryCenter() const override
SYS_FORCE_INLINE bool atEnd() const
Definition: GA_PolyCounts.h:97
GLuint start
Definition: glew.h:1253
SYS_FORCE_INLINE UT_Vector3 computeNormal() const
GEO_PolySoupParms(const GA_PrimitiveGroup *pg=0, bool ignattr=false, bool igngrp=false, int minp=1, bool cvx=false, int maxs=3, bool delprims=true, GA_PrimCompat::TypeMask mask=GEO_PrimTypeCompat::GEOPRIMALL, bool mergeverts=true)
SYS_FORCE_INLINE GA_Size start() const
exint entries() const
Alias of size(). size() is preferred.
Definition: UT_Array.h:460
SYS_FORCE_INLINE GA_Index pointIndex(GA_Offset offset) const
Given a point's data offset, return its index.
Definition: GA_Detail.h:300
GLdouble GLdouble GLdouble b
Definition: glew.h:9122
Contains transitional objects to provide some backward compatibility for code that references old GEO...
GLfloat GLfloat p
Definition: glew.h:16321
GEO_API const TypeMask GEOPRIMALL
static const UT_Array< GA_AttribSaveDataH9 > & theEmptySaveAttribs
Convience objects to pass as arguments to saveH9()/loadH9().
SYS_FORCE_INLINE PolygonIterator(const GEO_PrimPolySoup &prim, GA_Size polygon)
GEO_PrimPolySoup(GA_Detail *d, GA_Offset offset=GA_INVALID_OFFSET)
fpreal64 fpreal
Definition: SYS_Types.h:277
SYS_FORCE_INLINE GA_Index getVertexIndex(GA_Size i) const
UT_Vector3 baryCenter() const override
SYS_FORCE_INLINE PolygonIterator(const GEO_PrimPolySoup &prim)
GLuint GLuint GLsizei count
Definition: glew.h:1253
GLfloat v0
Definition: glew.h:1848
VertexIterator operator+(GA_Size i)
Container class for all geometry.
Definition: GA_Detail.h:95
GLenum array
Definition: glew.h:9066
T p0() const
Definition: GA_Edge.h:31
#define const
Definition: zconf.h:214
SYS_FORCE_INLINE GA_Size getFastVertexCount() const
#define SYSmin(a, b)
Definition: SYS_Math.h:1522
void getPolygonVertexRange(GA_Size polygon, GA_Size &start, GA_Size &count) const
T * getArray() const
Definition: UT_Array.h:628
GLfloat GLfloat GLfloat GLfloat v3
Definition: glew.h:1860
GLfloat GLfloat v1
Definition: glew.h:1852
virtual void iterateEdgesByVertex(GA_IterateEdgesByVertexFunc apply_func) const
Definition: GA_Primitive.h:357
virtual void stashed(bool beingstashed, GA_Offset offset=GA_INVALID_OFFSET)
static GA_PrimitiveFamilyMask buildFamilyMask()
Definition: GEO_TriMesh.h:187
SYS_FORCE_INLINE const GEO_PrimPolySoup & prim() const
iteratorT< const GA_PolyCounts, const UT_Array< SizeCount > > & operator=(const iteratorT< const GA_PolyCounts, const UT_Array< SizeCount > > &that)
GLintptr offset
Definition: glew.h:1682
GA_Size getMinPolygonSize() const
Return the minimum number of vertices in any face.