HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GT_PrimPolygonMesh.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: GT_PrimPolygonMesh.h ( GT Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GT_PrimPolygonMesh__
12 #define __GT_PrimPolygonMesh__
13 
14 #include "GT_API.h"
15 #include "GT_Primitive.h"
16 #include "GT_CountArray.h"
17 #include "GT_FaceSetMap.h"
18 #include "GT_AttributeMerge.h"
19 #include <GA/GA_Names.h>
20 
21 class GT_DataArray;
22 class GT_PrimPolygon;
23 class GT_AttributeList;
24 class UT_StringRef;
25 
26 /// Note this is all just copied from GEO_Normal
27 #define GT_DEFAULT_CUSP_ANGLE 60.0
28 
29 /// Magic tolerance factor of 1.001 on GT_DEFAULT_CUSP_ANGLE so that
30 /// hexagonal tubes will be smooth by default, even with a bit of roundoff
31 /// or slight deformation.
32 #define GT_DEFAULT_ADJUSTED_CUSP_ANGLE 60.06
33 
34 /// @brief A mesh of polygons
36 {
37 public:
38  /// Default constructor
40  : myVMerge()
41  , myUMerge()
42  , myConvexFlag(false)
43  {
44  }
45  /// Useful constructor
47  const GT_DataArrayHandle &vtx_indices,
48  const GT_AttributeListHandle &shared,
50  const GT_AttributeListHandle &uniform,
51  const GT_AttributeListHandle &detail,
53  GT_Size min_vertex_count=0,
54  GT_Size max_vertex_count=0)
55  : myVMerge()
56  , myUMerge()
57  , myConvexFlag(false)
58  {
59  init(vtx_counts, vtx_indices, shared, vertex, uniform, detail,
60  indexing, min_vertex_count, max_vertex_count);
61  }
62 
63  GT_PrimPolygonMesh(const GT_CountArray &vtx_counts,
64  const GT_DataArrayHandle &vtx_indices,
65  const GT_AttributeListHandle &shared,
67  const GT_AttributeListHandle &uniform,
68  const GT_AttributeListHandle &detail)
69  : myVMerge()
70  , myUMerge()
71  , myConvexFlag(false)
72  {
73  init(vtx_counts, vtx_indices, shared, vertex, uniform, detail);
74  }
75 
76  /// Copy the topology information from the source pmesh, but use different
77  /// attribute lists.
79  const GT_AttributeListHandle &shared,
81  const GT_AttributeListHandle &uniform,
82  const GT_AttributeListHandle &detail);
83 
84  /// Create a new polygon mesh with re-mapped vertices (used by
85  /// removeUnusedPoints).
86  ///
87  /// Since the polygon faces are remapped you'll have to pass in a new face
88  /// set map.
90  const GT_DataArrayHandle &vtx_indices,
91  const GT_AttributeListHandle &shared);
92 
93  /// Copy c-tor
95 
96  /// Construct a polygon mesh from a GT_PrimPolygon
98 
99  const char *className() const override { return "GT_PrimPolygonMesh"; }
100  bool save(UT_JSONWriter &w) const override;
101 
102  /// @{
103  /// Methods defined on GT_Primitive
104  void enlargeBounds(UT_BoundingBox boxes[],
105  int nsegments) const override;
106  int getPrimitiveType() const override;
107  bool refine(GT_Refine &refiner,
108  const GT_RefineParms *parms) const override;
109  int getMotionSegments() const override;
110  int64 getMemoryUsage() const override;
111  /// @}
112 
113  /// @{
114  /// Initialize the mesh
115  /// - @c vtx_counts @n
116  /// An integer array, representing the number of vertices in each face.
117  /// The length of the array determines the number of faces in the mesh.
118  /// - @c vtx_indices @n
119  /// An array of vertex references. There is an entry for every vertex in
120  /// every face. These indices refer to the shared attribute data.
121  /// - @c shared @n
122  /// Shared attribute data. This data is referenced by the vertex arrays.
123  /// - @c vertex @n
124  /// Unique data per vertex. The length of these attribute arrays should
125  /// be the same as the length of the vtx_indices array.
126  /// - @c uniform @n
127  /// Attribute per face. There should be one entry for each entry in the
128  /// @c vtx_counts array.
129  /// - @c detail @n
130  /// Constant attribute for all faces.
131  /// @c vtx_counts array.
132  /// - @c indexing @n
133  /// What type of indexing is required
134  void init(const GT_DataArrayHandle &vtx_counts,
135  const GT_DataArrayHandle &vtx_indices,
136  const GT_AttributeListHandle &shared,
138  const GT_AttributeListHandle &uniform,
139  const GT_AttributeListHandle &detail,
141  GT_Size min_vertex_count=0,
142  GT_Size max_vertex_count=0);
143  void init(const GT_CountArray &vtx_counts,
144  const GT_DataArrayHandle &vtx_indices,
145  const GT_AttributeListHandle &shared,
147  const GT_AttributeListHandle &uniform,
148  const GT_AttributeListHandle &detail);
149  /// @}
150 
151  /// Return the number of faces in the mesh
152  GT_Size getFaceCount() const;
153  /// Return a pointer to the individual face
154  GT_PrimitiveHandle getFace(GT_Offset i) const;
155 
156  /// Return the number of vertices
158  {
159  return myVertexList ? myVertexList->entries() : 0;
160  }
161  /// Return the number of points
163  {
164  return myShared ? myShared->get(0)->entries() : 0;
165  }
166 
167  /// @{
168  /// Query the minimum/maximum number of vertices per face
169  GT_Size getMinVertexCount() const { return myFaceOffsets.getMinCount();}
170  GT_Size getMaxVertexCount() const { return myFaceOffsets.getMaxCount();}
171  /// @}
172 
173  /// @{
174  /// Accessor
175  const GT_DataArrayHandle &getVertexList() const override
176  { return myVertexList; }
178  { return myFaceOffsets; }
179 #if 0
180  const GT_DataArrayHandle &getFaceOffsets() const
181  { return myFaceOffsets; }
182 #endif
184  { return myShared; }
186  { return myVertex; }
188  { return myUniform; }
190  { return myDetail; }
191  /// @}
192 
193  /// @{
194  /// Access to the point sets
195  const GT_ElementSetMapPtr &pointSetMap() const { return myPointSetMap; }
197  { myPointSetMap = v; }
198  void addPointSet(const UT_StringHolder &name,
199  const GT_ElementSetPtr &set);
200  /// @}
201 
202  /// @{
203  /// Access to the face sets
204  const GT_ElementSetMapPtr &faceSetMap() const { return myFaceSetMap; }
206  { myFaceSetMap = v; }
207  void addFaceSet(const UT_StringHolder &name,
208  const GT_ElementSetPtr &set);
209  /// @}
210 
211  /// Harden all attributes so there are no dangling dependencies
212  GT_PrimitiveHandle doHarden() const override;
214  { return new GT_PrimPolygonMesh(*this); }
215 
216  /// The virtual implementation of attribute merging
218  const GT_Primitive &src,
219  const UT_StringMMPattern *vertex,
220  const UT_StringMMPattern *point,
221  const UT_StringMMPattern *uniform,
222  const UT_StringMMPattern *detail
223  ) const override;
224 
225  /// @{
226  /// Access attributes
228  { return myVertex; }
230  { return myShared; }
232  { return myUniform; }
234  { return myDetail; }
235  /// @}
236 
237  /// Return the point index for a given face and vertex
238  GT_Offset getPoint(GT_Offset face, GT_Offset v) const;
239 
240  /// Return the offset into the vertex list for the given face
242  { return myFaceOffsets.getOffset(face); }
243  /// Return the length of the vertex list for the given face
245  { return myFaceOffsets.getCount(face); }
246  /// For a given face, find the shared point numbers for the given vertex
247  /// and the next vertex (i.e. the edge starting from the given vertex).
248  void getEdgePoints(GT_Offset face, GT_Offset vertex,
249  GT_Offset &p0, GT_Offset &p1) const;
250 
251  /// Returns true if this mesh has been convexed
252  bool isConvexed() const { return myConvexFlag; }
253 
254  /// Set the convex flag on the mesh
255  void setConvexed(bool c) { myConvexFlag = c; }
256 
257  /// Return an array containing the face counts per-face
259  getFaceCounts(GT_IndexingMode indexing=GT_INDEXING_QUICK) const;
260 
261  /// The polygon mesh may have shared points which aren't used. That is,
262  /// there may be elements in the shared element list which aren't
263  /// referenced by any vertex. This method will build a list of indices for
264  /// all the used points.
265  ///
266  /// The list returned will be monotonically ascending.
267  const GT_DataArrayHandle
268  getUsedPointList(GT_IndexingMode idx=GT_INDEXING_QUICK) const;
269 
270  /// Ensure all polygons in the mesh are convex
271  ///
272  /// If the @c holes set is passed in, then the faces in that set will be
273  /// excluded from the convexed result.
274  GT_PrimitiveHandle convex(int max_points_per_poly=3,
275  bool keep_degenerate = false,
276  bool allow_interrupt = true,
277  bool allow_indirect_flattening = false,
278  const UT_Set<int> *holes = nullptr) const;
279 
280  /// Using the indirect arrays and vertex list from a convexed mesh,
281  /// convex this mesh (assumes topology is the same).
282  GT_PrimitiveHandle adoptConvexing(
283  const GT_DataArrayHandle &verts,
284  const GT_DataArrayHandle &uniform_indexing,
285  const GT_DataArrayHandle &vertex_indexing,
286  const GT_DataArrayHandle &vert_info,
287  const GT_DataArrayHandle &prim_info)
288  const;
289 
290  /// Fetches the convexed arrays from the mesh, to be used by adoptConvexing
291  /// on a different mesh with the same topology.
292  void getConvexArrays(
293  GT_DataArrayHandle &verts,
294  GT_DataArrayHandle &uniform_indexing,
295  GT_DataArrayHandle &vertex_indexing,
296  GT_DataArrayHandle &vert_info,
297  GT_DataArrayHandle &prim_info) const;
298 
299  /// Remove unused points. This will collapse the varying point arrays,
300  /// leaving only the points referenced by the vertices.
301  UT_IntrusivePtr<GT_PrimPolygonMesh> removeUnusedPoints(
302  const int32 *idx=nullptr) const;
303 
304  /// @{
305  /// Compute face normals. This will use the shared attribute named P to
306  /// compute the normals for each face.
307  /// fpreal16 must have the proper vector length
308  bool faceNormals(UT_Vector3 *N,
309  int segment=0,
310  const UT_StringRef &P=GA_Names::P) const;
311  bool faceNormals(UT_Vector3D *N64,
312  int segment=0,
313  const UT_StringRef &P=GA_Names::P) const;
314  bool faceNormals(fpreal16 *N16,
315  int segment=0,
316  const UT_StringRef &P=GA_Names::P) const;
317  GT_DataArrayHandle faceNormals(int segment=0,
318  const UT_StringRef &P=GA_Names::P,
319  GT_Storage store=GT_STORE_REAL32) const;
320  /// @}
321 
322  /// @{
323  /// Compute shared normals. This will use the shared attribute named P to
324  /// compute the normals for each shared point.
325  bool pointNormals(UT_Vector3T<fpreal16> *N,
326  GT_Size npts,
327  int segment=0,
328  const UT_StringRef &P=GA_Names::P,
329  bool normalize=true,
330  const fpreal32 *pntdata = nullptr) const;
331  bool pointNormals(UT_Vector3 *N, GT_Size npts,
332  int segment=0,
333  const UT_StringRef &P=GA_Names::P,
334  bool normalize=true,
335  const fpreal32 *pntdata = nullptr) const;
336  bool pointNormals(UT_Vector3D *N, GT_Size npts,
337  int segment=0,
338  const UT_StringRef &P=GA_Names::P,
339  bool normalize=true,
340  const fpreal32 *pntdata = nullptr) const;
342  const UT_StringRef &P=GA_Names::P,
343  bool normalize=true,
344  const fpreal32 *pntdata = nullptr,
346  ) const override;
347  /// @}
348 
349  /// @{
350  /// Compute vertex normals. This will use the shared attribute named P to
351  /// compute the normals for each vertex.
352  bool vertexNormals(UT_Vector3T<fpreal16> *N,
353  GT_Size npts,
354  int segment=0,
355  const UT_StringRef &P=GA_Names::P,
356  fpreal maxangledegrees=GT_DEFAULT_ADJUSTED_CUSP_ANGLE,
357  bool normalize=true) const;
358  bool vertexNormals(UT_Vector3 *N,
359  GT_Size npts,
360  int segment=0,
361  const UT_StringRef &P=GA_Names::P,
362  fpreal maxangledegrees=GT_DEFAULT_ADJUSTED_CUSP_ANGLE,
363  bool normalize=true) const;
364  bool vertexNormals(UT_Vector3D *N,
365  GT_Size npts,
366  int segment=0,
367  const UT_StringRef &P=GA_Names::P,
368  fpreal maxangledegrees=GT_DEFAULT_ADJUSTED_CUSP_ANGLE,
369  bool normalize=true) const;
370  virtual GT_DataArrayHandle createVertexNormals(int segment=0,
371  const UT_StringRef &P=GA_Names::P,
372  fpreal maxangledegrees=GT_DEFAULT_ADJUSTED_CUSP_ANGLE,
373  bool normalize=true,
374  GT_Storage store =GT_STORE_REAL32) const;
375  /// @}
376 
377 
378  /// @brief Create point normals on a new mesh if no normals are found.
379  /// If no point or vertex normals are found, generate point normals from P
380  /// and return a new mesh. If normals are found, return NULL.
381  ///
382  /// If the segement is less than 0, normals for *all* segments will be
383  /// computed (if required)
384  GT_PrimPolygonMesh *createPointNormalsIfMissing(
385  const UT_StringRef &P=GA_Names::P,
386  bool normalize=true,
387  bool *error = nullptr) const;
388 
389  GT_PrimPolygonMesh *createVertexNormalsIfMissing(
390  const UT_StringRef &P=GA_Names::P,
391  fpreal cuspangledegrees=GT_DEFAULT_ADJUSTED_CUSP_ANGLE,
392  bool normalize=true,
393  bool *error = nullptr) const;
394 
395  /// Create point normals and MikkT tangents on a new mesh if not found.
396  /// If either normals or tangents are not found, return a new mesh with
397  /// both generated. If both exist, return NULL.
398  GT_PrimPolygonMesh *createTangentsIfMissing(bool *error = nullptr);
399 
400  /// Create quick tangents (not MikkT) for fast viewer tangent generation.
401  /// Tangents are not created in this mesh.
402  /// NOTE: Not working very well yet.
403  bool createFastTangents(GT_DataArrayHandle *tanu_h,
404  GT_DataArrayHandle *tanv_h) const;
405 
406  /// @brief Divide a mesh into smaller meshes if it exceeds the poly_limit.
407  /// If this mesh has more than polygon_limit polygons, this will split the
408  /// mesh into multiple sub-meshes, attempting to keep them all roughly the
409  /// same number of polygons. If this mesh has fewer than polygon_limit
410  /// polygons, it will return false and not add any meshes to split_meshes.
411  /// If remove_unused_points is true, each submesh will have unused points
412  /// removed.
413  bool splitMesh(GT_Size polygon_limit,
414  UT_Array<GT_PrimitiveHandle> &split_meshes,
415  bool remove_unused_points = true) const;
416 
417  /// Partition a mesh into submeshes by the shop_materialpath attribute,
418  /// each with exact one material in a detail shop_materialpath attribute.
419  /// Returns false if shop_materialpath doesn't exist, isn't a uniform attrib,
420  /// or has only 1 material.
421  bool partitionByMaterial(const GT_DataArrayHandle &mat_id,
422  UT_Array<GT_PrimitiveHandle> &sub_meshes,
423  GT_Size polygon_limit = SYS_INT32_MAX) const;
424 
425  /// @{
426  /// Methods for GEO/GU support.
427  fpreal computePerimeter(int seg) const override;
428  fpreal computeSurfaceArea(int seg) const override;
429  fpreal computeVolume(const UT_Vector3 &ref_P, int seg) const override;
430  /// @}
431 
432  bool updateGeoPrim(const GU_ConstDetailHandle &dtl,
433  const GT_RefineParms &refine) override;
434 
435 protected:
436  void hardenAttributes();
437 
438  // We have "clone" methods so that sub-classes (i.e.
439  // GT_PrimSubdivisionMesh) can create an appropriate clone. These are used
440  // by methods internal when duplicating the mesh (i.e. removeUnusedPoints)
441  virtual GT_PrimPolygonMesh *clone(const GT_DataArrayHandle &vtx_counts,
442  const GT_DataArrayHandle &vtx_indices,
443  const GT_AttributeListHandle &shared,
445  const GT_AttributeListHandle &uniform,
446  const GT_AttributeListHandle &detail,
448  GT_Size min_vertex_count=0,
449  GT_Size max_vertex_count=0) const
450  {
451  return new GT_PrimPolygonMesh(vtx_counts, vtx_indices,
452  shared, vertex, uniform, detail, indexing,
453  min_vertex_count, max_vertex_count);
454  }
455  virtual GT_PrimPolygonMesh *clone(const GT_CountArray &vtx_counts,
456  const GT_DataArrayHandle &vtx_indices,
457  const GT_AttributeListHandle &shared,
459  const GT_AttributeListHandle &uniform,
460  const GT_AttributeListHandle &detail) const
461  {
462  return new GT_PrimPolygonMesh(vtx_counts, vtx_indices,
463  shared, vertex, uniform, detail);
464  }
467  const GT_AttributeListHandle &uniform,
468  const GT_AttributeListHandle &detail) const
469  {
470  return new GT_PrimPolygonMesh(*this, shared, vertex, uniform, detail);
471  }
472  virtual GT_PrimPolygonMesh *clone(const GT_DataArrayHandle &vtx_indices,
473  const GT_AttributeListHandle &shared) const
474  {
475  return new GT_PrimPolygonMesh(*this, vtx_indices, shared);
476  }
477 
482 
483 private:
484  template <typename VECTOR_T>
485  GT_DataArrayHandle getVertexNormalHandle(
486  const UT_StringRef &P_name,
487  int seg,
488  fpreal maxangledegrees,
489  bool normalize) const;
490  template <typename VECTOR_T>
491  bool computePointNormals(
493  GT_Size Nsize,
494  const UT_StringRef &P,
495  int segment,
496  bool normalize,
497  const fpreal32 *point_data) const;
498  template <typename VECTOR_T>
499  bool computeVertexNormals(
501  GT_Size Nsize,
502  const UT_StringRef &P,
503  int segment,
504  fpreal maxangledegrees,
505  bool normalize) const;
506 
507  bool createFastTangentsUV(const GT_DataArrayHandle &ph,
508  const GT_DataArrayHandle &uvh,
509  GT_Owner uv_owner,
510  GT_DataArrayHandle *tanuh,
511  GT_DataArrayHandle *tanvh) const;
512 
513  void makeMerge();
514 
515  GT_DataArrayHandle myVertexList;
516  GT_CountArray myFaceOffsets;
517  GT_ElementSetMapPtr myPointSetMap;
518  GT_ElementSetMapPtr myFaceSetMap;
519  UT_UniquePtr<GT_AttributeMerge> myVMerge, myUMerge;
520  bool myConvexFlag;
521 };
522 
523 #endif
524 
SIM_API const UT_StringHolder vertex
GT_Size getPointCount() const
Return the number of points.
GT_Storage
Definition: GT_Types.h:19
virtual int getMotionSegments() const =0
GT_PrimPolygonMesh(const GT_CountArray &vtx_counts, const GT_DataArrayHandle &vtx_indices, const GT_AttributeListHandle &shared, const GT_AttributeListHandle &vertex, const GT_AttributeListHandle &uniform, const GT_AttributeListHandle &detail)
const GT_AttributeListHandle & getVertexAttributes() const override
virtual bool updateGeoPrim(const GU_ConstDetailHandle &dtl, const GT_RefineParms &parms)
update any cached data for geometry and its attributes
int int32
Definition: SYS_Types.h:39
virtual bool refine(GT_Refine &refiner, const GT_RefineParms *parms=NULL) const
const GT_AttributeListHandle & getPointAttributes() const override
A mesh of polygons.
virtual int getPrimitiveType() const
#define SYS_INT32_MAX
Definition: SYS_Types.h:171
virtual fpreal computePerimeter(int seg=0) const
virtual fpreal computeVolume(const UT_Vector3 &ref_P, int seg=0) const
#define GT_DEFAULT_ADJUSTED_CUSP_ANGLE
const GLdouble * v
Definition: glcorearb.h:837
GT_Size getMinVertexCount() const
GT_Size getVertexCount(GT_Offset face) const
Return the length of the vertex list for the given face.
const GT_CountArray & getFaceCountArray() const
GT_AttributeListHandle myShared
GT_IndexingMode
Definition: GT_Types.h:106
void setFaceSetMap(const GT_ElementSetMapPtr &v)
#define GT_API
Definition: GT_API.h:13
void setPointSetMap(const GT_ElementSetMapPtr &v)
GT_PrimPolygonMesh(const GT_DataArrayHandle &vtx_counts, const GT_DataArrayHandle &vtx_indices, const GT_AttributeListHandle &shared, const GT_AttributeListHandle &vertex, const GT_AttributeListHandle &uniform, const GT_AttributeListHandle &detail, GT_IndexingMode indexing=GT_INDEXING_QUICK, GT_Size min_vertex_count=0, GT_Size max_vertex_count=0)
Useful constructor.
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:37
GA_API const UT_StringHolder P
GT_Size getVertexCount() const
Return the number of vertices.
float fpreal32
Definition: SYS_Types.h:200
const GT_AttributeListHandle & getShared() const
bool isConvexed() const
Returns true if this mesh has been convexed.
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
Definition: UT_UniquePtr.h:39
< returns > If no error
Definition: snippets.dox:2
const GT_AttributeListHandle & getVertex() const
const GT_AttributeListHandle & getUniform() const
virtual GT_PrimPolygonMesh * clone(const GT_DataArrayHandle &vtx_counts, const GT_DataArrayHandle &vtx_indices, const GT_AttributeListHandle &shared, const GT_AttributeListHandle &vertex, const GT_AttributeListHandle &uniform, const GT_AttributeListHandle &detail, GT_IndexingMode indexing=GT_INDEXING_QUICK, GT_Size min_vertex_count=0, GT_Size max_vertex_count=0) const
GT_PrimPolygonMesh()
Default constructor.
Abstract data class for an array of float, int or string data.
Definition: GT_DataArray.h:40
GT_PrimitiveHandle doSoftCopy() const override
virtual fpreal computeSurfaceArea(int seg=0) const
virtual GT_PrimPolygonMesh * clone(const GT_CountArray &vtx_counts, const GT_DataArrayHandle &vtx_indices, const GT_AttributeListHandle &shared, const GT_AttributeListHandle &vertex, const GT_AttributeListHandle &uniform, const GT_AttributeListHandle &detail) const
void setConvexed(bool c)
Set the convex flag on the mesh.
int64 GT_Offset
Definition: GT_Types.h:129
long long int64
Definition: SYS_Types.h:116
GT_Size getMaxVertexCount() const
GLuint const GLchar * name
Definition: glcorearb.h:786
The base class for all GT primitive types.
Definition: GT_Primitive.h:43
virtual GT_PrimitiveHandle doHarden() const
const char * className() const override
virtual int64 getMemoryUsage() const =0
virtual GT_PrimPolygonMesh * clone(const GT_DataArrayHandle &vtx_indices, const GT_AttributeListHandle &shared) const
Processes primitives generated by refinement process.
Definition: GT_Refine.h:20
GT_Owner
Definition: GT_Types.h:90
int64 GT_Size
Definition: GT_Types.h:128
GT_AttributeListHandle myVertex
GT_AttributeListHandle myUniform
fpreal64 fpreal
Definition: SYS_Types.h:277
const GT_AttributeListHandle & getDetailAttributes() const override
const GT_ElementSetMapPtr & faceSetMap() const
virtual bool save(UT_JSONWriter &w) const
GA_API const UT_StringHolder N
GT_Offset getVertexOffset(GT_Offset face) const
Return the offset into the vertex list for the given face.
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:857
virtual GT_DataArrayHandle createPointNormals(int segment=0, const UT_StringRef &P=GA_Names::P, bool normalize=true, const fpreal32 *pntdata=NULL, GT_Storage store=GT_STORE_REAL32) const
GT_AttributeListHandle myDetail
virtual GT_PrimPolygonMesh * clone(const GT_AttributeListHandle &shared, const GT_AttributeListHandle &vertex, const GT_AttributeListHandle &uniform, const GT_AttributeListHandle &detail) const
virtual GT_PrimitiveHandle doAttributeMerge(const GT_Primitive &src, const UT_StringMMPattern *vertex, const UT_StringMMPattern *point, const UT_StringMMPattern *uniform, const UT_StringMMPattern *detail) const
The virtual implementation of attribute merging.
virtual void enlargeBounds(UT_BoundingBox boxes[], int nsegments) const =0
Single closed polygon.
const GT_AttributeListHandle & getDetail() const
const GT_AttributeListHandle & getUniformAttributes() const override
constexpr T normalize(UT_FixedVector< T, D > &a) noexcept
const GT_ElementSetMapPtr & pointSetMap() const
const GT_DataArrayHandle & getVertexList() const override
GLenum src
Definition: glcorearb.h:1793