Class CalibrationStep

java.lang.Object
org.opensourcephysics.cabrillo.tracker.Step
org.opensourcephysics.cabrillo.tracker.CalibrationStep
All Implemented Interfaces:
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
  • Field Details

    • worldX0

      protected double worldX0
    • worldY0

      protected double worldY0
    • worldX1

      protected double worldX1
    • worldY1

      protected double worldY1
  • Constructor Details

    • 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
  • Method Details

    • addSecondPoint

      public CalibrationStep.Position addSecondPoint(double x, double y)
      Adds a second 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
      Returns:
      the new position, or null if failed
    • getPosition

      public CalibrationStep.Position getPosition(int n)
      Gets the specified position point.
      Parameters:
      n - the point number (0 or 1)
      Returns:
      the position
    • 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
    • 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 Object clone()
      Clones this Step.
      Overrides:
      clone in class Step
      Returns:
      a clone of this step
    • setWorldCoordinates

      public boolean setWorldCoordinates(double x1, double y1, double x2, double y2)
      Sets the world coordinates. When a single point is visible, this sets the coords origin so its image position does not change. When both points are visible, this sets the origin, angle and scale so neither image position changes.
      Parameters:
      x1 - the world x coordinate of pt 1
      y1 - the world y coordinate of pt 1
      x2 - the world x coordinate of pt 2
      y2 - the world x coordinate of pt 2
      Returns:
      true if successfully set
    • toString

      public String toString()
      Returns a String describing this step.
      Overrides:
      toString in class Step
      Returns:
      a descriptive string
    • getLength

      public static int getLength()
      Gets the step length.
      Returns:
      the length of the points array
    • getLoader

      public static XML.ObjectLoader getLoader()
      Returns an ObjectLoader to save and load data for this class.
      Returns:
      the object loader