org.opensourcephysics.cabrillo.tracker
Class CalibrationStep

java.lang.Object
  extended by org.opensourcephysics.cabrillo.tracker.Step
      extended by org.opensourcephysics.cabrillo.tracker.CalibrationStep
All Implemented Interfaces:
java.lang.Cloneable

public class CalibrationStep
extends Step

This is a Step for a Calibration. It is used for setting the origin, angle and scale of an ImageCoordSystem.

Author:
Douglas Brown

Nested Class Summary
 class CalibrationStep.Position
           
 
Field Summary
 
Fields inherited from class org.opensourcephysics.cabrillo.tracker.Step
dataVisible, defaultIndex, footprint, format, hitRect, marks, n, points, screenPoints, selectionShape, track, transform
 
Constructor Summary
CalibrationStep(Calibration track, int n)
          Constructs a CalibrationStep using the existing world coordinates.
CalibrationStep(Calibration track, int n, double x, double y)
          Constructs a CalibrationStep with specified image coordinates.
 
Method Summary
 void addPosition(double x, double y)
          Adds a position point to this step at the specified image coordinates.
 java.lang.Object clone()
          Clones this Step.
 Interactive findInteractive(DrawingPanel panel, int xpix, int ypix)
          Implements findInteractive method.
 TPoint getDefaultPoint()
          Gets the default point.
protected  Mark getMark(TrackerPanel trackerPanel)
          Overrides Step getMark method.
 TPoint getPosition1()
          Gets position 1.
 TPoint getPosition2()
          Gets position 2.
 java.lang.String toString()
          Returns a String describing this step.
 
Methods inherited from class org.opensourcephysics.cabrillo.tracker.Step
draw, erase, erase, getBounds, getFrameNumber, getPoints, getTrack, remark, remark, repaint, repaint, setDefaultPointIndex, setFootprint, setHitRectCenter
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CalibrationStep

public CalibrationStep(Calibration track,
                       int n,
                       double x,
                       double y)
Constructs a CalibrationStep with specified image coordinates.

Parameters:
track - the calibration
n - the frame number
x - the image x coordinate of point 0
y - the image y coordinate of point 0

CalibrationStep

public CalibrationStep(Calibration track,
                       int n)
Constructs a CalibrationStep using the existing world coordinates.

Parameters:
track - the calibration
n - the frame number
Method Detail

addPosition

public void addPosition(double x,
                        double y)
Adds a position point to this step at the specified image coordinates.

Parameters:
x - the image x coordinate of the position point
y - the image y coordinate of the position point

getPosition1

public TPoint getPosition1()
Gets position 1.

Returns:
position 1

getPosition2

public TPoint getPosition2()
Gets position 2.

Returns:
position 2

getDefaultPoint

public TPoint getDefaultPoint()
Gets the default point. The default point is the point initially selected when the step is created. Overrides step getDefaultPoint method.

Overrides:
getDefaultPoint in class Step
Returns:
the default TPoint

findInteractive

public Interactive findInteractive(DrawingPanel panel,
                                   int xpix,
                                   int ypix)
Implements findInteractive method.

Overrides:
findInteractive in class Step
Parameters:
panel - the drawing panel
xpix - the x pixel position on the panel
ypix - the y pixel position on the panel
Returns:
the first step or motion vector that is hit

getMark

protected Mark getMark(TrackerPanel trackerPanel)
Overrides Step getMark method.

Overrides:
getMark in class Step
Parameters:
trackerPanel - the tracker panel
Returns:
the mark

clone

public java.lang.Object clone()
Clones this Step.

Overrides:
clone in class Step
Returns:
a clone of this step

toString

public java.lang.String toString()
Returns a String describing this step.

Overrides:
toString in class Step
Returns:
a descriptive string