PEG 1018: ViewTool

Author: Asko Soukka
Author: Benja Fallenstein
Revision: 1.9
Status: Incomplete

This PEG is about creating a ViewTool. The ViewTool would offer easy-to-use interface for prototyping new views - and lowering the treshold of starting development of new view.


Yes, I (humppake) believe that the view interface in GZZ 0.8 is much more flexible than the on in 0.6. Although, I worked on 0.8 for weeks, and I still had problems with our coordinate system biased approach for drawing. It's good, but feels too abstract at first sight, since you are used handle only one coordinate system at time.

I think there should be easy-to-use interface for prototyping new views. Something with you can start directly by putting some vobs into the space and see the results without needing to think about optimal view spesific coordinate systems first.

Current View package

gzz.client Gzz_Frontend_Vobs.gen.html gzz.view gzz.view.ViewContext gzz.view.View gzz.view.CellView PEG_1018.gen.html#viewclasses ../../Gzz_Frontend_View.gen.html#viewclasses viewclasses

Current VanishingClient

In view gzz.view.VobVanishingClient has been done a lot of work for abstracting some of the general things that view must do - and thus, made them easier to do.

/** An interface abstracting some things away from the vanishing view.
public interface VanishingClient {
    final int CENTER = 1;

    Object getVobSize(Cell c, float fract, int flags, Dimension into);
    void place(Cell c, Object o, float fract, int x0, int y0, int x1, int y1,
                int depth, float rot);

    /** There should be a connection between the given cells.
     * If one of the cells hasn't yet been placed, this means that 
     * a stub in that direction should be drawn.
    void connect(Cell c1, Cell c2, int dx, int dy);

gzz.view.View gzz.view.BFRaster gzz.view.PlainVanishing gzz.view.VobVanishingClient gzz.view.VanishingClient PEG_1018.gen.html#vanishingview vanishingview

Describing shortly (this will be replaced with sequence diagram): VobVanishingClient implements both the View and VanishingClient interface. When its render() is called, it will call PlainVanishing, where the views placing logic is handled. PlainVanishing will then use VanishingClient's abstracted interface for placing cells.



This is currently in its very beginning.

gzz.view.View PEG_1018.gen.html#umltool umltool

Finally basic views should rewrite using ViewTool.