RotateTool(3U)

πŸ’« RotateTool(3U) πŸ’«

okay bestie, this one lives in the InterViews Reference Manual and it's literally the little tool that spins your components around. no cap. it's called RotateTool and it's part of the Unidraw fam 🫢


✨ NAME ✨

RotateTool β€” a tool for rotating components πŸ’…


🌸 SYNOPSIS 🌸

#include <Unidraw/Tools/rotate.h>

πŸ¦‹ DESCRIPTION πŸ¦‹

RotateTool lets the user rotate components by direct manipulation. that's the whole vibe. you grab, you spin, you slay ✨


πŸ‘‘ PUBLIC OPERATIONS πŸ‘‘

  • RotateTool(ControlInfo* = nil) β€” create a brand new RotateTool. default arg is nil, so you can just make one and go 🌈
  • virtual Manipulator* CreateManipulator(Viewer*, Event&, Transformer*)
  • virtual void InterpretManipulator(Manipulator*) β€” here's the tea on how these two behave together, because the logic is lowkey specific and you need all of it:

CreateManipulator detects whether the user clicked on a component. so, like, the possibilities:

  1. not clicked on a component? it clears the editor's selection and returns a nil manipulator. bye πŸ‘‹
  2. clicked on a component that wasn't previously selected? then CreateManipulator clears the editor's selection, selects the component the user hit, and delegates manipulator creation and interpretation to it.
  3. the component hit was the only selected component? it again delegates manipulator creation and interpretation to the component β€” but this time the selection is unaltered. don't touch, it's fine πŸ’–
  4. the user clicks on one of many selected components? then CreateManipulator delegates manipulator creation and interpretation to the hit component without altering the selection. periodt.
ngl bestie, the whole game here is: hit detection, then delegate. the selection only changes in cases 1 and 2. memorize that and you're iconic 🧚

πŸ”₯ SEE ALSO πŸ”₯

  • Tool(3U)

and that's the whole page, fr fr πŸ’€ go forth and rotate responsibly πŸŽ€

Unidraw Β· 24 January 1991 β€” that's the source, the version, and the date, all wrapped up in a little bow for u πŸŒΈπŸ’œ