Class TransformationManagerImpl
- java.lang.Object
-
- org.scilab.forge.scirenderer.tranformations.TransformationManagerImpl
-
- All Implemented Interfaces:
TransformationManager
public class TransformationManagerImpl extends java.lang.Object implements TransformationManager
DefaultTransformationManager
implementation.- Author:
- Pierre Lando
-
-
Constructor Summary
Constructors Constructor Description TransformationManagerImpl(Canvas canvas)
Standard constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.Transformation
getInverseWindowTransformation()
Return the inverse of window transformation.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.
-
-
-
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 interfaceTransformationManager
- Parameters:
listener
- added.
-
removeListener
public void removeListener(TransformationManagerListener listener)
Description copied from interface:TransformationManager
Remove a listener.- Specified by:
removeListener
in interfaceTransformationManager
- Parameters:
listener
- removed.
-
getModelViewStack
public TransformationStack getModelViewStack()
Description copied from interface:TransformationManager
Return the model view matrix stack.- Specified by:
getModelViewStack
in interfaceTransformationManager
- Returns:
- the model view matrix stack.
-
getProjectionStack
public TransformationStack getProjectionStack()
Description copied from interface:TransformationManager
Return the projection matrix stack.- Specified by:
getProjectionStack
in interfaceTransformationManager
- Returns:
- the projection matrix stack.
-
getTransformation
public Transformation getTransformation()
Description copied from interface:TransformationManager
Return the top scene transformation.- Specified by:
getTransformation
in interfaceTransformationManager
- Returns:
- the top scene transformation.
-
getWindowTransformation
public Transformation getWindowTransformation()
Description copied from interface:TransformationManager
Return the window transformation.- Specified by:
getWindowTransformation
in interfaceTransformationManager
- Returns:
- the window transformation.
-
getInverseWindowTransformation
public Transformation getInverseWindowTransformation()
Description copied from interface:TransformationManager
Return the inverse of window transformation.- Specified by:
getInverseWindowTransformation
in interfaceTransformationManager
- Returns:
- the inverse window transformation.
-
getCanvasProjection
public Transformation getCanvasProjection()
Description copied from interface:TransformationManager
Return the canvas projection matrix.- Specified by:
getCanvasProjection
in interfaceTransformationManager
- 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 interfaceTransformationManager
- Returns:
- the canvas projection matrix.
-
getG2DSingleProjection
public Transformation getG2DSingleProjection()
Description copied from interface:TransformationManager
Return the projection matrix (no modelView).- Specified by:
getG2DSingleProjection
in interfaceTransformationManager
- Returns:
- the projection matrix.
-
getG2DWindowProjection
public Transformation getG2DWindowProjection()
Description copied from interface:TransformationManager
Return the window projection matrix for Graphics2D.- Specified by:
getG2DWindowProjection
in interfaceTransformationManager
- Returns:
- the window projection matrix.
-
reset
public void reset()
Description copied from interface:TransformationManager
Clear all stack.- Specified by:
reset
in interfaceTransformationManager
-
useWindowCoordinate
public void useWindowCoordinate()
Description copied from interface:TransformationManager
Switch to window coordinate.- Specified by:
useWindowCoordinate
in interfaceTransformationManager
-
useSceneCoordinate
public void useSceneCoordinate()
Description copied from interface:TransformationManager
Switch to scene coordinate.- Specified by:
useSceneCoordinate
in interfaceTransformationManager
-
isUsingSceneCoordinate
public boolean isUsingSceneCoordinate()
Description copied from interface:TransformationManager
Return true if is using scene coordinate.- Specified by:
isUsingSceneCoordinate
in interfaceTransformationManager
- Returns:
- true if is using scene coordinate.
-
fireTransformationChanged
protected void fireTransformationChanged()
Notify listeners the top transformation have changed.
-
-