org.scilab.forge.scirenderer.tranformations
Class TransformationManagerImpl

java.lang.Object
  extended by org.scilab.forge.scirenderer.tranformations.TransformationManagerImpl
All Implemented Interfaces:
TransformationManager

public class TransformationManagerImpl
extends java.lang.Object
implements TransformationManager

Default TransformationManager implementation.

Author:
Pierre Lando

Constructor Summary
TransformationManagerImpl(Canvas canvas)
          Standard constructor.
 
Method Summary
 void addListener(TransformationManagerListener listener)
          Add a listener.
protected  void fireTransformationChanged()
          Notify listeners the top transformation have changed.
 Transformation getCanvasProjection()
          Return the canvas projection matrix.
 Transformation getG2DProjection()
          Return the canvas projection matrix for Graphics2D.
 Transformation getG2DSingleProjection()
          Return the projection matrix (no modelView).
 Transformation getG2DWindowProjection()
          Return the window projection matrix for Graphics2D.
 TransformationStack getModelViewStack()
          Return the model view matrix stack.
 TransformationStack getProjectionStack()
          Return the projection matrix stack.
 Transformation getTransformation()
          Return the top scene transformation.
 Transformation getWindowTransformation()
          Return the window transformation.
 boolean isUsingSceneCoordinate()
          Return true if is using scene coordinate.
 void removeListener(TransformationManagerListener listener)
          Remove a listener.
 void reset()
          Clear all stack.
 void useSceneCoordinate()
          Switch to scene coordinate.
 void useWindowCoordinate()
          Switch to window coordinate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransformationManagerImpl

public TransformationManagerImpl(Canvas canvas)
Standard constructor.

Parameters:
canvas - the canvas.
Method Detail

addListener

public void addListener(TransformationManagerListener listener)
Description copied from interface: TransformationManager
Add a listener.

Specified by:
addListener in interface TransformationManager
Parameters:
listener - added.

removeListener

public void removeListener(TransformationManagerListener listener)
Description copied from interface: TransformationManager
Remove a listener.

Specified by:
removeListener in interface TransformationManager
Parameters:
listener - removed.

getModelViewStack

public TransformationStack getModelViewStack()
Description copied from interface: TransformationManager
Return the model view matrix stack.

Specified by:
getModelViewStack in interface TransformationManager
Returns:
the model view matrix stack.

getProjectionStack

public TransformationStack getProjectionStack()
Description copied from interface: TransformationManager
Return the projection matrix stack.

Specified by:
getProjectionStack in interface TransformationManager
Returns:
the projection matrix stack.

getTransformation

public Transformation getTransformation()
Description copied from interface: TransformationManager
Return the top scene transformation.

Specified by:
getTransformation in interface TransformationManager
Returns:
the top scene transformation.

getWindowTransformation

public Transformation getWindowTransformation()
Description copied from interface: TransformationManager
Return the window transformation.

Specified by:
getWindowTransformation in interface TransformationManager
Returns:
the window transformation.

getCanvasProjection

public Transformation getCanvasProjection()
Description copied from interface: TransformationManager
Return the canvas projection matrix.

Specified by:
getCanvasProjection in interface TransformationManager
Returns:
the canvas projection matrix.

getG2DProjection

public Transformation getG2DProjection()
Description copied from interface: TransformationManager
Return the canvas projection matrix for Graphics2D.

Specified by:
getG2DProjection in interface TransformationManager
Returns:
the canvas projection matrix.

getG2DSingleProjection

public Transformation getG2DSingleProjection()
Description copied from interface: TransformationManager
Return the projection matrix (no modelView).

Specified by:
getG2DSingleProjection in interface TransformationManager
Returns:
the projection matrix.

getG2DWindowProjection

public Transformation getG2DWindowProjection()
Description copied from interface: TransformationManager
Return the window projection matrix for Graphics2D.

Specified by:
getG2DWindowProjection in interface TransformationManager
Returns:
the window projection matrix.

reset

public void reset()
Description copied from interface: TransformationManager
Clear all stack.

Specified by:
reset in interface TransformationManager

useWindowCoordinate

public void useWindowCoordinate()
Description copied from interface: TransformationManager
Switch to window coordinate.

Specified by:
useWindowCoordinate in interface TransformationManager

useSceneCoordinate

public void useSceneCoordinate()
Description copied from interface: TransformationManager
Switch to scene coordinate.

Specified by:
useSceneCoordinate in interface TransformationManager

isUsingSceneCoordinate

public boolean isUsingSceneCoordinate()
Description copied from interface: TransformationManager
Return true if is using scene coordinate.

Specified by:
isUsingSceneCoordinate in interface TransformationManager
Returns:
true if is using scene coordinate.

fireTransformationChanged

protected void fireTransformationChanged()
Notify listeners the top transformation have changed.