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

#include <GU_GroomUtils.h>

Classes

class  QuatInterpTempStorage
 

Public Types

enum  SetLengthMode {
  SetLengthMode::SET = 0, SetLengthMode::MULTIPLY, SetLengthMode::ADD, SetLengthMode::SUBTRACT,
  SetLengthMode::SETMIN, SetLengthMode::SETMAX
}
 

Static Public Member Functions

static GA_AttributefindOrCreateFloatAttribute (GU_Detail &gdp, const GA_AttributeOwner owner, const UT_StringRef &name, const exint tsize, const GA_Defaults &defaults=GA_Defaults(0.0), GA_Storage storage=GA_STORE_REAL32)
 
static GA_AttributefindOrCreateIntAttribute (GU_Detail &gdp, const GA_AttributeOwner owner, const UT_StringRef &name, const exint tsize, const GA_Defaults &defaults=GA_Defaults(0), GA_Storage storage=GA_STORE_INT32)
 
static GA_AttributefindOrCreateStringAttribute (GU_Detail &gdp, const GA_AttributeOwner owner, const UT_StringRef &name)
 
static GA_AttributefindOrCreateStringArrayAttribute (GU_Detail &gdp, GA_AttributeOwner owner, const UT_StringRef &name, int tsize)
 
static GA_AttributefindOrCreateIntArrayAttribute (GU_Detail &gdp, GA_AttributeOwner owner, const UT_StringRef &name, int tsize, GA_Storage storage=GA_STORE_INT32)
 
static GA_AttributefindOrCreateFloatArrayAttribute (GU_Detail &gdp, GA_AttributeOwner owner, const UT_StringRef &name, int tsize, GA_Storage storage=GA_STORE_REAL32)
 
static GA_AttributefindNamedOrient (GU_Detail &gdp, const UT_StringRef &name)
 
static const GA_AttributefindNamedOrient (const GU_Detail &gdp, const UT_StringRef &name)
 
static GA_AttributefindOrCreateNamedOrient (GU_Detail &gdp, const UT_StringRef &name)
 
static void getPrimPointPositions (UT_Vector3Array &positions, GA_Offset primoff, const GU_Detail &gdp, const GA_ROHandleV3 &pos_handle)
 
static void setPrimPointPositions (UT_Vector3Array &positions, GA_Offset primoff, const GU_Detail &gdp, const GA_RWHandleV3 &pos_handle)
 
static fpreal calcPerimeter (UT_Vector3Array &pos)
 
static float unitLengthToUnitDomain (const UT_Vector3Array &pos, float perimeter, const UT_FloatArray &edgelengths, float ulength)
 
static float unitToUnitLengthDomain (float perimeter, const UT_FloatArray &edgelengths, float uparm)
 
static float unitLengthToUnitDomain (fpreal perimeter, const UT_FloatArray &edgelengths, float ulength)
 
static float openCurveUnitToReal (int n, float u_unit)
 
static UT_Tuple< UT_Vector2,
UT_Vector2i
openCurvePointWeights (int n, fpreal u)
 
template<typename T >
static T interpAttrib (const GA_ROHandleT< T > &attrib, const GA_Offset &primoff, const GA_OffsetArray &vertoffsets, const UT_FloatArray &vertweights, const T defaultvalue=T(0.0f))
 
static fpreal computeLength (const UT_Vector3Array &positions)
 
static fpreal computeEdgeLengths (const UT_Vector3Array &positions, UT_FloatArray &edgelengths)
 
static fpreal computeEdgeLengths (const GU_Detail &gdp, const GA_ROHandleV3 &P, GA_Offset primoff, UT_FloatArray &edgelengths)
 
static void addWeightedGuide (const GU_Detail &guidegdp, const GEO_PrimPoly *const guideprim, const GA_Offset guideprimoff, const int guideindex, const float guideweight, const GA_ROHandleF &guidetightnessattrib, const GA_ROHandleV3 &guidetangentattrib, const GA_ROHandleV3 &guidenormalattrib, const GA_ROHandleV3 &guidePattrib, const GA_AttributeRefMap &guidepointlinattribmap, const GA_AttributeRefMap &guidepointquatattribmap, const bool extrude, const bool setpos, const bool uniformguidesegments, const GA_Size vtxcount, const UT_Vector3 rootpos, const GA_OffsetListRef &vtxlist, UT_FloatArray &glengths, GA_OffsetArray &guidevertoffsets, UT_FloatArray &guidevertweights, UT_Array< UT_Vector3 > &positions, UT_ValArray< GA_WeightedSum > &pointsums, QuatInterpTempStorage &quattemp, const UT_Matrix3 *guidetoposrot=nullptr)
 
