HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_CurveFrame Namespace Reference

Classes

struct  CurveFrameParms
 

Enumerations

enum  TangentType {
  CIRCULAR, SUBD, PREV, NEXT,
  NONE
}
 
enum  RotationPer {
  EDGE, DISTANCE, ATTRIB, FULLEDGES,
  FULLDISTANCE
}
 

Functions

GU_API bool getPolyProperties (const GEO_Detail *geometry, const GA_OffsetListRef &vertices, exint &nedges, bool &closed, bool &unrolled)
 
SYS_FORCE_INLINE bool getPolyProperties (const GEO_Detail *geometry, const GA_Offset primoff, exint &nedges, bool &closed, bool &unrolled)
 
template<typename T >
GU_API void computeCurveTransforms (const GEO_Detail *const geo, const GA_PrimitiveGroup *curve_group, const GA_RWHandleT< UT_Matrix4T< T >> &transform_attrib, const CurveFrameParms< T > &parms)
 
template<typename T , typename OUTPUT_T , typename FUNCTOR >
void extractAttribFromTransform (GEO_Detail *geo, const GA_PrimitiveGroup *curve_group, const GA_ROHandleT< UT_Matrix4T< T >> &transform_attrib, const GA_RWHandleT< OUTPUT_T > &output_attrib, FUNCTOR &&extract_functor)
 
template<int AXIS, typename T , typename OUTPUT_T >
void extractAxisAttrib (GEO_Detail *geo, const GA_PrimitiveGroup *curve_group, const GA_ROHandleT< UT_Matrix4T< T >> &transform_attrib, const GA_RWHandleT< UT_Vector3T< OUTPUT_T >> &axis_attrib)
 This works for AXIS == 0 (x), 1 (y), 2 (z), and 3 (translation). More...
 

Enumeration Type Documentation

Enumerator
EDGE 

Apply angle increment to each edge on top of previous edge's rotation.

DISTANCE 

Apply angle increment times edge length to each edge on top of previous edge's rotation.

ATTRIB 

Apply angle increment times rotation ramp attribute value on top of starting rotation of the primitive.

FULLEDGES 

Apply (angle increment / num edges) to each edge on top of previous edge's rotation.

FULLDISTANCE 

Apply (angle increment * edge length / total length) to each edge on top of previous edge's rotation.

Definition at line 66 of file GU_CurveFrame.h.

Enumerator
CIRCULAR 

Average of normalized direction vectors of adjacent edges. Extrapolation rotates tangent from prev/next edge as much as prev/next tangent rotated to that edge.

SUBD 

Central difference of (unnormalized) adjacent edges, e.g. computing velocity from motion trails. This is the tangent that a subdivision curve would have at each point. Extrapolation applies half the difference between the two prev/next edges to the prev/next edge to get the tangent.

PREV 

Tangent is the previous edge. Extrapolation (only back from the beginning of the curve) applies the negative difference between the two next edges to the next edge.

NEXT 

Tangent is the next edge. Extrapolation (only forward from the end of the curve) applies the difference between the two prev edges to the prev edge.

NONE 

Tangent is the Z axis (ignoring the curve tangent). Extrapolation does nothing.

Definition at line 37 of file GU_CurveFrame.h.

Function Documentation

template<typename T >
GU_API void GU_CurveFrame::computeCurveTransforms ( const GEO_Detail *const  geo,
const GA_PrimitiveGroup curve_group,
const GA_RWHandleT< UT_Matrix4T< T >> &  transform_attrib,
const CurveFrameParms< T > &  parms 
)

Computes transforms for vertex attribute transform_attrib based on primitives (assumed to be polygon primitives if not NURBS or Bezier) in geo and based on settings in parms.

NOTE: End vertices on unrolled curves are not written-to. Use extractAttribFromTransform to extract values to a more permanent vertex attribute.

This is instantiated for fpreal32 and fpreal64.

template<typename T , typename OUTPUT_T , typename FUNCTOR >
void GU_CurveFrame::extractAttribFromTransform ( GEO_Detail geo,
const GA_PrimitiveGroup curve_group,
const GA_ROHandleT< UT_Matrix4T< T >> &  transform_attrib,
const GA_RWHandleT< OUTPUT_T > &  output_attrib,
FUNCTOR &&  extract_functor 
)

Definition at line 194 of file GU_CurveFrame.h.

template<int AXIS, typename T , typename OUTPUT_T >
void GU_CurveFrame::extractAxisAttrib ( GEO_Detail geo,
const GA_PrimitiveGroup curve_group,
const GA_ROHandleT< UT_Matrix4T< T >> &  transform_attrib,
const GA_RWHandleT< UT_Vector3T< OUTPUT_T >> &  axis_attrib 
)

This works for AXIS == 0 (x), 1 (y), 2 (z), and 3 (translation).

Definition at line 263 of file GU_CurveFrame.h.

GU_API bool GU_CurveFrame::getPolyProperties ( const GEO_Detail geometry,
const GA_OffsetListRef vertices,
exint nedges,
bool &  closed,
bool &  unrolled 
)

Definition at line 1284 of file GU_CurveFrame.C.

SYS_FORCE_INLINE bool GU_CurveFrame::getPolyProperties ( const GEO_Detail geometry,
const GA_Offset  primoff,
exint nedges,
bool &  closed,
bool &  unrolled 
)

Definition at line 97 of file GU_CurveFrame.h.