RectComp(3U)

πŸ’– RectComp(3U) πŸ’–

okay bestie, welcome to the InterViews Reference Manual β€” today's main character is the rectangle. Yes, that rectangle. Sit down, hydrate, we're doing this. ✨


🌸 NAME 🌸

RectComp, RectView, PSRect β€” the rectangle component subject, its view, and its PostScript external representation. Three icons, one page. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <Unidraw/Components/rect.h>

that's it. that's the whole synopsis. go off, include line. πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

so like, RectComp is a GraphicComp that defines a rectangle β€” no cap, that's literally its whole job description. It uses an SF_Rect graphic to store its graphical attributes, iykyk. πŸ“

Then we got RectView, which is a GraphicView for displaying the rectangle. She's the one doing the visual labor. ✨

And PSRect? She's a PostScriptView that externalizes the subject's information in PostScript form. Very "i speak fluent printer" of her. πŸ–¨οΈπŸ’œ


πŸ’– RECTCOMP PUBLIC OPERATIONS πŸ’–

  • RectComp(SF_Rect* = nil) β€” the constructor, and she takes an optional stroked-filled rectangle that defines the attributes of the rectangle. Optional! So you can just show up with nothing and she'll still hold it down. 🫢
  • SF_Rect* GetRect() β€” returns the SF_Rect graphic that defines the rectangle's attributes. And lowkey, GetRect is simply a more specific form of the GetGraphic operation. same energy, cuter name. ✨

🌈 RECTVIEW PUBLIC OPERATIONS 🌈

  • RectView(RectComp* = nil) β€” create a RectView, and you can optionally supply the subject if you're feeling generous. πŸ‘‘
  • virtual void Interpret(Command*) β€” RectView interprets AlignToGridCmd to align its lower-left to the grid. lower-left stays booked and busy on the grid, periodt. πŸ“
  • virtual Manipulator* CreateManipulator( Viewer*, Event&, Transformer*, Tool* ) β€” no extra tea to spill here, she just makes a manipulator. ✨
  • virtual void InterpretManipulator(Manipulator*) β€” okay this one is a lot, buckle up bestie. RectView redefines its response to manipulation with a GraphicCompTool. GraphicCompTool will let the user sweep out a rectangle that reflects the RectComp's size. Creation will be influenced by gravity, if any β€” yes, gravity, she's got pull. 🍎

RectView also defines a response to the ReshapeTool, allowing the user to click on one of its corners to reposition it. And plot twist: the subject is actually replaced (via ReplaceCmd) with a PolygonComp subject reflecting the repositioned corner. Repositioning will be influenced by gravity. not me gasping β€” the rectangle becomes a polygon?? character development fr fr. 😭

  • virtual void GetCorners(Coord*, Coord*) β€” GetCorners takes two arrays of four Coord values and stores into them the coordinates of its corners, in canvas coordinates. four corners, two arrays, zero ambiguity. πŸŽ€
  • RectComp* GetRectComp() β€” returns the subject. short king of a function. πŸ‘‘

🧚 RECTVIEW PROTECTED OPERATIONS 🧚

  • virtual void CreateHandles() β€” RectView redefines CreateHandles to use a RubberHandles object with four handles, one at each corner of the rectangle. four handles, four corners, symmetry slay. πŸ’…

⭐ PSRECT PUBLIC OPERATIONS ⭐

  • PSRect(RectComp* = nil) β€” construct a PostScript external representation of the given subject, if any. if any!! optional again, she's chill like that. πŸ¦‹

πŸ‘‘ SEE ALSO πŸ‘‘

  • GraphicComp(3U)
  • GraphicCompTool(3U)
  • GraphicView(3U)
  • Grid(3U)
  • PolygonComp(3U)
  • PostScriptView(3U)
  • ReshapeTool(3U)
  • align(3U)
  • edit(3U)
  • polygons(3U)

ngl the whole Unidraw saga is dated 22 January 1991 and this page is stamped RectComp(3U), so go read the whole family. the lore is deep, bestie. πŸ’–

that's the page!! go sweep out a rectangle, mind the gravity, and stan responsibly. mwah. πŸ’œβœ¨πŸŽ€