HDK
|
Transformation order of scales, rotates, and translates. More...
#include <UT_XformOrder.h>
Public Types | |
enum | xform { T =0, S =1, RX =2, RY =3, RZ =4 } |
enum | rstOrder { TRS, TSR, RTS, RST, STR, SRT } |
enum | xyzOrder { XYZ, XZY, YXZ, YZX, ZXY, ZYX } |
Static Public Member Functions | |
static void | getRotOrderMapping (xyzOrder src, xyzOrder dst, int map[3]) |
Friends | |
std::ostream & | operator<< (std::ostream &os, const UT_XformOrder &t) |
Transformation order of scales, rotates, and translates.
Definition at line 23 of file UT_XformOrder.h.
Enumerator | |
---|---|
TRS | |
TSR | |
RTS | |
RST | |
STR | |
SRT |
Definition at line 33 of file UT_XformOrder.h.
enum UT_XformOrder::xform |
Enumerator | |
---|---|
T | |
S | |
RX | |
RY | |
RZ |
Definition at line 28 of file UT_XformOrder.h.
Enumerator | |
---|---|
XYZ | |
XZY | |
YXZ | |
YZX | |
ZXY | |
ZYX |
Definition at line 34 of file UT_XformOrder.h.
|
inline |
Construct from one of the RST permutations and one of the rotation permutation
Definition at line 38 of file UT_XformOrder.h.
|
inline |
Full flexibility in constructing from specified component order. Avoid using this as you can specify orders here that lead to undefined behaviour for mainOrder() and rotOrder().
Definition at line 47 of file UT_XformOrder.h.
UT_XformOrder::UT_XformOrder | ( | const char * | rst, |
const char * | rot = "xyz" |
||
) |
Constructor that takes strings specifying the xform order. Any combination of lower and uppercase is acceptable ("TsR", "XZY", "rst"). We do NOT check the string lengths, but we do check for null pointers.
|
default |
|
inline |
Return the number of transforms we store, this bounds the indices used for operator() and operator[].
Definition at line 152 of file UT_XformOrder.h.
Compute a mapping from the source to destination rotation order by filling in the given 'map' array.
void UT_XformOrder::invert | ( | ) |
Reverse the order.
|
inline |
Returns true if order says scales are before rotates.
Definition at line 167 of file UT_XformOrder.h.
|
inline |
Query or set the main xform order or the rotation order respectively. These methods assume the rotates are bundled together, and search for the position of the first rotate they find. The methods that take strings accept lower and uppercase combinations, check to see whether the argument is zero, but don't check its length.
Definition at line 81 of file UT_XformOrder.h.
void UT_XformOrder::mainOrder | ( | UT_XformOrder::rstOrder | rst | ) |
Query or set the main xform order or the rotation order respectively. These methods assume the rotates are bundled together, and search for the position of the first rotate they find. The methods that take strings accept lower and uppercase combinations, check to see whether the argument is zero, but don't check its length.
bool UT_XformOrder::mainOrder | ( | const char * | rst | ) |
Query or set the main xform order or the rotation order respectively. These methods assume the rotates are bundled together, and search for the position of the first rotate they find. The methods that take strings accept lower and uppercase combinations, check to see whether the argument is zero, but don't check its length.
const char* UT_XformOrder::mainOrderLabel | ( | ) | const |
User-facing labels for transform/rotate orders
|
inline |
Definition at line 163 of file UT_XformOrder.h.
|
inline |
Two operator: operator() returns the index of a given transform without having to check any bounds; operator[] returns the i'th transform and checks if it's between valid bounds.
Definition at line 137 of file UT_XformOrder.h.
|
default |
|
inline |
Definition at line 154 of file UT_XformOrder.h.
|
inline |
Two operator: operator() returns the index of a given transform without having to check any bounds; operator[] returns the i'th transform and checks if it's between valid bounds.
Definition at line 141 of file UT_XformOrder.h.
void UT_XformOrder::reorder | ( | UT_XformOrder::xform | xf1, |
UT_XformOrder::xform | xf2, | ||
UT_XformOrder::xform | xf3, | ||
UT_XformOrder::xform | xf4, | ||
UT_XformOrder::xform | xf5 | ||
) |
Shuffle the order of the xforms. If all you'll ever do is traverse the xform order to build a transformation matrix, you can even have more xforms of the same type in the argument list; then, however, the behaviour of mainOrder() and rotOrder() will be undefined.
void UT_XformOrder::reorder | ( | UT_XformOrder::rstOrder | rst, |
UT_XformOrder::xyzOrder | rot | ||
) |
Shuffle the order of the xforms. If all you'll ever do is traverse the xform order to build a transformation matrix, you can even have more xforms of the same type in the argument list; then, however, the behaviour of mainOrder() and rotOrder() will be undefined.
|
inline |
Query or set the main xform order or the rotation order respectively. These methods assume the rotates are bundled together, and search for the position of the first rotate they find. The methods that take strings accept lower and uppercase combinations, check to see whether the argument is zero, but don't check its length.
Definition at line 99 of file UT_XformOrder.h.
void UT_XformOrder::rotOrder | ( | UT_XformOrder::xyzOrder | rot | ) |
Query or set the main xform order or the rotation order respectively. These methods assume the rotates are bundled together, and search for the position of the first rotate they find. The methods that take strings accept lower and uppercase combinations, check to see whether the argument is zero, but don't check its length.
bool UT_XformOrder::rotOrder | ( | const char * | rot | ) |
Query or set the main xform order or the rotation order respectively. These methods assume the rotates are bundled together, and search for the position of the first rotate they find. The methods that take strings accept lower and uppercase combinations, check to see whether the argument is zero, but don't check its length.
const char* UT_XformOrder::rotOrderLabel | ( | ) | const |
User-facing labels for transform/rotate orders
Save the xform order. We save the sequence of transforms in the order in which they appear in the permutation list.
|
inline |
Swap two xform components.
Definition at line 119 of file UT_XformOrder.h.
|
friend |
Definition at line 176 of file UT_XformOrder.h.