Vertices(3U)

✨ Vertices β€” the manual page (3U) ✨

okay bestie, welcome to the InterViews Reference Manual πŸ’– this one's about Vertices, and it lives in section 3U. let's get into it, no cap.


🌸 NAME 🌸

Vertices β€” the abstract base class for graphics defined by a set of coordinate pairs. yeah. the blueprint-y one. the mother of polygons and splines. main character energy fr. πŸ‘‘


✨ SYNOPSIS ✨

#include <Unidraw/Graphic/verts.h>

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so Vertices is an abstract base class for graphics whose whole geometry is specified by a set of coordinate pairs β€” think polygons, think splines, think all the shape girlies whose vibe is "here is a list of points, do with that what you will." πŸŽ€

the Vertices class handles the vertex-related operations that all of those graphical objects have in common, and it also supports extent caching. lowkey efficient of it. πŸ’…


πŸ’– PUBLIC OPERATIONS πŸ’–

  • virtual ~Vertices() β€” the destructor. it deallocates the list of coordinate pairs that's stored up in the graphic. bye bye points, thanks for everything 🫢
  • virtual int GetOriginal(const Coord*& x, const Coord*& y) β€” hands you back pointers to the arrays of Coords stored internally that define the graphic's vertices. and GetOriginal's return value tells you the size of the arrays, so you're not out here guessing. iconic behaviour honestly. ⭐
  • virtual boolean operator == (Vertices&)
  • virtual boolean operator != (Vertices&)

these two compare this to the given Vertices instance and tell you whether they (do not) store identical sets of vertices. like a vibe check but for coordinate arrays. 🌈


πŸ”₯ PROTECTED OPERATIONS πŸ”₯

  • Vertices(Graphic* = nil)
  • Vertices(Coord* x, Coord* y, int count, Graphic* = nil)

so these constructors are protected on purpose β€” it's to disallow instantiation of the abstract class, bestie. you cannot just make a raw Vertices, that's not the move. πŸ’€

subclasses can pass in a set of vertices to copy into internal storage, plus an optional graphic to grab an initial set of graphics state from. and important: Vertices itself stores no additional graphics state beyond what's already in the Graphic base class. it's minimalist like that. πŸŽ€

  • void s_getExtent(float&, float&, float&, float&, float&, Graphic*)
  • void f_getExtent(float&, float&, float&, float&, float&, Graphic*)

these are helper functions that return extent info based on the bounding box that the vertices define. πŸ¦‹

  • s_getExtent returns an extent that accounts for the width of a brush β€” which is what you'd need if the vertices defined a stroked path.
  • f_getExtent assumes the vertices define the graphic's extremities β€” which is the case if the vertices defined a filled path.

and the way that these operations cache the extent they compute initially?? obsessed. they do the math once and then just… remember it. πŸ’…βœ¨


🌟 SEE ALSO 🌟

  • Graphic(3U)

and that's the whole page, bestie!! 🫢 this came out of the Unidraw era, dated 2 February 1991, and it's still filed under Vertices(3U) β€” go forth and draw your little point-lists. periodt. πŸ’–πŸŽ€πŸ¦‹