HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GT_PrimPolygonMesh Class Reference

A mesh of polygons. More...

#include <GT_PrimPolygonMesh.h>

+ Inheritance diagram for GT_PrimPolygonMesh:

Public Member Functions

 GT_PrimPolygonMesh ()
 Default constructor. More...
 
 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. More...
 
 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)
 
 GT_PrimPolygonMesh (const GT_PrimPolygonMesh &pmesh, const GT_AttributeListHandle &shared, const GT_AttributeListHandle &vertex, const GT_AttributeListHandle &uniform, const GT_AttributeListHandle &detail)
 
 GT_PrimPolygonMesh (const GT_PrimPolygonMesh &pmesh, const GT_DataArrayHandle &vtx_indices, const GT_AttributeListHandle &shared)
 
 GT_PrimPolygonMesh (const GT_PrimPolygonMesh &pmesh)
 Copy c-tor. More...
 
 GT_PrimPolygonMesh (const GT_PrimPolygon &poly)
 Construct a polygon mesh from a GT_PrimPolygon. More...
 
virtual ~GT_PrimPolygonMesh ()
 Destructor. More...
 
virtual const char * className () const
 
virtual bool save (UT_JSONWriter &w) const
 
GT_Size getFaceCount () const
 Return the number of faces in the mesh. More...
 
GT_PrimitiveHandle getFace (GT_Offset i) const
 Return a pointer to the individual face. More...
 
virtual GT_PrimitiveHandle doHarden () const
 Harden all attributes so there are no dangling dependencies. More...
 
virtual GT_PrimitiveHandle doSoftCopy () 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. More...
 
GT_Offset getVertexOffset (GT_Offset face) const
 Return the offset into the vertex list for the given face. More...
 
GT_Size getVertexCount (GT_Offset face) const
 Return the length of the vertex list for the given face. More...
 
void getEdgePoints (GT_Offset face, GT_Offset vertex, GT_Offset &p0, GT_Offset &p1) const
 
bool isConvexed () const
 Returns true if this mesh has been convexed. More...
 
void setConvexed (bool c)
 Set the convex flag on the mesh. More...
 
GT_DataArrayHandle getFaceCounts (GT_IndexingMode indexing=GT_INDEXING_QUICK) const
 Return an array containing the face counts per-face. More...
 
const GT_DataArrayHandle getUsedPointList (GT_IndexingMode idx=GT_INDEXING_QUICK) const
 
GT_PrimitiveHandle convex (int max_points_per_poly=3, bool keep_degenerate=false, bool allow_interrupt=true) const
 Ensure all polygons in the mesh are convex. More...
 
GT_PrimitiveHandle removeUnusedPoints (const int32 *idx=NULL) const
 
GT_PrimPolygonMeshcreatePointNormalsIfMissing (int segment=0, const char *P="P", bool normalize=true) const
 Create point normals on a new mesh if no normals are found. If no point or vertex normals are found, generate point normals from P and return a new mesh. If normals are found, return NULL. More...
 
bool splitMesh (GT_Size polygon_limit, UT_Array< GT_PrimitiveHandle > &split_meshes, bool remove_unused_points=true) const
 Divide a mesh into smaller meshes if it exceeds the poly_limit. If this mesh has more than polygon_limit polygons, this will split the mesh into multiple sub-meshes, attempting to keep them all roughly the same number of polygons. If this mesh has fewer than polygon_limit polygons, it will return false and not add any meshes to split_meshes. If remove_unused_points is true, each submesh will have unused points. More...
 
virtual bool updateGeoPrim (const GU_ConstDetailHandle &dtl, const GT_RefineParms &refine)
 update any cached data for geometry and its attributes More...
 
virtual void enlargeBounds (UT_BoundingBox boxes[], int nsegments) const
 
virtual int getPrimitiveType () const
 
virtual bool refine (GT_Refine &refiner, const GT_RefineParms *parms) const
 
virtual int getMotionSegments () const
 
virtual int64 getMemoryUsage () const
 
void init (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)
 
void init (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)
 
GT_Size getMinVertexCount () const
 
GT_Size getMaxVertexCount () const
 
virtual const GT_DataArrayHandlegetVertexList () const
 
