ScaleTool(3U)

πŸ’… ScaleTool(3U) πŸ’…

okay bestie, welcome to ScaleTool β€” straight out of the InterViews Reference Manual, section 3U. this one's a little tool that lives in the Unidraw universe and it's literally here to let you rotate components. no cap.


✨ SYNOPSIS ✨

#include <Unidraw/Tools/scale.h>

πŸ¦‹ DESCRIPTION πŸ¦‹

ScaleTool lets the user rotate components by direct manipulation. that's it, that's the whole vibe β€” you grab stuff, you rotate stuff, it's giving hands-on. πŸŽ€


πŸ‘‘ PUBLIC OPERATIONS πŸ‘‘

  • ScaleTool(ControlInfo* = nil) β€” creates a brand new ScaleTool. fresh out the box, default argument and all. ✨
  • virtual Manipulator* CreateManipulator(Viewer*, Event&, Transformer*)
  • virtual void InterpretManipulator(Manipulator*) β€” okay so here's the tea, and CreateManipulator is the one doing all of it:
    • it first detects whether the user clicked on a component. πŸ”
    • if not, it clears the editor's selection and returns a nil manipulator. bye bye selection, nothing happened, moving on. πŸ’€
    • if a component was hit, and that component was not previously selected, then CreateManipulator clears the editor's selection, selects the component the user hit, and delegates manipulator creation and interpretation to it. like, full handoff, the component takes it from here. 🫢
    • if the component was the only selected component, it again delegates manipulator creation and interpretation to the component β€” but this time the selection is unaltered. nothing changes, we respect the existing selection, periodt. πŸ‘‘
    • if the user clicks on one of many selected components, then CreateManipulator will delegate manipulator creation and interpretation to the hit component without altering the selection. so the selection stays exactly as it was β€” the whole group keeps its vibe check intact. 🌈
bestie note: every path either bails with a nil manipulator or hands things off to the hit component. the delegation is the main character here, fr fr. πŸ’–

🌸 SEE ALSO 🌸

  • Tool(3U)

mwah β€” this page came to you from the Unidraw era, dated 24 January 1991, and yeah it's still ScaleTool(3U) at the top and bottom, iconic behavior honestly. go rotate something, you got this πŸ¦‹βœ¨πŸŽ€