static void removeNonGuidesFromGroup (GA_PrimitiveGroup &guidegroup, GU_Detail &gdp)
 
static void removeHiddenPrimitivesFromGroup (GA_PrimitiveGroup &guidegroup, GU_Detail &gdp)
 
static void setGuideGroupMembers (GA_PrimitiveGroup &guidegroup, const GA_ElementGroup *ingroup, const GA_ElementGroup *inmirrorgroup, const GA_PrimitiveGroup *templategroup, GU_Detail &gdp)
 
static fpreal computeNewLength (fpreal prevlength, SetLengthMode mode, fpreal value)
 
static void scaleCurve (GU_Detail &gdp, const GA_RWHandleV3 &Pattrib, GA_Offset primoff, GA_OffsetListRef &curvevertoffs, float factor)
 
static void setCurveLength (GU_Detail &gdp, const GA_RWHandleV3 &Pattrib, GA_Offset primoff, fpreal prevlength, fpreal newlength, GA_OffsetListRef &curvevertoffs, UT_FloatArray &tempu, UT_Vector3Array &temppos)
 
static void setCurveLength (UT_Vector3Array &positions, fpreal prevlength, fpreal newlength, UT_FloatArray &tempu, UT_Vector3Array &temppos)
 
static float circlePackRootPoints (const GU_Detail &gdp, const GA_ROHandleV3 &restPattrib, UT_IntArray &indices, UT_FloatArray &sqdists, const GA_Offset *const offsets, exint numcurves, const UT_Vector3 &clumproot, const UT_Matrix3 &clumprot, const GA_RWHandleV2 &bundleposattrib)
 
static UT_Vector3 slideFrame (const UT_Vector3 x0, const UT_Vector3 t0, const UT_Vector3 n0, const UT_Vector3 x1, const UT_Vector3 t1)
 
static UT_Matrix3 computeTangentFrame (const UT_Vector3 &tangent, const UT_Vector3 &normal)
 
static void computeTangentFrames (UT_ValArray< UT_Matrix3 > &frames, const UT_Vector3Array &positions, const UT_Vector3 &roottangent, const UT_Vector3 &rootnormal)
 
static SYS_FORCE_INLINE GA_Offset primVertexOffset (const GU_Detail &gdp, GA_Offset primoff, GA_Size index=0)
 
static SYS_FORCE_INLINE GA_Offset primPointOffset (const GU_Detail &gdp, GA_Offset primoff, GA_Size index=0)
 
static void setPagesConstant (GA_RWHandleF attribhandle, float value)
 
static bool checkSkinPrimIndices (const GA_ROHandleI &skinprimattrib, const GU_Detail &skingdp, const GA_ElementGroup *group=nullptr)
 
static UT_Tuple< GA_Attribute
*, GA_Attribute * > 
createNameAndWeightArrayAttributes (GU_Detail &gdp, GA_AttributeOwner owner, const UT_StringHolder &name_attrib_name, const UT_StringHolder &weight_attrib_name)
 
static UT_Tuple< GA_Attribute
*, GA_Attribute * > 
createIndexAndWeightArrayAttributes (GU_Detail &gdp, GA_AttributeOwner owner, const UT_StringHolder &name_attrib_name, const UT_StringHolder &weight_attrib_name)
 

Detailed Description

Definition at line 30 of file GU_GroomUtils.h.

Member Enumeration Documentation

Enumerator
SET 
MULTIPLY 
ADD 
SUBTRACT 
SETMIN 
SETMAX 

Definition at line 317 of file GU_GroomUtils.h.

Member Function Documentation

static void GU_GroomUtils::addWeightedGuide ( const GU_Detail guidegdp,
const GEO_PrimPoly *const  guideprim,
const GA_Offset  guideprimoff,
const int  guideindex,
const float  guideweight,
const GA_ROHandleF guidetightnessattrib,
const GA_ROHandleV3 guidetangentattrib,
const GA_ROHandleV3 guidenormalattrib,
const GA_ROHandleV3 guidePattrib,
const GA_AttributeRefMap guidepointlinattribmap,
const GA_AttributeRefMap guidepointquatattribmap,
const bool  extrude,
const bool  setpos,
const bool  uniformguidesegments,
const GA_Size  vtxcount,
const UT_Vector3  rootpos,
const GA_OffsetListRef vtxlist,
UT_FloatArray glengths,
GA_OffsetArray guidevertoffsets,
UT_FloatArray guidevertweights,
UT_Array< UT_Vector3 > &  positions,
UT_ValArray< GA_WeightedSum > &  pointsums,
QuatInterpTempStorage quattemp,
const UT_Matrix3 guidetoposrot = nullptr 
)
static
static fpreal GU_GroomUtils::calcPerimeter ( UT_Vector3Array pos)
static
static bool GU_GroomUtils::checkSkinPrimIndices ( const GA_ROHandleI skinprimattrib,
const GU_Detail skingdp,
const GA_ElementGroup group = nullptr 
)
inlinestatic

