PEG 1021: Mouse clicks and VobScene

Author: Tuomas J. Lukka
Last-Modified:2002-11-14
Revision: 1.7
Status: Implemented

The VobScene API contains the method

public Object getKeyAt(float x, float y, float[] targetcoords) {
    return null;
}

as a remnant from past times, when vobs had coordinates.

Now, with coordinate system not always implying transformation to screen coordinates but transformations between arbitrary coordinate systems (e.g. as with PaperQuad), we need to redo this functionality somehow.

Issues

Changes

Into VobScene, add

public void activate(int cs)
public void activate(Object key)

These are automatically delegated (converting the key to a coordinate system through VobMatcher) to VobCooder's new method

public void activate(int cs);

Also, make VobScene.put(Vob, coords) automatically call one of these.

Then, redo getKeyAt() to return the key of the topmost activated coordsys at the given location, with topmost defined as above.

/** Get the topmost activated coordsys at (x,y), whose nearest activated
 * direct ancestor (not determining) is parent.
 */
public int getCSAt(int parent, float x, float y, float[] targetcoords) ;

public Object getKeyAt(int parent, float x, float y, float[] targetcoords) ;