Grid(3U)
β¨ Grid(3U) β¨
okay so bestie, welcome to the InterViews Reference Manual π this is the Grid page and honestly? she's lowkey doing the most and we love her for it π
πΈ NAME πΈ
Grid β displays a grid in a viewer and constrains points to lie on it
π¦ SYNOPSIS π¦
#include <Unidraw/grid.h>
β¨ DESCRIPTION β¨
so the Grid object is out here doing two whole jobs at once, main character energy fr fr:
- it displays a grid in a viewer π
- and it can constrain points to lie on the grid π―
the base class draws the grid as a simple array of dots β¨ but subclasses are absolutely free to draw arbitrarily complex grids β go off, customize your little heart out π
π PUBLIC OPERATIONS π
Grid(float w, float h, float xincr, float yincr)β the constructor parameters are, in order: a width, a height, and independent units of graduation for the horizontal and vertical axes, and literally all of them are in pixels. theGridbase class uses a special-purpose graphic to render itself, one that draws an array of dots based on the info you hand over in this constructor π«Άvirtual Graphic* GetGraphic()β returns the graphic that's used to render the grid πΌοΈvirtual void Constrain(Coord&, Coord&)β constrains the given coordinate pair to fall on the grid. by default, the pair gets changed to fall on the nearest grid point πvirtual void Visiblity(boolean)β makes the grid visible (passtrue) or invisible (passfalse) π (yes, that's really how it's spelled, we don't make the rules π)virtual boolean IsVisible()β returns whether the grid is visible or not πvirtual void SetSpacing(float xincr, float yincr)β resets the grid's units of graduation π
π§ PROTECTED OPERATIONS π§
Grid(Graphic*)β this protected constructor lets subclasses specify an arbitrary graphic for rendering the grid π
β οΈ heads up bestie: subclasses that use this constructor must also redefine the Constrain operation. no skipping, periodt π
π SEE ALSO π
Graphic(3U), Viewer(3U)
and that's the whole vibe β¨ this page came straight out of the Unidraw corner of the world, dated 30 July 1990, and it's literally titled Grid(3U) β iconic, no cap ππ¦π
π¦ where this page comes from
- debian bookworm: ivtools-dev 2.0.11d.a1-1+b4
- debian trixie: ivtools-dev 2.0.11d.a1-3+b4
- ubuntu jammy: ivtools-dev 2.0.11d.a1-1build1
- ubuntu noble: ivtools-dev 2.0.11d.a1-3build1
- ubuntu questing: ivtools-dev 2.0.11d.a1-3build7
- ubuntu resolute: ivtools-dev 2.0.11d.a1-3build9
- ubuntu stonking: ivtools-dev 2.1.1+git.2025.07.26.a1-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms