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

#include <GT_Util.h>

Static Public Member Functions

static void makeGEO (UT_Array< GU_Detail * > &result, const GT_PrimitiveHandle &prim, const GT_RefineParms *rparms=NULL, int segment=0)
 
static void makeGEO (UT_Array< GU_Detail * > &result, const GT_Primitive &prim, const GT_RefineParms *rparms=NULL, int segment=0)
 
static void makeGEO (UT_Array< GU_DetailHandle > &result, const GT_PrimitiveHandle &prim, const GT_RefineParms *parms=NULL, int segment=0)
 
static void makeGEO (UT_Array< GU_DetailHandle > &result, const GT_Primitive &prim, const GT_RefineParms *rparms=NULL, int segment=0)
 
static bool isSimpleGEO (const GT_Primitive &prim, const GT_RefineParms *rparms=NULL)
 Test whether a primitive is atomic (i.e. converts to a single gdp) More...
 
static void makeGD (GD_Detail &gdp, const GT_TrimNuCurves &curves)
 Convert a GT_TrimNuCurves primitive to a GD_Detail for trim curves. More...
 
static GT_Type getType (GA_TypeInfo type)
 Map from GA_Type info to a GT_Type info. More...
 
static GA_TypeInfo getGAType (GT_Type type)
 Map from GT_Type to GA_TypeInfo. More...
 
static GT_Storage getStorage (GA_Storage storage)
 Map from GA_Storage to GT_Storage. More...
 
static GA_Storage getGAStorage (GT_Storage storage)
 Map from GT_Storage to GA_Storage. More...
 
static GT_DataArrayHandle extractAttribute (const GA_Attribute &attrib, const GA_Range &range)
 Extract a data array from a GA attribute. More...
 
static bool computeSubdivisionCreases (const GU_Detail &gdp, const GT_PrimPolygonMesh &polymesh, GT_DataArrayHandle &edge_indices, GT_DataArrayHandle &edge_sharpnesses, GT_DataArrayHandle &corner_indices, GT_DataArrayHandle &corner_sharpnesses, GT_DataArrayHandle &hole_indices)
 
static bool computeSubdivisionCreases (const GT_PrimPolygonMesh &polymesh, GT_DataArrayHandle &edge_indices, GT_DataArrayHandle &edge_sharpnesses, GT_DataArrayHandle &corner_indices, GT_DataArrayHandle &corner_sharpnesses, GT_DataArrayHandle &hole_indices)
 
static GT_DataArrayHandle getPointID (const GT_Primitive &prim, const GU_Detail &parent_detail, int npoints)
 Return an array of the point IDs of the primitives (in GA_Index's). More...
 
static GT_DataArrayHandle getPointID (const GT_Primitive &prim, const GU_ConstDetailHandle &parent, int npoints)
 
static GT_DataArrayHandle getPrimitiveID (const GT_Primitive &prim, const GU_Detail &parent_detail, bool use_nested=false)
 
static GT_DataArrayHandle getPrimitiveID (const GT_Primitive &prim, const GU_ConstDetailHandle &parent, bool use_nested=false)
 
template<typename T >
static GT_DataArrayHandle buildPointIndirect (GT_Size *points, GT_Size npoints, GT_Size newpoints)
 
template<typename T >
static GT_DataArrayHandle buildVertexIndirect (const GT_Size *points, const GT_DataArrayHandle &vtx)
 
static GT_PrimitiveHandle optimizePolyMeshForGL (const GT_PrimitiveHandle &mesh, GU_ConstDetailHandle &parent_dtl)
 
static void addViewportLODAttribs (const UT_Array< GEO_ViewportLOD > &lods, GT_AttributeListHandle &uniform, GT_AttributeListHandle &detail)
 
static void addBBoxAttrib (const UT_BoundingBox &bbox, GT_AttributeListHandle &detail)
 

Detailed Description

Definition at line 32 of file GT_Util.h.

Member Function Documentation

static void GT_Util::addBBoxAttrib ( const UT_BoundingBox bbox,
GT_AttributeListHandle detail 
)
static
static void GT_Util::addViewportLODAttribs ( const UT_Array< GEO_ViewportLOD > &  lods,
GT_AttributeListHandle uniform,
GT_AttributeListHandle detail 
)
static
template<typename T >
static GT_DataArrayHandle GT_Util::buildPointIndirect ( GT_Size points,
GT_Size  npoints,
GT_Size  newpoints 
)
inlinestatic

Definition at line 151 of file GT_Util.h.

template<typename T >
static GT_DataArrayHandle GT_Util::buildVertexIndirect ( const GT_Size points,
const GT_DataArrayHandle vtx 
)
inlinestatic

Definition at line 173 of file GT_Util.h.

static bool GT_Util::computeSubdivisionCreases ( const GU_Detail gdp,
const GT_PrimPolygonMesh polymesh,
GT_DataArrayHandle edge_indices,
GT_DataArrayHandle edge_sharpnesses,
GT_DataArrayHandle corner_indices,
GT_DataArrayHandle corner_sharpnesses,
GT_DataArrayHandle hole_indices 
)
static

Some software represents crease weights as a list of edges and sharpnesses, or corners and sharpnesses. This code will look for the Houdini "crease" attributes and map them to edge or corner crease weights. Edge creases are specified by two indices and a single sharpneess (i.e. the length of edge_indices will be twice the length of edge_sharpness).
Each index (edge or corner) refers to a vertex in the vertex list.

Note
: This function relies on being able to find the __primitive_id and __vertex_id attributes on the polygon mesh to evaluate the creaseweight attribute.
: You only need a GT_PrimPolygonMesh to compute creases... GT_PrimSubdivisionMesh is a sub-class of GT_PrimPolygonMesh.
static bool GT_Util::computeSubdivisionCreases ( const GT_PrimPolygonMesh polymesh,
GT_DataArrayHandle edge_indices,
GT_DataArrayHandle edge_sharpnesses,
GT_DataArrayHandle corner_indices,
GT_DataArrayHandle corner_sharpnesses,
GT_DataArrayHandle hole_indices 
)
static

This version of computeSubdivisionCreases() looks for uniform or vertex attributes named "creaseweight" on the GT_PrimPolygonMesh.

static GT_DataArrayHandle GT_Util::extractAttribute ( const GA_Attribute attrib,
const GA_Range range 
)
static

Extract a data array from a GA attribute.

static GA_Storage GT_Util::getGAStorage ( GT_Storage  storage)
static

Map from GT_Storage to GA_Storage.

static GA_TypeInfo GT_Util::getGAType ( GT_Type  type)
static

Map from GT_Type to GA_TypeInfo.

static GT_DataArrayHandle GT_Util::getPointID ( const GT_Primitive prim,
const GU_Detail parent_detail,
int  npoints 
)
static

Return an array of the point IDs of the primitives (in GA_Index's).

static GT_DataArrayHandle GT_Util::getPointID ( const GT_Primitive prim,
const GU_ConstDetailHandle parent,
int  npoints 
)
static
static GT_DataArrayHandle GT_Util::getPrimitiveID ( const GT_Primitive prim,
const GU_Detail parent_detail,
bool  use_nested = false 
)
static

Return an array of the primitive IDs (in GA_Index's). If 'use_nested' is true, attempt to find __nested_prim_id first, then fall back to __primitive_id.

static GT_DataArrayHandle GT_Util::getPrimitiveID ( const GT_Primitive prim,
const GU_ConstDetailHandle parent,
bool  use_nested = false 
)
static
static GT_Storage GT_Util::getStorage ( GA_Storage  storage)
static

Map from GA_Storage to GT_Storage.

static GT_Type GT_Util::getType ( GA_TypeInfo  type)
static

Map from GA_Type info to a GT_Type info.

static bool GT_Util::isSimpleGEO ( const GT_Primitive prim,
const GT_RefineParms rparms = NULL 
)
static

Test whether a primitive is atomic (i.e. converts to a single gdp)

static void GT_Util::makeGD ( GD_Detail gdp,
const GT_TrimNuCurves curves 
)
static

Convert a GT_TrimNuCurves primitive to a GD_Detail for trim curves.

static void GT_Util::makeGEO ( UT_Array< GU_Detail * > &  result,
const GT_PrimitiveHandle prim,
const GT_RefineParms rparms = NULL,
int  segment = 0 
)
static

Create a list of geometry details. Each refined primitive is stored in a separate detail. Refine parameters include:

  • bool "gconvert:include_ids" (default: false)
    Keep the __vertex_id and __primitive_id attributes in conversion
  • bool "gconvert:particleprim" (default: false)
    Convert point mesh primitives to a particle primitive. If off, the detail will just contain points (no primitives).
  • bool "gconvert:pack" (default: false)
    Each primitive will be packed into a packed primitive, meaning the list of returned details will each have a single packed primitive.
static void GT_Util::makeGEO ( UT_Array< GU_Detail * > &  result,
const GT_Primitive prim,
const GT_RefineParms rparms = NULL,
int  segment = 0 
)
static

Create a list of geometry details for a single GT primitive. Each refined primitive is stored in a separate detail. These details must be deleted by the caller.

static void GT_Util::makeGEO ( UT_Array< GU_DetailHandle > &  result,
const GT_PrimitiveHandle prim,
const GT_RefineParms parms = NULL,
int  segment = 0 
)
static

Create a list of geometry details, but return the result in an array of GU_DetailHandle's. Each primitive's refined geometry is stored in a separate detail.

Refine parameters include:

  • bool "gconvert:include_ids" (default: false)
    Keep the __vertex_id and __primitive_id attributes in conversion
  • bool "gconvert:particleprim" (default: false)
    Convert point mesh primitives to a particle primitive. If off, the detail will just contain points (no primitives).
static void GT_Util::makeGEO ( UT_Array< GU_DetailHandle > &  result,
const GT_Primitive prim,
const GT_RefineParms rparms = NULL,
int  segment = 0 
)
static

Create a list of geometry details for a single GT primitive. Each refined primitive is stored in a separate detail.

static GT_PrimitiveHandle GT_Util::optimizePolyMeshForGL ( const GT_PrimitiveHandle mesh,
GU_ConstDetailHandle parent_dtl 
)
static

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