If you are developing your own shape class then include attributes for
- the fill colour
- stroke colour
- stroke weight
- use fill or not
- use stroke or not
- visible / invisible
Personally I would also include attributes for
- shape coordinates or whatever you plan to use to define the shape (using local coordinates)
- shape position (using global coordinates)
and I would also include a display method for the class - the outline would be something like
- public void display(PApplet app){
- app.pushMatrix();
- app.pushStyle();
- // Use translate to position
- // set fill/stroke etc.
- // Draw the shape (if visible)
- app.popStyle();
- app.popMatrix();
- }
Then if you had a shape object called s then inside the draw() method you would draw it with
s.display(this);
It means that the class is totally in control of how the shape is drawn. Once the class is written and tested then you can concentrate on the actual program that uses them.