Manipulator(3U)

✨ Manipulator(3U) ✨

okay bestie, this is a page from the InterViews Reference Manual and it's about Manipulator, which is literally the blueprint for all the direct-manipulation girlies out there πŸ’…


🌸 NAME 🌸

Manipulator β€” the base class for defining direct-manipulation semantics. it's giving "foundation of the whole vibe" fr fr πŸ‘‘


πŸŽ€ SYNOPSIS πŸŽ€

#include <Unidraw/manip.h>

πŸ¦‹ DESCRIPTION πŸ¦‹

so basically, tools use manipulator objects to wrap up all the mechanics of direct manipulation. manipulators take your user input events and turn them into an animation sequence that characterizes the manipulation. like, they're the ones running the whole show ✨

and here's the iconic part: a manipulator breaks the manipulation down into three phases:

  • the grasping phase β€” happens at the very start of the manipulation, and it lets the manipulator initialize the state it's gonna need in the later phases. setup era 🫢
  • the manipulating phase β€” this is the main character moment, where the manipulator accepts input events and generates graphical output that characterizes successive frames of the animation πŸ’ƒ
  • finally, the effect phase β€” happens at the end of the manipulation and lets the manipulator finalize its state. closing the loop, no cap 🌈

and heads up: Manipulator is an abstract base class. different subclasses support different manipulation semantics β€” so this one's just the template, not the whole meal πŸ“


πŸ‘‘ MANIPULATOR PUBLIC OPERATIONS πŸ‘‘

  • virtual void Grasp(Event&) Grasp gets called exactly once, right at the beginning of direct manipulation, so the manipulator can initialize its internal state based on the initiating event. one shot, one opportunity 😀
  • virtual boolean Manipulating(Event&) Manipulating gets called over and over during the manipulation, every time a new event shows up, until it returns false. each call to Manipulating should produce a new frame of the animation that characterizes the manipulation. it's literally the frame-by-frame slay ✨
  • virtual void Effect(Event&) Effect gets called once at the end of direct manipulation, letting the manipulator finalize its internal state based on the last event supplied to the Manipulating operation. wrap it up, periodt πŸ’–
  • virtual void SetViewer(Viewer*)
  • virtual Viewer* GetViewer()
  • virtual void SetTool(Tool*)
  • virtual Tool* GetTool() these get and set the viewer β€” the one the manipulator generates graphical output in β€” and the tool that created the manipulator. and ngl, by default these operations do nothing. subclasses that actually need this info have to redefine these operations to assign and retrieve the state they require. so if you want it, you gotta build it πŸ› οΈ

🧚 MANIPULATOR PROTECTED OPERATIONS 🧚

  • Manipulator() the constructor is protected, which disallows instantiation of abstract base class objects. it's exclusive, it's VIP-only, it's not for just anyone πŸ’…

πŸ’œ SEE ALSO πŸ’œ

Event(3I), Tool(3U), Viewer(3U)


and that's the whole page bestie, you ate it up fr fr πŸŽ€ this one comes to you from Unidraw, dated 1 August 1990 β€” old but iconic, iykyk πŸ’–βœ¨