Class ProjectionSimpleStretch

java.lang.Object
  extended by ProjectionSimpleStretch
All Implemented Interfaces:
IProjection

public class ProjectionSimpleStretch
extends java.lang.Object
implements IProjection

stretches sim coordinates to screen coordinates

Since:
1.0

Constructor Summary
ProjectionSimpleStretch(int nWidth, int nHeight, IEnvironment env)
          ensures that the environment env gets displayed on a panel of nWidth by nHeight
 
Method Summary
 int getScreenComp(int i, double[] arrLfState, int nIdxOff)
          Finds the ith component in screen coordinates of a vector indicated by the portion of the array arrLfState starting at nIdxOff;
 int height()
           
 int left()
           
 void resize(int nNewWidth, int nNewHeight)
           
 void scaleProjection(int nNewX, int nNewY)
           
 int scaleRadius(double lfRad)
          Simple scale function for 2d circles etc.
 int[] scaleVector(double[] arrLfVec, int nIdxOff)
          Scales (possibly including rotation and flip) a vector, without applying global translation
 void set(int nWidth, int nHeight, IBoundary bound)
          ensures that the boundary bound gets displayed on a panel of nWidth by nHeight
 int top()
           
 int width()
           
 void xlateProjection(int nXOff, int nYOff)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProjectionSimpleStretch

public ProjectionSimpleStretch(int nWidth,
                               int nHeight,
                               IEnvironment env)
ensures that the environment env gets displayed on a panel of nWidth by nHeight

Method Detail

resize

public void resize(int nNewWidth,
                   int nNewHeight)
Specified by:
resize in interface IProjection

set

public void set(int nWidth,
                int nHeight,
                IBoundary bound)
ensures that the boundary bound gets displayed on a panel of nWidth by nHeight


getScreenComp

public int getScreenComp(int i,
                         double[] arrLfState,
                         int nIdxOff)
Finds the ith component in screen coordinates of a vector indicated by the portion of the array arrLfState starting at nIdxOff;

Specified by:
getScreenComp in interface IProjection
Parameters:
i - which component of screen coordinates to get (0=x, 1=y)
arrLfState - global state vector in sim coordinates
nIdxOff - offset index in arrLfState of the coord we're looking for
Returns:
ith component in screen coordinates

scaleVector

public int[] scaleVector(double[] arrLfVec,
                         int nIdxOff)
Scales (possibly including rotation and flip) a vector, without applying global translation

Specified by:
scaleVector in interface IProjection
Parameters:
arrLfVec - array containing vector to scale (transform)
nIdxOff - offset of begining of vector to scale in arrLfVec
Returns:
integer array containing scaled vector discretized to pixel differences.

width

public int width()
Specified by:
width in interface IProjection

height

public int height()
Specified by:
height in interface IProjection

top

public int top()
Specified by:
top in interface IProjection

left

public int left()
Specified by:
left in interface IProjection

scaleRadius

public int scaleRadius(double lfRad)
                throws java.lang.Exception
Simple scale function for 2d circles etc.

Specified by:
scaleRadius in interface IProjection
Throws:
java.lang.Exception

scaleProjection

public void scaleProjection(int nNewX,
                            int nNewY)
Specified by:
scaleProjection in interface IProjection

xlateProjection

public void xlateProjection(int nXOff,
                            int nYOff)
Specified by:
xlateProjection in interface IProjection