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 { myFaceSetMap =
v; }
223 {
return myUniform; }
233 {
return myFaceOffsets.getOffset(face); }
236 {
return myFaceOffsets.getCount(face); }
266 bool keep_degenerate =
false,
267 bool allow_interrupt =
true,
268 bool allow_indirect_flattening =
false,
283 void getConvexArrays(
320 const fpreal32 *pntdata = NULL)
const;
325 const fpreal32 *pntdata = NULL)
const;
330 const fpreal32 *pntdata = NULL)
const;
377 bool *
error =
nullptr)
const;
383 bool *
error =
nullptr)
const;
403 bool splitMesh(
GT_Size polygon_limit,
405 bool remove_unused_points =
true)
const;
426 void hardenAttributes();
439 GT_Size max_vertex_count=0)
const
442 shared, vertex, uniform, detail, indexing,
443 min_vertex_count, max_vertex_count);
453 shared, vertex, uniform, detail);
474 template <
typename VECTOR_T>
480 template <
typename VECTOR_T>
481 bool computePointNormals(
488 template <
typename VECTOR_T>
489 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
void setFaceSetMap(const GT_FaceSetMapPtr &v)
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
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
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_FaceSetMapPtr & faceSetMap() const
const GT_AttributeListHandle & getDetail() const
const GT_AttributeListHandle & getUniformAttributes() const override
constexpr T normalize(UT_FixedVector< T, D > &a) noexcept
const GT_DataArrayHandle & getVertexList() const override