const GT_CountArraygetFaceCountArray () const
 
const GT_AttributeListHandlegetShared () const
 
const GT_AttributeListHandlegetVertex () const
 
const GT_AttributeListHandlegetUniform () const
 
const GT_AttributeListHandlegetDetail () const
 
const GT_FaceSetMapPtrfaceSetMap () const
 
void setFaceSetMap (const GT_FaceSetMapPtr &v)
 
void addFaceSet (const char *name, const GT_FaceSetPtr &set)
 
virtual const
GT_AttributeListHandle
getVertexAttributes () const
 
virtual const
GT_AttributeListHandle
getPointAttributes () const
 
virtual const
GT_AttributeListHandle
getUniformAttributes () const
 
virtual const
GT_AttributeListHandle
getDetailAttributes () const
 
bool faceNormals (UT_Vector3 *N, int segment=0, const char *P="P") const
 
bool faceNormals (UT_Vector3D *N64, int segment=0, const char *P="P") const
 
bool faceNormals (fpreal16 *N16, int segment=0, const char *P="P") const
 
GT_DataArrayHandle faceNormals (int segment=0, const char *P="P", GT_Storage store=GT_STORE_REAL32) const
 
bool pointNormals (UT_Vector3T< fpreal16 > *N, GT_Size npts, int segment=0, const char *P="P", bool normalize=true, const fpreal32 *pntdata=NULL) const
 
bool pointNormals (UT_Vector3 *N, GT_Size npts, int segment=0, const char *P="P", bool normalize=true, const fpreal32 *pntdata=NULL) const
 
bool pointNormals (UT_Vector3D *N, GT_Size npts, int segment=0, const char *P="P", bool normalize=true, const fpreal32 *pntdata=NULL) const
 
virtual GT_DataArrayHandle createPointNormals (int segment=0, const char *P="P", bool normalize=true, const fpreal32 *pntdata=NULL, GT_Storage store=GT_STORE_REAL32) const
 
virtual fpreal computePerimeter (int seg) const
 
virtual fpreal computeSurfaceArea (int seg) const
 
virtual fpreal computeVolume (const UT_Vector3 &ref_P, int seg) const
 
- Public Member Functions inherited from GT_Primitive
 GT_Primitive ()
 
 GT_Primitive (const GT_Primitive &src)
 
virtual ~GT_Primitive ()
 
virtual bool getUniqueID (int64 &id) const
 
virtual void enlargeRenderBounds (UT_BoundingBox boxes[], int nsegments) const
 
virtual void getVelocityRange (UT_Vector3 &min, UT_Vector3 &max, const char *attribute_name="v") const
 
const GT_TransformHandlegetPrimitiveTransform () const
 
void setPrimitiveTransform (const GT_TransformHandle &x)
 Set the transform for a the primitive. More...
 
GT_PrimitiveHandle clone () const
 
virtual bool hasDataArray (const char *name, GT_Owner owner_scope[], int num_owners, GT_Storage *storage=NULL, GT_Size *tuple_size=NULL) const
 
void setStaticGeometry (bool static_geo)
 Return true if the primitive represents geometry at frame 'fr'. More...
 
bool isStaticGeometry () const
 
bool isFrameInfoAvailable () const
 
bool getDataIdHash (int64 &hash, int segment=0, bool cache_data_id=false) const
 
virtual bool getTopologyVersion (int64 &version) const
 Returns the topology version for the primitive. More...
 
GT_DataArrayHandle findAttribute (const char *name, GT_Owner &owner, int segment) const
 
void dumpAttributeLists (const char *label, bool data_too) const
 print out all attribute lists More...
 
void dumpPrimitive () const
 
bool saveAttributeLists (UT_JSONWriter &w) const
 
virtual const
GT_ViewportRefineOptions
viewportRefineOptions () const
 
GT_PrimitiveHandle harden () const
 
GT_PrimitiveHandle copyTransformed (const GT_TransformHandle &x, bool force=false) const
 
void refineCopyTransformFrom (const GT_Primitive &src)
 
