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

#include <meshUtil.h>

Classes

struct  EdgeEquality
 
struct  EdgeHash
 

Public Types

using EdgeMap = std::unordered_map< GfVec2i, int, EdgeHash, EdgeEquality >
 
using ReverseEdgeMap = std::unordered_map< int, GfVec2i >
 

Public Member Functions

 HdMeshUtil (HdMeshTopology const *topology, SdfPath const &id)
 
virtual ~HdMeshUtil ()
 
HD_API void ComputeTriangleIndices (VtVec3iArray *indices, VtIntArray *primitiveParams, VtVec3iArray *trianglesEdgeIndices=nullptr)
 
HD_API bool ComputeTriangulatedFaceVaryingPrimvar (void const *source, int numElements, HdType dataType, VtValue *triangulated)
 
HD_API void ComputeQuadInfo (HdQuadInfo *quadInfo)
 Generate a quadInfo struct for the input topology. More...
 
HD_API void ComputeQuadIndices (VtVec4iArray *indices, VtVec2iArray *primitiveParams, VtVec4iArray *quadsEdgeIndices=nullptr)
 
HD_API bool ComputeQuadrangulatedPrimvar (HdQuadInfo const *qi, void const *source, int numElements, HdType dataType, VtValue *quadrangulated)
 
HD_API bool ComputeQuadrangulatedFaceVaryingPrimvar (void const *source, int numElements, HdType dataType, VtValue *quadrangulated)
 

Static Public Member Functions

static HD_API int ComputeNumQuads (VtIntArray const &numVerts, VtIntArray const &holeIndices, bool *invalidFaceFound=NULL)
 
static int EncodeCoarseFaceParam (int faceIndex, int edgeFlag)
 
static int DecodeFaceIndexFromCoarseFaceParam (int coarseFaceParam)
 
static int DecodeEdgeFlagFromCoarseFaceParam (int coarseFaceParam)
 
static HD_API EdgeMap ComputeAuthoredEdgeMap (HdMeshTopology const *topology, bool skipHoles=false)
 
static HD_API ReverseEdgeMap ComputeReverseEdgeMap (const EdgeMap &edgeMap)
 
static HD_API std::pair< bool,
GfVec2i
GetVertexIndicesForEdge (const ReverseEdgeMap &rEdgeMap, int authoredEdgeId)
 
static HD_API std::pair< bool,
int
GetAuthoredEdgeID (HdMeshTopology const *topology, GfVec2i edge)
 

Detailed Description

A collection of utility algorithms for generating triangulation and quadrangulation of an input topology.

Definition at line 81 of file meshUtil.h.

Member Typedef Documentation

using HdMeshUtil::EdgeMap = std::unordered_map<GfVec2i, int, EdgeHash, EdgeEquality>

Definition at line 225 of file meshUtil.h.

using HdMeshUtil::ReverseEdgeMap = std::unordered_map<int, GfVec2i>

Definition at line 226 of file meshUtil.h.

Constructor & Destructor Documentation

HdMeshUtil::HdMeshUtil ( HdMeshTopology const topology,
SdfPath const id 
)
inline

Definition at line 84 of file meshUtil.h.

virtual HdMeshUtil::~HdMeshUtil ( )
inlinevirtual

Definition at line 86 of file meshUtil.h.

Member Function Documentation

static HD_API EdgeMap HdMeshUtil::ComputeAuthoredEdgeMap ( HdMeshTopology const topology,
bool  skipHoles = false 
)
static
static HD_API int HdMeshUtil::ComputeNumQuads ( VtIntArray const numVerts,
VtIntArray const holeIndices,
bool *  invalidFaceFound = NULL 
)
static

Return the number of quadrangulated quads. If degenerated face is found, sets invalidFaceFound as true.

HD_API void HdMeshUtil::ComputeQuadIndices ( VtVec4iArray *  indices,
VtVec2iArray *  primitiveParams,
VtVec4iArray *  quadsEdgeIndices = nullptr 
)

Return quadrangulated indices of the input topology. indices and primitiveParams are output parameters.

HD_API void HdMeshUtil::ComputeQuadInfo ( HdQuadInfo quadInfo)

Generate a quadInfo struct for the input topology.

HD_API bool HdMeshUtil::ComputeQuadrangulatedFaceVaryingPrimvar ( void const source,
int  numElements,
HdType  dataType,
VtValue quadrangulated 
)

Return a quadrangulation of a face-varying primvar. source is a buffer of size numElements and type corresponding to dataType (e.g. HdTypeFloatVec3); the result is a VtArray<T> of the correct type written to the variable "quadrangulated". This function returns false if it can't resolve dataType.

HD_API bool HdMeshUtil::ComputeQuadrangulatedPrimvar ( HdQuadInfo const qi,
void const source,
int  numElements,
HdType  dataType,
VtValue quadrangulated 
)

Return a quadrangulation of a per-vertex primvar. source is a buffer of size numElements and type corresponding to dataType (e.g. HdTypeFloatVec3); the result is a VtArray<T> of the correct type written to the variable "quadrangulated". This function returns false if it can't resolve dataType.

static HD_API ReverseEdgeMap HdMeshUtil::ComputeReverseEdgeMap ( const EdgeMap edgeMap)
static
HD_API void HdMeshUtil::ComputeTriangleIndices ( VtVec3iArray *  indices,
VtIntArray *  primitiveParams,
VtVec3iArray *  trianglesEdgeIndices = nullptr 
)

Return a triangulation of the input topology. indices and primitiveParams are output parameters.

HD_API bool HdMeshUtil::ComputeTriangulatedFaceVaryingPrimvar ( void const source,
int  numElements,
HdType  dataType,
VtValue triangulated 
)

Return a triangulation of a face-varying primvar. source is a buffer of size numElements and type corresponding to dataType (e.g. HdTypeFloatVec3); the result is a VtArray<T> of the correct type written to the variable "triangulated". This function returns false if it can't resolve dataType.

static int HdMeshUtil::DecodeEdgeFlagFromCoarseFaceParam ( int  coarseFaceParam)
inlinestatic

Definition at line 194 of file meshUtil.h.

static int HdMeshUtil::DecodeFaceIndexFromCoarseFaceParam ( int  coarseFaceParam)
inlinestatic

Definition at line 191 of file meshUtil.h.

static int HdMeshUtil::EncodeCoarseFaceParam ( int  faceIndex,
int  edgeFlag 
)
inlinestatic

Definition at line 188 of file meshUtil.h.

static HD_API std::pair<bool, int> HdMeshUtil::GetAuthoredEdgeID ( HdMeshTopology const topology,
GfVec2i  edge 
)
static
static HD_API std::pair<bool, GfVec2i> HdMeshUtil::GetVertexIndicesForEdge ( const ReverseEdgeMap rEdgeMap,
int  authoredEdgeId 
)
static

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