| 1 |
NAME SoAntiSquish SoAntiSquish SO_ANTI_SQUISH_ { transformation node that undoes non-uniform 3D scales } |
| 2 |
|
| 3 |
INCLUDE nodes/SoAntiSquish.h |
| 4 |
|
| 5 |
DESC { |
| 6 |
This node removes nonuniform 3D scaling from the current transformation matrix |
| 7 |
when traversed by an action. It is used by draggers such as the |
| 8 |
\cSoTrackballDragger\. that need to stay uniformly scaled no matter where |
| 9 |
they are located in the scene graph. |
| 10 |
\p |
| 11 |
The magnitude of the new scale is determined |
| 12 |
by the current transformation matrix and the \asizing\. field. |
| 13 |
This node does not change the translation or rotation in the matrix. |
| 14 |
} |
| 15 |
|
| 16 |
ENUM Sizing { |
| 17 |
X "fits the other two axes to match the X axis, whose size is unchanged", |
| 18 |
Y "fits the other two axes to match the Y axis, whose size is unchanged", |
| 19 |
Z "fits the other two axes to match the Z axis, whose size is unchanged", |
| 20 |
AVERAGE_DIMENSION "uses average of 3 scales in the matrix", |
| 21 |
BIGGEST_DIMENSION "uses biggest of 3 scales in the matrix", |
| 22 |
SMALLEST_DIMENSION "uses smallest of 3 scales in the matrix", |
| 23 |
LONGEST_DIAGONAL "accounts for shearing; transforms a cube by the |
| 24 |
matrix and then uses length of longest diagonal" |
| 25 |
} |
| 26 |
|
| 27 |
FIELD sizing { |
| 28 |
Determines which of the algorithms enumerated by the type \cSizing\. |
| 29 |
will be used to select the new scale when the x,y, and z scales are |
| 30 |
not equal. |
| 31 |
} |
| 32 |
|
| 33 |
|
| 34 |
FIELD recalcAlways { |
| 35 |
If recalcAlways is \kTRUE\., this node calculates its unsquishing matrix every |
| 36 |
time it is traversed. If \kFALSE\., then this only occurs during the first |
| 37 |
traversal folllowing a call to recalc(). |
| 38 |
} |
| 39 |
|
| 40 |
METHOD "" SoAntiSquish() { |
| 41 |
Creates an anti-squish node with default settings. |
| 42 |
} |
| 43 |
|
| 44 |
METHOD "" static SoType getClassTypeId() { |
| 45 |
Returns type identifier for this class. |
| 46 |
} |
| 47 |
|
| 48 |
METHOD "" void recalc() { |
| 49 |
Sets a flag so that the next time the node is traversed, it will recalculate |
| 50 |
its unsquishing matrix. |
| 51 |
} |
| 52 |
|
| 53 |
ACTION SoGLRenderAction, SoCallbackAction, |
| 54 |
SoGetBoundingBoxAction, SoGetMatrixAction, SoRayPickAction { |
| 55 |
Appends the current transformation with a new matrix to create an unsquished |
| 56 |
result. |
| 57 |
} |
| 58 |
|
| 59 |
ALSO { |
| 60 |
SoCenterballDragger, SoJackDragger, SoTrackballDragger, SoTransformerDragger, |
| 61 |
SoTransformation, |
| 62 |
SoTransformBoxDragger } |