GT_PrimitiveHandle attributeMerge (const GT_Primitive &src, const UT_StringMMPattern *vertex_pattern, const UT_StringMMPattern *point_pattern, const UT_StringMMPattern *uniform_pattern, const UT_StringMMPattern *detail_pattern) const
 
bool enlargeWidth (UT_BoundingBox boxes[], int nsegments, fpreal defwidth=-1) const
 
const GT_AttributeListHandlegetAttributeList (GT_Owner owner) const
 
- Public Member Functions inherited from UT_IntrusiveRefCounter< GT_Primitive >
SYS_FORCE_INLINE UT_IntrusiveRefCounter ()
 Default constructor: Sets counter to 0. More...
 
SYS_FORCE_INLINE UT_IntrusiveRefCounter (const UT_IntrusiveRefCounter &)
 Copy constructor: Sets counter to 0. More...
 
UT_IntrusiveRefCounteroperator= (const UT_IntrusiveRefCounter &)
 Assignment operator: Does not modify counter. More...
 
SYS_FORCE_INLINE uint32 use_count () const
 Return current counter. More...
 

Protected Member Functions

void hardenAttributes ()
 
virtual GT_PrimPolygonMeshclone (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
 
virtual GT_PrimPolygonMeshclone (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
 
virtual GT_PrimPolygonMeshclone (const GT_AttributeListHandle &shared, const GT_AttributeListHandle &vertex, const GT_AttributeListHandle &uniform, const GT_AttributeListHandle &detail) const
 
virtual GT_PrimPolygonMeshclone (const GT_DataArrayHandle &vtx_indices, const GT_AttributeListHandle &shared) const
 
- Protected Member Functions inherited from GT_Primitive
void enlargeP (UT_BoundingBox &box, const GT_AttributeListHandle &list, int segment) const
 
void enlargeP (UT_BoundingBox &B, const GT_DataArrayHandle &P) const
 Convenience method to enlarge a bounding box given a position attribute. More...
 
void enlargePw (UT_BoundingBox &B, const GT_DataArrayHandle &P) const
 
- Protected Member Functions inherited from UT_IntrusiveRefCounter< GT_Primitive >
SYS_FORCE_INLINE ~UT_IntrusiveRefCounter ()
 Destructor: Only derived classes can destruct this. More...
 

Protected Attributes

GT_AttributeListHandle myShared
 
GT_AttributeListHandle myVertex
 
GT_AttributeListHandle myUniform
 
GT_AttributeListHandle myDetail
 

Additional Inherited Members

- Static Public Member Functions inherited from GT_Primitive
static int createPrimitiveTypeId ()
 
static GT_AttributeListHandle mergeAttributeLists (bool &changed, const GT_AttributeListHandle &src, const GT_AttributeListHandle &merge, const UT_StringMMPattern *pattern, const UT_StringMMPattern *alternate=NULL)
 
static bool computeVelocityRange (UT_Vector3 &vmin, UT_Vector3 &vmax, const GT_DataArrayHandle &v)
 
static GT_PrimitiveHandle refineDetail (const GU_ConstDetailHandle &detail, const GT_RefineParms *parms)
 
static GT_PrimitiveHandle refinePrimitive (const GT_PrimitiveHandle &primh, const GT_RefineParms *parms)
 
static voidoperator new (size_t size)
 
static voidoperator new (size_t size, void *p)
 
static void operator delete (void *p, size_t size)
 

Detailed Description

A mesh of polygons.

Examples:
GUI/GUI_PolygonNormalShade.C, and tetprim/GT_PrimTetra.C.

Definition at line 25 of file GT_PrimPolygonMesh.h.

Constructor & Destructor Documentation

GT_PrimPolygonMesh::GT_PrimPolygonMesh ( )
inline

Default constructor.

Definition at line 29 of file GT_PrimPolygonMesh.h.

GT_PrimPolygonMesh::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 
)
inline

Useful constructor.

Definition at line 36 of file GT_PrimPolygonMesh.h.

GT_PrimPolygonMesh::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 
)
inline

Definition at line 53 of file GT_PrimPolygonMesh.h.

