Generators are sub classes of
Main class – Generator should sub class this
Most code is directly in this class. Sub class are supposed to over
The Boxes class keeps a canvas object (self.ctx) that all
drawing is made on. In addition it keeps a couple of global settings
used for various drawing operations. See the
for the details.
For implementing a new generator forking an existing one or using the
boxes/generators/_template.py is probably easier than starting
Many methods and attributes are for use of the sub classes. These methods are the interface for the user interfaces to interact with the generators:
Initialize self. See help(type(self)) for accurate signature.
Parse command line parameters
args – (Default value = None) parameters, None for using sys.argv
Implement this method in your sub class.
You will typically need to call .parseArgs() before calling this one
Prepare for rendering
Create canvas and edge and other objects Call this before .render()
Flush canvas to disk and convert output to requested format if needed. Call after .render()
To handle the generators there is code in the
This adds generators to the user interfaces automatically. For this to work it is important that the class names are unique. So whenever you start a new generator please change the class name right away.