PolygonComp(3U)

πŸ’– PolygonComp β€” the manual, but make it slay πŸ’–

okay bestie, pull up a chair, we're reading the InterViews Reference Manual page for PolygonComp(3U) and honestly? it's giving iconic polygon energy. this is <Unidraw/Components/polygon.h> territory, so hydrate and let's go 🌸


✨ NAME ✨

PolygonComp, PolygonView, PSPolygon β€” the polygon component subject, its view, and its PostScript external representation. three besties, one polygon, no cap πŸ¦‹


✨ SYNOPSIS ✨

#include <Unidraw/Components/polygon.h>

that's it. that's the include. one line, zero drama, absolutely ate πŸ’…


✨ DESCRIPTION ✨

so PolygonComp is a VerticesComp that defines a polygon β€” yes, literally, it's the polygon-defining one, main character behavior fr fr. it uses an SF_Polygon graphic to store its graphical attributes. meanwhile PolygonView is a VerticesView whose whole job is displaying the polygon. and PSPolygon is a PSVertices that externalizes the subject's information in PostScript form. a whole little trio of girlies working together 🌈


πŸ’œ POLYGONCOMP PUBLIC OPERATIONS πŸ’œ

  • PolygonComp(SF_Polygon* = nil) β€” the constructor, and it takes an optional stroked-filled polygon graphic that defines the attributes of the polygon. pass nothing (nil) if you want, she's flexible like that ✨
  • SF_Polygon* GetPolygon() β€” returns the Polygon graphic that defines the polygon's attributes. also lowkey a more specific form of the GetGraphic operation, iykyk πŸ’«

πŸŽ€ POLYGONVIEW PUBLIC OPERATIONS πŸŽ€

  • PolygonView(PolygonComp* = nil) β€” creates a PolygonView, optionally supplying the subject. optional subject, mandatory slay 🫢
  • virtual Manipulator* CreateManipulator(Viewer*, Event&, Transformer*, Tool*) β€” yeah bestie, that's the whole signature:
virtual Manipulator* CreateManipulator(
   Viewer*, Event&, Transformer*, Tool*
)
  • virtual void InterpretManipulator(Manipulator*) β€” okay so here's where it gets good. PolygonView redefines its response to manipulation with a GraphicCompTool. the user clicks the left mouse button to specify each vertex, and clicks with the middle mouse button to specify the final vertex πŸ–±οΈ vertex positioning will be constrained by gravity, if any β€” yes, gravity, we love a physics moment.

PolygonView also defines a response to the ReshapeTool, letting the user click on one of its vertices to reposition it. and here's the spicy part: the subject is actually replaced (via ReplaceCmd) with a new PolygonComp subject reflecting the repositioned vertex. repositioning will be influenced by gravity too. so basically gravity is running this whole operation and we're just living in it 😭

  • PolygonComp* GetPolygonComp() β€” returns the subject. simple, clean, iconic πŸ‘‘

⭐ PSPOLYGON PUBLIC OPERATIONS ⭐

  • PSPolygon(PolygonComp* = nil) β€” constructs a PostScript external representation of the given subject, if any. subject optional, PostScript mandatory πŸ’…

🌟 PSPOLYGON PROTECTED OPERATIONS 🌟

  • virtual const char* Name() β€” PSPolygon identifies itself as "Poly" in the PostScript output. short name, big personality πŸ’–

🌈 SEE ALSO 🌈

Event(3I), GraphicComp(3U), GraphicCompTool(3U), GraphicView(3U), Grid(3U), PatternCmd(3U), PostScriptView(3U), ReshapeTool(3U), Rubband(3I), Transformer(3I), VerticesComp(3U), Viewer(3U), align(3U), edit(3U), polygons(3U)

go read those too, bestie, they're all part of the friend group 🧚


reminder: this whole page is from Unidraw, dated 23 January 1991, and the page itself is PolygonComp(3U). yes, 1991. vintage. retro. still slaying. periodt πŸ’€βœ¨

k bye, go draw some polygons πŸ“πŸ’œ