HairLibrary Class Reference

#include <lib_hair.h>

Public Member Functions

Int32 GetMode (BaseDocument *doc)
 
void SetMode (BaseDocument *doc, Int32 mode)
 
Bool GetHairGlobal (const BaseDocument *doc)
 
void SetHairGlobal (BaseDocument *doc, Bool enable)
 
Vector BlendColors (Int32 mode, const Vector &colA, const Vector &colB)
 
Vector MixST (Float s, Float t, const Vector &pa, const Vector &pb, const Vector &pc, const Vector &pd, Bool bQuad)
 
Float MixST (Float s, Float t, Float va, Float vb, Float vc, Float vd, Bool bQuad)
 
void GetPolyPointST (const Vector &p, Float &s, Float &t, const Vector &pa, const Vector &pb, const Vector &pc, const Vector &pd, Bool bQuad)
 
void * GetHook (BaseDocument *doc, Int32 type)
 
void * SetHook (BaseDocument *doc, Int32 type, void *fn)
 
BaseContainerGetPrefsInstance ()
 
Int32 GetHairVersion ()
 

Member Function Documentation

◆ GetMode()

Int32 GetMode ( BaseDocument doc)

Gets the hair mode.

Parameters
[in]docThe document.
Returns
The hair mode: HAIR_MODE

◆ SetMode()

void SetMode ( BaseDocument doc,
Int32  mode 
)

Sets the hair mode.

Parameters
[in]docThe document.
[in]modeThe new hair mode: HAIR_MODE

◆ GetHairGlobal()

Bool GetHairGlobal ( const BaseDocument doc)

Checks the hair global settings enable state.

Parameters
[in]docThe document.
Returns
The hair global enable state.

◆ SetHairGlobal()

void SetHairGlobal ( BaseDocument doc,
Bool  enable 
)

Sets the hair global settings enable state.

Parameters
[in]docThe document.
[in]enabletrue to enable the hair global settings, otherwise false.

◆ BlendColors()

Vector BlendColors ( Int32  mode,
const Vector colA,
const Vector colB 
)

Blend colors.

Parameters
[in]modeThe blend mode. See description/mhairmaterial.h for modes, e.g. HAIRMATERIAL_BLENDMODE_AVERAGE.
[in]colAThe first color.
[in]colBThe second color.
Returns
The resulting color.

◆ MixST() [1/2]

Vector MixST ( Float  s,
Float  t,
const Vector pa,
const Vector pb,
const Vector pc,
const Vector pd,
Bool  bQuad 
)

Mixes by the s and t coordinates among pa, pb, pc and pd.

Parameters
[in]sThe S coordinate.
[in]tThe T coordinate.
[in]paThe first point value.
[in]pbThe second point value.
[in]pcThe third point value.
[in]pdThe fourth point value.
[in]bQuadtrue means quadrangle, false means triangle.
Returns
The resulting vector.

◆ MixST() [2/2]

Float MixST ( Float  s,
Float  t,
Float  va,
Float  vb,
Float  vc,
Float  vd,
Bool  bQuad 
)

Mixes by the s and t coordinates among va, vb, vc and vd.

Parameters
[in]sThe S coordinate.
[in]tThe T coordinate.
[in]vaThe first value.
[in]vbThe second value.
[in]vcThe third value.
[in]vdThe fourth value.
[in]bQuadtrue means quadrangle, false means triangle.
Returns
The resulting value.

◆ GetPolyPointST()

void GetPolyPointST ( const Vector p,
Float s,
Float t,
const Vector pa,
const Vector pb,
const Vector pc,
const Vector pd,
Bool  bQuad 
)

Calculates the s and t coordinates of the point p in the polygon described by pa, pb, pc and pd.

Parameters
[in]pThe point to get the coordinates for.
[out]sAssigned the S coordinate.
[out]tAssigned the T coordinate.
[in]paThe first point value.
[in]pbThe second point value.
[in]pcThe third point value.
[in]pdThe fourth point value.
[in]bQuadtrue means quadrangle, false means triangle.

◆ GetHook()

void* GetHook ( BaseDocument doc,
Int32  type 
)

Retrieves a hair hook.

Parameters
[in]docThe document.
[in]typeThe hair hook type: HAIR_HOOK_TYPE
Returns
The retrieved hair hook.

◆ SetHook()

void* SetHook ( BaseDocument doc,
Int32  type,
void *  fn 
)

Sets a hair hook.

Parameters
[in]docThe document.
[in]typeThe hair hook type: HAIR_HOOK_TYPE
[in]fnThe new hair hook.
Returns
The old hair hook.

◆ GetPrefsInstance()

BaseContainer* GetPrefsInstance ( )

Retrieves the hair preferences container.

Returns
The hair preferences container. See Thairprefs.res.

◆ GetHairVersion()

Int32 GetHairVersion ( )

Gets the hair version number.

Returns
The hair version.