GT_PrimPolygonMesh::GT_PrimPolygonMesh ( const GT_PrimPolygonMesh pmesh,
const GT_AttributeListHandle shared,
const GT_AttributeListHandle vertex,
const GT_AttributeListHandle uniform,
const GT_AttributeListHandle detail 
)

Copy the topology information from the source pmesh, but use different attribute lists.

GT_PrimPolygonMesh::GT_PrimPolygonMesh ( const GT_PrimPolygonMesh pmesh,
const GT_DataArrayHandle vtx_indices,
const GT_AttributeListHandle shared 
)

Create a new polygon mesh with re-mapped vertices (used by removeUnusedPoints).

Since the polygon faces are remapped you'll have to pass in a new face set map.

GT_PrimPolygonMesh::GT_PrimPolygonMesh ( const GT_PrimPolygonMesh pmesh)

Copy c-tor.

GT_PrimPolygonMesh::GT_PrimPolygonMesh ( const GT_PrimPolygon poly)

Construct a polygon mesh from a GT_PrimPolygon.

virtual GT_PrimPolygonMesh::~GT_PrimPolygonMesh ( )
virtual

Destructor.

Member Function Documentation

void GT_PrimPolygonMesh::addFaceSet ( const char *  name,
const GT_FaceSetPtr set 
)

Access to the face sets

virtual const char* GT_PrimPolygonMesh::className ( void  ) const
inlinevirtual

Implements GT_Primitive.

Reimplemented in GT_PrimSubdivisionMesh.

Definition at line 91 of file GT_PrimPolygonMesh.h.

virtual GT_PrimPolygonMesh* 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
inlineprotectedvirtual

Reimplemented in GT_PrimSubdivisionMesh.

Definition at line 325 of file GT_PrimPolygonMesh.h.

virtual GT_PrimPolygonMesh* 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
inlineprotectedvirtual

Reimplemented in GT_PrimSubdivisionMesh.

Definition at line 339 of file GT_PrimPolygonMesh.h.

virtual GT_PrimPolygonMesh* GT_PrimPolygonMesh::clone ( const GT_AttributeListHandle shared,
const GT_AttributeListHandle vertex,
const GT_AttributeListHandle uniform,
const GT_AttributeListHandle detail 
) const
inlineprotectedvirtual

Reimplemented in GT_PrimSubdivisionMesh.

Definition at line 349 of file GT_PrimPolygonMesh.h.

virtual GT_PrimPolygonMesh* GT_PrimPolygonMesh::clone ( const GT_DataArrayHandle vtx_indices,
const GT_AttributeListHandle shared 
) const
inlineprotectedvirtual

Reimplemented in GT_PrimSubdivisionMesh.

Definition at line 356 of file GT_PrimPolygonMesh.h.

virtual fpreal GT_PrimPolygonMesh::computePerimeter ( int  seg) const
virtual

Methods for GEO/GU support.

Reimplemented from GT_Primitive.

virtual fpreal GT_PrimPolygonMesh::computeSurfaceArea ( int  seg) const
virtual

Methods for GEO/GU support.

Reimplemented from GT_Primitive.

virtual fpreal GT_PrimPolygonMesh::computeVolume ( const UT_Vector3 ref_P,
int  seg 
) const
virtual

Methods for GEO/GU support.

Reimplemented from GT_Primitive.

GT_PrimitiveHandle GT_PrimPolygonMesh::convex ( int  max_points_per_poly = 3,
bool  keep_degenerate = false,
bool  allow_interrupt = true 
) const

Ensure all polygons in the mesh are convex.

virtual GT_DataArrayHandle GT_PrimPolygonMesh::createPointNormals ( int  segment = 0,
const char *  P = "P",
bool  normalize = true,
const fpreal32 pntdata = NULL,
GT_Storage  store = GT_STORE_REAL32 
) const
virtual

Compute shared normals. This will use the shared attribute named P to compute the normals for each shared point.

Reimplemented from GT_Primitive.

GT_PrimPolygonMesh* GT_PrimPolygonMesh::createPointNormalsIfMissing ( int  segment = 0,
const char *  P = "P",
bool  normalize = true 
) const

Create point normals on a new mesh if no normals are found. If no point or vertex normals are found, generate point normals from P and return a new mesh. If normals are found, return NULL.

