11 #ifndef __GT_PrimPolygonMesh__
12 #define __GT_PrimPolygonMesh__
27 #define GT_DEFAULT_CUSP_ANGLE 60.0
32 #define GT_DEFAULT_ADJUSTED_CUSP_ANGLE 60.06
59 init(vtx_counts, vtx_indices, shared, vertex, uniform, detail,
60 indexing, min_vertex_count, max_vertex_count);
73 init(vtx_counts, vtx_indices, shared, vertex, uniform, detail);
99 const char *
className()
const override {
return "GT_PrimPolygonMesh"; }
105 int nsegments)
const override;
159 return myVertexList ? myVertexList->entries() : 0;
164 return myShared ? myShared->get(0)->entries() : 0;
176 {
return myVertexList; }
178 {
return myFaceOffsets; }
181 {
return myFaceOffsets; }
188 {
return myUniform; }
197 { myPointSetMap =
v; }
206 { myFaceSetMap =
v; }
232 {
return myUniform; }
242 {
return myFaceOffsets.getOffset(face); }
245 {
return myFaceOffsets.getCount(face); }
275 bool keep_degenerate =
false,
276 bool allow_interrupt =
true,
277 bool allow_indirect_flattening =
false,
292 void getConvexArrays(
302 const int32 *idx=
nullptr)
const;
330 const fpreal32 *pntdata =
nullptr)
const;
335 const fpreal32 *pntdata =
nullptr)
const;
340 const fpreal32 *pntdata =
nullptr)
const;
387 bool *
error =
nullptr)
const;
393 bool *
error =
nullptr)
const;
413 bool splitMesh(
GT_Size polygon_limit,
415 bool remove_unused_points =
true)
const;
436 void hardenAttributes();
449 GT_Size max_vertex_count=0)
const
452 shared, vertex, uniform, detail, indexing,
453 min_vertex_count, max_vertex_count);
463 shared, vertex, uniform, detail);
484 template <
typename VECTOR_T>
490 template <
typename VECTOR_T>
491 bool computePointNormals(
498 template <
typename VECTOR_T>
499 bool computeVertexNormals(
SIM_API const UT_StringHolder vertex
GT_Size getPointCount() const
Return the number of points.
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
virtual bool refine(GT_Refine &refiner, const GT_RefineParms *parms=NULL) const
const GT_AttributeListHandle & getPointAttributes() const override
virtual int getPrimitiveType() const
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
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
void setFaceSetMap(const GT_ElementSetMapPtr &v)
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.
GA_API const UT_StringHolder P
GT_Size getVertexCount() const
Return the number of vertices.
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.
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.
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.
GT_Size getMaxVertexCount() const
GLuint const GLchar * name
The base class for all GT primitive types.
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.
GT_AttributeListHandle myVertex
GT_AttributeListHandle myUniform
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
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
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