org.micropsi.comp.console.worldconsole
Interface IOverlayRenderer

All Known Implementing Classes:
CoordinateGridRenderer

public interface IOverlayRenderer


Method Summary
 void dispose()
          Tells the renderer to release all requested resources.
 void init(LocalWorld world, EditSession editSession, IOverlayChangeNotifier changeNotifier, IRenderInfo renderInfo)
          Callback to initialise and tell the IOverlayRenderer the world modell / edit session to be used for the resulting image.
 void paintOverlay(GC gc, int offsetX, int offsetY, IRenderInfo renderInfo)
          Should paint an area of the overlay starting at (offsetX, offsetY) of the size (gc.getClipping().width, .height) in screen coodinates on the given GC, starting at (0, 0).
 void setEnabled(boolean enabled)
          Callback function to tell the overlay renderer whether it is enabled or not.
 void setScale(double scaleX, double scaleY)
          Callback function called when the resolution (pixel per world coordinate) changes.
 

Method Detail

init

public void init(LocalWorld world,
                 EditSession editSession,
                 IOverlayChangeNotifier changeNotifier,
                 IRenderInfo renderInfo)
Callback to initialise and tell the IOverlayRenderer the world modell / edit session to be used for the resulting image.

Parameters:
world - - access to the world model of the main renderer
editSession - - access to the edit session of the main renderer. May be null it it does not use an edit session.
changeNotifier - - can be used to request redrawing of areas of the render target
renderInfo - - coordinate transformation

paintOverlay

public void paintOverlay(GC gc,
                         int offsetX,
                         int offsetY,
                         IRenderInfo renderInfo)
Should paint an area of the overlay starting at (offsetX, offsetY) of the size (gc.getClipping().width, .height) in screen coodinates on the given GC, starting at (0, 0). (Clipping will be done automatically if necessary.)

Parameters:
gc - - GC to paint to
offsetX - - upper left corner of the overlay area
offsetY - - upper left corner of the overlay area
renderInfo - - class for coordinate transformation

setScale

public void setScale(double scaleX,
                     double scaleY)
Callback function called when the resolution (pixel per world coordinate) changes. If you cache resolution-dependant information, it should be recalculated now.

Parameters:
scaleX - - x pixel per world coordinate
scaleY - - y pixel per world coordinate

setEnabled

public void setEnabled(boolean enabled)
Callback function to tell the overlay renderer whether it is enabled or not. A disabled overlay renderer should never request redrawing.

Parameters:
enabled - - the new state

dispose

public void dispose()
Tells the renderer to release all requested resources.


(c) by Micropsi Project: http://www.cognitive-agents.org

.