virtual GT_PrimitiveHandle GT_PrimPolygonMesh::doAttributeMerge ( const GT_Primitive src,
const UT_StringMMPattern vertex,
const UT_StringMMPattern point,
const UT_StringMMPattern uniform,
const UT_StringMMPattern detail 
) const
virtual

The virtual implementation of attribute merging.

Reimplemented from GT_Primitive.

Reimplemented in GT_PrimSubdivisionMesh.

virtual GT_PrimitiveHandle GT_PrimPolygonMesh::doHarden ( ) const
virtual

Harden all attributes so there are no dangling dependencies.

Reimplemented from GT_Primitive.

Reimplemented in GT_PrimSubdivisionMesh.

virtual GT_PrimitiveHandle GT_PrimPolygonMesh::doSoftCopy ( ) const
inlinevirtual

Create a copy of the primitive, referencing all the source data This can return a NULL pointer, but it would be better to implement it properly.

Implements GT_Primitive.

Reimplemented in GT_PrimSubdivisionMesh.

Definition at line 185 of file GT_PrimPolygonMesh.h.

virtual void GT_PrimPolygonMesh::enlargeBounds ( UT_BoundingBox  boxes[],
int  nsegments 
) const
virtual

Methods defined on GT_Primitive

Implements GT_Primitive.

bool GT_PrimPolygonMesh::faceNormals ( UT_Vector3 N,
int  segment = 0,
const char *  P = "P" 
) const

Compute face normals. This will use the shared attribute named P to compute the normals for each face. fpreal16 must have the proper vector length

bool GT_PrimPolygonMesh::faceNormals ( UT_Vector3D N64,
int  segment = 0,
const char *  P = "P" 
) const

Compute face normals. This will use the shared attribute named P to compute the normals for each face. fpreal16 must have the proper vector length

bool GT_PrimPolygonMesh::faceNormals ( fpreal16 N16,
int  segment = 0,
const char *  P = "P" 
) const

Compute face normals. This will use the shared attribute named P to compute the normals for each face. fpreal16 must have the proper vector length

GT_DataArrayHandle GT_PrimPolygonMesh::faceNormals ( int  segment = 0,
const char *  P = "P",
GT_Storage  store = GT_STORE_REAL32 
) const

Compute face normals. This will use the shared attribute named P to compute the normals for each face. fpreal16 must have the proper vector length

const GT_FaceSetMapPtr& GT_PrimPolygonMesh::faceSetMap ( ) const
inline

Access to the face sets

Definition at line 176 of file GT_PrimPolygonMesh.h.

const GT_AttributeListHandle& GT_PrimPolygonMesh::getDetail ( void  ) const
inline

Accessor

Definition at line 170 of file GT_PrimPolygonMesh.h.

virtual const GT_AttributeListHandle& GT_PrimPolygonMesh::getDetailAttributes ( ) const
inlinevirtual

Access attributes

Reimplemented from GT_Primitive.

Definition at line 203 of file GT_PrimPolygonMesh.h.

void GT_PrimPolygonMesh::getEdgePoints ( GT_Offset  face,
GT_Offset  vertex,
GT_Offset p0,
GT_Offset p1 
) const

For a given face, find the shared point numbers for the given vertex and the next vertex (i.e. the edge starting from the given vertex).

GT_PrimitiveHandle GT_PrimPolygonMesh::getFace ( GT_Offset  i) const

Return a pointer to the individual face.

GT_Size GT_PrimPolygonMesh::getFaceCount ( ) const

Return the number of faces in the mesh.

const GT_CountArray& GT_PrimPolygonMesh::getFaceCountArray ( ) const
inline

Accessor

Definition at line 158 of file GT_PrimPolygonMesh.h.

GT_DataArrayHandle GT_PrimPolygonMesh::getFaceCounts ( GT_IndexingMode  indexing = GT_INDEXING_QUICK) const

Return an array containing the face counts per-face.

GT_Size GT_PrimPolygonMesh::getMaxVertexCount ( ) const
inline

Query the minimum/maximum number of vertices per face

Definition at line 151 of file GT_PrimPolygonMesh.h.

virtual int64 GT_PrimPolygonMesh::getMemoryUsage ( ) const
virtual