Definition at line 443 of file GU_GroomUtils.h.

static float GU_GroomUtils::circlePackRootPoints ( const GU_Detail gdp,
const GA_ROHandleV3 restPattrib,
UT_IntArray indices,
UT_FloatArray sqdists,
const GA_Offset *const  offsets,
exint  numcurves,
const UT_Vector3 clumproot,
const UT_Matrix3 clumprot,
const GA_RWHandleV2 bundleposattrib 
)
static
static fpreal GU_GroomUtils::computeEdgeLengths ( const UT_Vector3Array positions,
UT_FloatArray edgelengths 
)
static
static fpreal GU_GroomUtils::computeEdgeLengths ( const GU_Detail gdp,
const GA_ROHandleV3 P,
GA_Offset  primoff,
UT_FloatArray edgelengths 
)
static
static fpreal GU_GroomUtils::computeLength ( const UT_Vector3Array positions)
static
static fpreal GU_GroomUtils::computeNewLength ( fpreal  prevlength,
SetLengthMode  mode,
fpreal  value 
)
inlinestatic

Definition at line 328 of file GU_GroomUtils.h.

static UT_Matrix3 GU_GroomUtils::computeTangentFrame ( const UT_Vector3 tangent,
const UT_Vector3 normal 
)
static
static void GU_GroomUtils::computeTangentFrames ( UT_ValArray< UT_Matrix3 > &  frames,
const UT_Vector3Array positions,
const UT_Vector3 roottangent,
const UT_Vector3 rootnormal 
)
static
static UT_Tuple<GA_Attribute*, GA_Attribute*> GU_GroomUtils::createIndexAndWeightArrayAttributes ( GU_Detail gdp,
GA_AttributeOwner  owner,
const UT_StringHolder name_attrib_name,
const UT_StringHolder weight_attrib_name 
)
inlinestatic

Definition at line 499 of file GU_GroomUtils.h.

static UT_Tuple<GA_Attribute*, GA_Attribute*> GU_GroomUtils::createNameAndWeightArrayAttributes ( GU_Detail gdp,
GA_AttributeOwner  owner,
const UT_StringHolder name_attrib_name,
const UT_StringHolder weight_attrib_name 
)
inlinestatic

Definition at line 483 of file GU_GroomUtils.h.

static GA_Attribute* GU_GroomUtils::findNamedOrient ( GU_Detail gdp,
const UT_StringRef name 
)
static
static const GA_Attribute* GU_GroomUtils::findNamedOrient ( const GU_Detail gdp,
const UT_StringRef name 
)
static
static GA_Attribute* GU_GroomUtils::findOrCreateFloatArrayAttribute ( GU_Detail gdp,
GA_AttributeOwner  owner,
const UT_StringRef name,
int  tsize,
GA_Storage  storage = GA_STORE_REAL32 
)
inlinestatic

Definition at line 89 of file GU_GroomUtils.h.

static GA_Attribute* GU_GroomUtils::findOrCreateFloatAttribute ( GU_Detail gdp,
const GA_AttributeOwner  owner,
const UT_StringRef name,
const exint  tsize,
const GA_Defaults defaults = GA_Defaults(0.0),
GA_Storage  storage = GA_STORE_REAL32 
)
static
static GA_Attribute* GU_GroomUtils::findOrCreateIntArrayAttribute ( GU_Detail gdp,
GA_AttributeOwner  owner,
const UT_StringRef name,
int  tsize,
GA_Storage  storage = GA_STORE_INT32 
)
inlinestatic

Definition at line 73 of file GU_GroomUtils.h.

static GA_Attribute* GU_GroomUtils::findOrCreateIntAttribute ( GU_Detail gdp,
const GA_AttributeOwner  owner,
const UT_StringRef name,
const exint  tsize,
const GA_Defaults defaults = GA_Defaults(0),
GA_Storage  storage = GA_STORE_INT32 
)
static
static GA_Attribute* GU_GroomUtils::findOrCreateNamedOrient ( GU_Detail gdp,
const UT_StringRef name 
)
static
static GA_Attribute* GU_GroomUtils::findOrCreateStringArrayAttribute ( GU_Detail gdp,
GA_AttributeOwner  owner,
const UT_StringRef name,
int  tsize 
)
inlinestatic

