Katana Plug-in APIs 0.1
Static Public Member Functions

Foundry::Katana::FnXFormUtil Class Reference

#include <FnXFormUtil.h>

List of all members.

Static Public Member Functions

static std::pair
< FnAttribute::DoubleAttribute,
bool > 
CalcTransformMatrixAtTime (const FnAttribute::GroupAttribute &groupAttr, float time)
static std::pair
< FnAttribute::DoubleAttribute,
bool > 
CalcTransformMatrixAtTimes (const FnAttribute::GroupAttribute &groupAttr, const float *time, int numSamples)
static std::pair
< FnAttribute::DoubleAttribute,
bool > 
CalcTransformMatrixAtExistingTimes (const FnAttribute::GroupAttribute &groupAttr)
static FnAttribute::DoubleAttribute CreateBoundsAttr (double xMin, double xMax, double yMin, double yMax, double zMin, double zMax)
static FnAttribute::DoubleAttribute MergeBounds (const FnAttribute::DoubleAttribute &boundAttr1, const FnAttribute::DoubleAttribute &boundAttr2)
static FnAttribute::DoubleAttribute CalcTransformedBoundsAtExistingTimes (const FnAttribute::Attribute &xform, const FnAttribute::DoubleAttribute &boundAttr)
static FnAttribute::DoubleAttribute CollapseBoundsTimeSamples (const FnAttribute::DoubleAttribute &boundAttr)
static void InitXForm (FnAttribute::GroupBuilder &gb)

Detailed Description

Provides a number of matrix transform utilities.

Matrix ordering matches the IMath convention:

 FnAttribute::DoubleAttribute::array_type m = attr.getNearestSample(0.f);
 Imath::M44d(m[0],  m[1],  m[2],  m[3],
             m[4],  m[5],  m[6],  m[7],
             m[8],  m[9],  m[10], m[11],
             m[12], m[13], m[14], m[15]);

or,

 Imath::M44d( (double(*)[4]) m.data());

Member Function Documentation

static FnAttribute::DoubleAttribute Foundry::Katana::FnXFormUtil::CalcTransformedBoundsAtExistingTimes ( const FnAttribute::Attribute xform,
const FnAttribute::DoubleAttribute boundAttr 
) [static]

Calculates a new bounds attribute after baking in the specified coordinate system.

The input transform can either be specified as a 4 x 4 FnAttribute::DoubleAttribute (matrix) or as an unbaked FnAttribute::GroupAttribute xform hierarchy. All other types will result in failure an invalid FnAttribute instance being returned.

The computed bounds attribute will contain time samples at the union of existing samples in the incoming xform and bound attributes.

If a user requires a non-multisampled bound attribute, this call should be followed up with a call to CollapseBoundTimeSamples()

Parameters:
xformthe coordinate system
boundAttrthe bound attribute to transform
Returns:
the new transformed bound attribute.
static std::pair<FnAttribute::DoubleAttribute, bool> Foundry::Katana::FnXFormUtil::CalcTransformMatrixAtExistingTimes ( const FnAttribute::GroupAttribute groupAttr) [static]
Note:
This will do xform interpolation as needed
Parameters:
groupAttrFnAttribute::GroupAttribute containing the transform
Returns:
return (4x4 matrix attr, isAbsolute)
static std::pair<FnAttribute::DoubleAttribute, bool> Foundry::Katana::FnXFormUtil::CalcTransformMatrixAtTime ( const FnAttribute::GroupAttribute groupAttr,
float  time 
) [static]
Parameters:
groupAttrthe FnAttribute::GroupAttribute to calculate the transform from.
timethe sample time at which to calculate the transform.
Returns:
(4x4 matrix attr, isAbsolute)
static std::pair<FnAttribute::DoubleAttribute, bool> Foundry::Katana::FnXFormUtil::CalcTransformMatrixAtTimes ( const FnAttribute::GroupAttribute groupAttr,
const float *  time,
int  numSamples 
) [static]
Note:
This will do xform interpolation as needed
Parameters:
groupAttrFnAttribute::GroupAttribute containing the transform
timesample time to calculate the transform at.
numSamplesnumber of time samples in time argument.
Returns:
return (4x4 matrix attr, isAbsolute)
static FnAttribute::DoubleAttribute Foundry::Katana::FnXFormUtil::CollapseBoundsTimeSamples ( const FnAttribute::DoubleAttribute boundAttr) [static]

Creates a single sampled attribute with the merged union of the mutlisampled input attribute.

Parameters:
boundAttrMultisampled bound attribute
Returns:
Single sample merged union of the input bound attribute
static FnAttribute::DoubleAttribute Foundry::Katana::FnXFormUtil::CreateBoundsAttr ( double  xMin,
double  xMax,
double  yMin,
double  yMax,
double  zMin,
double  zMax 
) [static]

Creates a bounds attribute with the following properties:

  • Tuple Size: 2
  • Length: 6,
  • Values: [xMin, xMax, yMin, yMax, zMin, zMax]
Parameters:
xMinx min
xMaxx max
yMiny min
yMaxy max
zMinz max
zMaxz max
Returns:
an FnAttribute::DoubleAttribute instance.
static void Foundry::Katana::FnXFormUtil::InitXForm ( FnAttribute::GroupBuilder gb) [static]

This group of function accepting FnAttribute::GroupBuilder references are used to simplify the construction of xform attributes.

Note:
All children must be either instances of FnAttribute::DoubleAttributes or FnAttribute::GroupAttribute.

For the specified GroupBuilder, set group inherit to false (as all xforms should be) and then do a shallow update with the specified attribute, if provided.

Note that if one's command sequence utilizes only:

 Init(gb, ...)
 PushXXX(...)
 PushXXX(...)
 PushXXX(...)
 etc...

It's OK to construct the group builder with the GroupBuilder::BuilderModeStrict argument.

Parameters:
gbAn instance of FnAttribute::GroupBuilder
static FnAttribute::DoubleAttribute Foundry::Katana::FnXFormUtil::MergeBounds ( const FnAttribute::DoubleAttribute boundAttr1,
const FnAttribute::DoubleAttribute boundAttr2 
) [static]

Merge the two bounds attributes. If the boundsAttrs are multi-sampled, the output bounds will be up-sampled to the union of incoming sample times. Bounds data at sample-times not provided (but needed) will be synthesized using fillInterpSample()

Parameters:
boundAttr1first bounds attribute
boundAttr2second bounds attribute
Returns:
an instance of FnAttribute::DoubleAttribute containing the merged attributes.

The documentation for this class was generated from the following file:
 All Classes Functions Variables Typedefs Enumerations Enumerator