Methods defined on GT_Primitive

Implements GT_Primitive.

Reimplemented in GT_PrimSubdivisionMesh.

GT_Size GT_PrimPolygonMesh::getMinVertexCount ( ) const
inline

Query the minimum/maximum number of vertices per face

Definition at line 150 of file GT_PrimPolygonMesh.h.

virtual int GT_PrimPolygonMesh::getMotionSegments ( ) const
virtual

Methods defined on GT_Primitive

Implements GT_Primitive.

virtual const GT_AttributeListHandle& GT_PrimPolygonMesh::getPointAttributes ( ) const
inlinevirtual

Access attributes

Reimplemented from GT_Primitive.

Definition at line 199 of file GT_PrimPolygonMesh.h.

virtual int GT_PrimPolygonMesh::getPrimitiveType ( ) const
virtual

Methods defined on GT_Primitive

Reimplemented from GT_Primitive.

Reimplemented in GT_PrimSubdivisionMesh.

const GT_AttributeListHandle& GT_PrimPolygonMesh::getShared ( ) const
inline

Accessor

Definition at line 164 of file GT_PrimPolygonMesh.h.

const GT_AttributeListHandle& GT_PrimPolygonMesh::getUniform ( ) const
inline

Accessor

Definition at line 168 of file GT_PrimPolygonMesh.h.

virtual const GT_AttributeListHandle& GT_PrimPolygonMesh::getUniformAttributes ( ) const
inlinevirtual

Access attributes

Reimplemented from GT_Primitive.

Definition at line 201 of file GT_PrimPolygonMesh.h.

const GT_DataArrayHandle GT_PrimPolygonMesh::getUsedPointList ( GT_IndexingMode  idx = GT_INDEXING_QUICK) const

The polygon mesh may have shared points which aren't used. That is, there may be elements in the shared element list which aren't referenced by any vertex. This method will build a list of indices for all the used points.

The list returned will be monotonically ascending.

const GT_AttributeListHandle& GT_PrimPolygonMesh::getVertex ( ) const
inline

Accessor

Definition at line 166 of file GT_PrimPolygonMesh.h.

virtual const GT_AttributeListHandle& GT_PrimPolygonMesh::getVertexAttributes ( ) const
inlinevirtual

Access attributes

Reimplemented from GT_Primitive.

Definition at line 197 of file GT_PrimPolygonMesh.h.

GT_Size GT_PrimPolygonMesh::getVertexCount ( GT_Offset  face) const
inline

Return the length of the vertex list for the given face.

Definition at line 211 of file GT_PrimPolygonMesh.h.

virtual const GT_DataArrayHandle& GT_PrimPolygonMesh::getVertexList ( ) const
inlinevirtual

Accessor

Reimplemented from GT_Primitive.

Definition at line 156 of file GT_PrimPolygonMesh.h.

GT_Offset GT_PrimPolygonMesh::getVertexOffset ( GT_Offset  face) const
inline

Return the offset into the vertex list for the given face.

Definition at line 208 of file GT_PrimPolygonMesh.h.

void GT_PrimPolygonMesh::hardenAttributes ( )
protected
void GT_PrimPolygonMesh::init ( 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 
)

Initialize the mesh

  • vtx_counts
    An integer array, representing the number of vertices in each face. The length of the array determines the number of faces in the mesh.
  • vtx_indices
    An array of vertex references. There is an entry for every vertex in every face. These indices refer to the shared attribute data.
  • shared
    Shared attribute data. This data is referenced by the vertex arrays.
  • vertex
    Unique data per vertex. The length of these attribute arrays should be the same as the length of the vtx_indices array.
  • uniform
    Attribute per face. There should be one entry for each entry in the vtx_counts array.
  • detail
    Constant attribute for all faces. vtx_counts array.
  • indexing
    What type of indexing is required
void GT_PrimPolygonMesh::init ( 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 
)