Definition at line 58 of file GU_GroomUtils.h.

static GA_Attribute* GU_GroomUtils::findOrCreateStringAttribute ( GU_Detail gdp,
const GA_AttributeOwner  owner,
const UT_StringRef name 
)
static
static void GU_GroomUtils::getPrimPointPositions ( UT_Vector3Array positions,
GA_Offset  primoff,
const GU_Detail gdp,
const GA_ROHandleV3 pos_handle 
)
static
template<typename T >
static T GU_GroomUtils::interpAttrib ( const GA_ROHandleT< T > &  attrib,
const GA_Offset primoff,
const GA_OffsetArray vertoffsets,
const UT_FloatArray vertweights,
const T  defaultvalue = T(0.0f) 
)
static
static UT_Tuple<UT_Vector2, UT_Vector2i> GU_GroomUtils::openCurvePointWeights ( int  n,
fpreal  u 
)
inlinestatic

Definition at line 156 of file GU_GroomUtils.h.

static float GU_GroomUtils::openCurveUnitToReal ( int  n,
float  u_unit 
)
inlinestatic

Definition at line 145 of file GU_GroomUtils.h.

static SYS_FORCE_INLINE GA_Offset GU_GroomUtils::primPointOffset ( const GU_Detail gdp,
GA_Offset  primoff,
GA_Size  index = 0 
)
inlinestatic

Definition at line 426 of file GU_GroomUtils.h.

static SYS_FORCE_INLINE GA_Offset GU_GroomUtils::primVertexOffset ( const GU_Detail gdp,
GA_Offset  primoff,
GA_Size  index = 0 
)
inlinestatic

Definition at line 419 of file GU_GroomUtils.h.

static void GU_GroomUtils::removeHiddenPrimitivesFromGroup ( GA_PrimitiveGroup guidegroup,
GU_Detail gdp 
)
static
static void GU_GroomUtils::removeNonGuidesFromGroup ( GA_PrimitiveGroup guidegroup,
GU_Detail gdp 
)
static
static void GU_GroomUtils::scaleCurve ( GU_Detail gdp,
const GA_RWHandleV3 Pattrib,
GA_Offset  primoff,
GA_OffsetListRef curvevertoffs,
float  factor 
)
static
static void GU_GroomUtils::setCurveLength ( GU_Detail gdp,
const GA_RWHandleV3 Pattrib,
GA_Offset  primoff,
fpreal  prevlength,
fpreal  newlength,
GA_OffsetListRef curvevertoffs,
UT_FloatArray tempu,
UT_Vector3Array temppos 
)
static
static void GU_GroomUtils::setCurveLength ( UT_Vector3Array positions,
fpreal  prevlength,
fpreal  newlength,
UT_FloatArray tempu,
UT_Vector3Array temppos 
)
static
static void GU_GroomUtils::setGuideGroupMembers ( GA_PrimitiveGroup guidegroup,
const GA_ElementGroup ingroup,
const GA_ElementGroup inmirrorgroup,
const GA_PrimitiveGroup templategroup,
GU_Detail gdp 
)
static
static void GU_GroomUtils::setPagesConstant ( GA_RWHandleF  attribhandle,
float  value 
)
inlinestatic

Definition at line 432 of file GU_GroomUtils.h.

static void GU_GroomUtils::setPrimPointPositions ( UT_Vector3Array positions,
GA_Offset  primoff,
const GU_Detail gdp,
const GA_RWHandleV3 pos_handle 
)
static
static UT_Vector3 GU_GroomUtils::slideFrame ( const UT_Vector3  x0,
const UT_Vector3  t0,
const UT_Vector3  n0,
const UT_Vector3  x1,
const UT_Vector3  t1 
)
static
static float GU_GroomUtils::unitLengthToUnitDomain ( const UT_Vector3Array pos,
float  perimeter,
const UT_FloatArray edgelengths,
float  ulength 
)
static
static float GU_GroomUtils::unitLengthToUnitDomain ( fpreal  perimeter,
const UT_FloatArray edgelengths,
float  ulength 
)
static
static float GU_GroomUtils::unitToUnitLengthDomain ( float  perimeter,
const UT_FloatArray edgelengths,
float  uparm 
)
static

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