transforms(3U)

✨ transforms(3U) ✨

okay bestie, welcome to transforms from the InterViews Reference Manual πŸ’– this is the Unidraw page that serves you MoveCmd, RotateCmd and ScaleCmd β€” the three coordinate transformation commands. and no, before you ask, this is not the "transforms" of your glow-up era, it's the geometry kind. still iconic tho πŸŽ€


🌸 NAME 🌸

MoveCmd, RotateCmd, ScaleCmd β€” coordinate transformation commands πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <Unidraw/Commands/transforms.h>

✨ DESCRIPTION ✨

so the Unidraw library predefines three commands for doing coordinate transformations, and the vibe is that they're all purely interpretive β€” like, they're just out here defining the math, no cap 🧚

  • MoveCmd β€” defines a translation
  • RotateCmd β€” defines a rotation
  • ScaleCmd β€” defines a two-dimensional scaling

three little legends, one header file. periodt πŸ’œ


πŸ‘‘ MOVECMD PUBLIC OPERATIONS πŸ‘‘

MoveCmd(ControlInfo*, float dx = 0, float dy = 0)

MoveCmd(Editor* = nil, float = 0, float = 0)

construct a brand new MoveCmd 🫢 you're handing it the translation distances in the horizontal dimension (dx) and the vertical dimension (dy). defaults are both 0, so if you say nothing it moves... nowhere. which is honestly so relatable 😭

void GetMovement(float&, float&)

returns the translation distances you specified back in the constructor. it's giving "what did I just say" but make it a function ✨


πŸŽ€ ROTATECMD PUBLIC OPERATIONS πŸŽ€

RotateCmd(ControlInfo*, float = 0)

RotateCmd(Editor* = nil, float = 0)

construct a new RotateCmd 🌈 and you pass it the rotation angle in degrees. yes, degrees, not radians, we're not doing calculus at 2am bestie. default is 0, so no spin unless you ask for it πŸ’«

float GetRotation()

returns the rotation angle that you specified in the constructor. that's it, that's the whole function, and she ate πŸ”₯


πŸ’– SCALECMD PUBLIC OPERATIONS πŸ’–

ScaleCmd(ControlInfo*, float sx = 1, float sy = 1, Alignment = Center)

ScaleCmd(Editor* = nil, float = 1, float = 1, Alignment = Center)

construct a new ScaleCmd πŸ¦‹ you give it the scaling factors in the horizontal dimension (sx) and the vertical dimension (sy), plus an alignment β€” and the alignment is basically a suggestion of the point about which the component should be scaled. the defaults are 1 and 1 (aka no change, no thoughts, head empty) and Alignment = Center because obviously we scale from the center, main character energy only πŸ‘‘

void GetScaleing(float&, float&)

Alignment GetAlignment()

return the scaling factors and the alignment that you specified in the constructor. and yes, it really is spelled GetScaleing β€” that's the actual name in the source, we do not fix it, we do not touch it, we respect her journey πŸ™ˆ


🌟 SEE ALSO 🌟

  • Command(3U) β€” go read the parent class, it's the blueprint, iykyk πŸ’…

⚠️ reminder bestie: all of these are purely interpretive commands β€” they define the transformation, they don't go around executing chaos on their own. know the difference, it matters fr fr 🫢

okay that's the whole page!! this was the Unidraw edition, dated 24 January 1991, and it lives at transforms(3U) in the InterViews Reference Manual. mwah, slay, go transform something πŸ’‹βœ¨πŸŒΈ