Class CalibrationStep
java.lang.Object
org.opensourcephysics.cabrillo.tracker.Step
org.opensourcephysics.cabrillo.tracker.CalibrationStep
- All Implemented Interfaces:
Cloneable
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
Nested ClassesModifier and TypeClassDescriptionclass
A class that represents the position of a calibration point. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected double
protected double
protected double
protected double
Fields inherited from class org.opensourcephysics.cabrillo.tracker.Step
dataVisible, defaultIndex, footprint, format, hitRect, n, panelMarks, points, screenPoints, selectionShape, selectionStroke, trackID, transform, type, TYPE_ACCELERATION, TYPE_UNKNOWN, TYPE_VELOCITY, valid
-
Constructor Summary
ConstructorsConstructorDescriptionCalibrationStep
(Calibration track, int n, double x, double y) Constructs a CalibrationStep with specified image coordinates. -
Method Summary
Modifier and TypeMethodDescriptionaddSecondPoint
(double x, double y) Adds a second position point to this step at the specified image coordinates.clone()
Clones this Step.Gets the default point.static int
Gets the step length.static XML.ObjectLoader
Returns an ObjectLoader to save and load data for this class.protected Mark
getMark
(TrackerPanel trackerPanel) Overrides Step getMark method.getPosition
(int n) Gets the specified position point.boolean
setWorldCoordinates
(double x1, double y1, double x2, double y2) Sets the world coordinates.toString()
Returns a String describing this step.Methods inherited from class org.opensourcephysics.cabrillo.tracker.Step
dispose, draw, erase, erase, findInteractive, getFrameNumber, getPointIndex, getPoints, getTrack, remark, remark, repaint, repaint, setDefaultPointIndex, setFootprint, setHitRectCenter
-
Field Details
-
worldX0
protected double worldX0 -
worldY0
protected double worldY0 -
worldX1
protected double worldX1 -
worldY1
protected double worldY1
-
-
Constructor Details
-
CalibrationStep
Constructs a CalibrationStep with specified image coordinates.- Parameters:
track
- the calibrationn
- the frame numberx
- the image x coordinate of point 0y
- the image y coordinate of point 0
-
-
Method Details
-
addSecondPoint
Adds a second position point to this step at the specified image coordinates.- Parameters:
x
- the image x coordinate of the position pointy
- the image y coordinate of the position point- Returns:
- the new position, or null if failed
-
getPosition
Gets the specified position point.- Parameters:
n
- the point number (0 or 1)- Returns:
- the position
-
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 classStep
- Returns:
- the default TPoint
-
getMark
Overrides Step getMark method. -
clone
Clones 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 1y1
- the world y coordinate of pt 1x2
- the world x coordinate of pt 2y2
- the world x coordinate of pt 2- Returns:
- true if successfully set
-
toString
Returns a String describing this step. -
getLength
public static int getLength()Gets the step length.- Returns:
- the length of the points array
-
getLoader
Returns an ObjectLoader to save and load data for this class.- Returns:
- the object loader
-