Initialize the mesh

  • vtx_counts
    An integer array, representing the number of vertices in each face. The length of the array determines the number of faces in the mesh.
  • vtx_indices
    An array of vertex references. There is an entry for every vertex in every face. These indices refer to the shared attribute data.
  • shared
    Shared attribute data. This data is referenced by the vertex arrays.
  • vertex
    Unique data per vertex. The length of these attribute arrays should be the same as the length of the vtx_indices array.
  • uniform
    Attribute per face. There should be one entry for each entry in the vtx_counts array.
  • detail
    Constant attribute for all faces. vtx_counts array.
  • indexing
    What type of indexing is required
bool GT_PrimPolygonMesh::isConvexed ( ) const
inline

Returns true if this mesh has been convexed.

Definition at line 219 of file GT_PrimPolygonMesh.h.

bool GT_PrimPolygonMesh::pointNormals ( UT_Vector3T< fpreal16 > *  N,
GT_Size  npts,
int  segment = 0,
const char *  P = "P",
bool  normalize = true,
const fpreal32 pntdata = NULL 
) const

Compute shared normals. This will use the shared attribute named P to compute the normals for each shared point.

bool GT_PrimPolygonMesh::pointNormals ( UT_Vector3 N,
GT_Size  npts,
int  segment = 0,
const char *  P = "P",
bool  normalize = true,
const fpreal32 pntdata = NULL 
) const

Compute shared normals. This will use the shared attribute named P to compute the normals for each shared point.

bool GT_PrimPolygonMesh::pointNormals ( UT_Vector3D N,
GT_Size  npts,
int  segment = 0,
const char *  P = "P",
bool  normalize = true,
const fpreal32 pntdata = NULL 
) const

Compute shared normals. This will use the shared attribute named P to compute the normals for each shared point.

virtual bool GT_PrimPolygonMesh::refine ( GT_Refine refiner,
const GT_RefineParms parms 
) const
virtual

Methods defined on GT_Primitive

Reimplemented from GT_Primitive.

Reimplemented in GT_PrimSubdivisionMesh.

GT_PrimitiveHandle GT_PrimPolygonMesh::removeUnusedPoints ( const int32 idx = NULL) const

Remove unused points. This will collapse the varying point arrays, leaving only the points referenced by the vertices.

virtual bool GT_PrimPolygonMesh::save ( UT_JSONWriter w) const
virtual

Save the primitive to a JSON stream. The default method does nothing and returns false.

Reimplemented from GT_Primitive.

Reimplemented in GT_PrimSubdivisionMesh.

void GT_PrimPolygonMesh::setConvexed ( bool  c)
inline

Set the convex flag on the mesh.

Definition at line 222 of file GT_PrimPolygonMesh.h.

void GT_PrimPolygonMesh::setFaceSetMap ( const GT_FaceSetMapPtr v)
inline

Access to the face sets

Definition at line 177 of file GT_PrimPolygonMesh.h.

bool GT_PrimPolygonMesh::splitMesh ( GT_Size  polygon_limit,
UT_Array< GT_PrimitiveHandle > &  split_meshes,
bool  remove_unused_points = true 
) const

Divide a mesh into smaller meshes if it exceeds the poly_limit. If this mesh has more than polygon_limit polygons, this will split the mesh into multiple sub-meshes, attempting to keep them all roughly the same number of polygons. If this mesh has fewer than polygon_limit polygons, it will return false and not add any meshes to split_meshes. If remove_unused_points is true, each submesh will have unused points.

virtual bool GT_PrimPolygonMesh::updateGeoPrim ( const GU_ConstDetailHandle dtl,
const GT_RefineParms parms 
)
virtual

update any cached data for geometry and its attributes

Reimplemented from GT_Primitive.

Member Data Documentation

GT_AttributeListHandle GT_PrimPolygonMesh::myDetail
protected

Definition at line 365 of file GT_PrimPolygonMesh.h.

GT_AttributeListHandle GT_PrimPolygonMesh::myShared
protected

Definition at line 362 of file GT_PrimPolygonMesh.h.

GT_AttributeListHandle GT_PrimPolygonMesh::myUniform
protected

Definition at line 364 of file GT_PrimPolygonMesh.h.

GT_AttributeListHandle GT_PrimPolygonMesh::myVertex
protected

Definition at line 363 of file GT_PrimPolygonMesh.h.


The documentation for this class was generated from the following file: