org.opensourcephysics.cabrillo.tracker
Class LineProfileStep

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

public class LineProfileStep
extends Step

This is a step for a LineProfile. It is used for obtaining line profile data from a video image.

Author:
Douglas Brown

Field Summary
protected  org.opensourcephysics.cabrillo.tracker.LineProfileStep.Corner[][] corners
           
protected  java.util.Map<TrackerPanel,java.awt.Shape> end0Shapes
           
protected  java.util.Map<TrackerPanel,java.awt.Shape> end1Shapes
           
protected  boolean endsEnabled
           
protected  org.opensourcephysics.cabrillo.tracker.LineProfileStep.GridIntersection[] endX
           
protected  org.opensourcephysics.cabrillo.tracker.LineProfileStep.GridIntersection[] endY
           
protected  org.opensourcephysics.cabrillo.tracker.LineProfileStep.Handle handle
           
protected  LineProfile line
           
protected  TPoint lineEnd0
           
protected  TPoint lineEnd1
           
protected  java.util.Map<TrackerPanel,java.awt.Shape> shaftShapes
           
protected  java.util.TreeSet<org.opensourcephysics.cabrillo.tracker.LineProfileStep.Intersection> sorter
           
protected  org.opensourcephysics.cabrillo.tracker.LineProfileStep.GridIntersection[][] sweepX
           
protected  org.opensourcephysics.cabrillo.tracker.LineProfileStep.GridIntersection[][] sweepY
           
protected  java.util.ArrayList<org.opensourcephysics.cabrillo.tracker.LineProfileStep.GridVertex> vertices
           
 
Fields inherited from class org.opensourcephysics.cabrillo.tracker.Step
dataVisible, defaultIndex, footprint, format, frc, hitRect, marks, n, points, screenPoints, selectionShape, track, transform, valid
 
Constructor Summary
LineProfileStep(LineProfile track, int n, double x1, double y1, double x2, double y2)
          Constructs a LineProfileStep with specified end point coordinates in image space.
 
Method Summary
 java.lang.Object clone()
          Clones this Step.
 void draw(DrawingPanel panel, java.awt.Graphics _g)
          Overrides Step draw method.
 Interactive findInteractive(DrawingPanel panel, int xpix, int ypix)
          Overrides Step findInteractive method.
 java.awt.Rectangle getBounds(TrackerPanel trackerPanel)
          Overrides Step getBounds method.
 TPoint getHandle()
          Gets the center handle.
static int getLength()
          Gets the step length.
 TPoint getLineEnd0()
          Gets end 1.
 TPoint getLineEnd1()
          Gets end 2.
protected  Mark getMark(TrackerPanel trackerPanel)
          Overrides Step getMark method.
 double[][] getProfileData(TrackerPanel trackerPanel)
          Gets the line profile data.
 boolean isEndsEnabled()
          Gets whether the ends are enabled.
protected  void rotate()
          Rotates this step about its center to keep it either horizontal or parallel to the x-axis.
 void setEndsEnabled(boolean enabled)
          Enables and disables the interactivity of the ends.
 void setFootprint(Footprint footprint)
          Overrides Step setFootprint method.
 java.lang.String toString()
          Returns a String describing this step.
 
Methods inherited from class org.opensourcephysics.cabrillo.tracker.Step
erase, erase, getDefaultPoint, getFrameNumber, getPointIndex, getPoints, getTrack, remark, remark, repaint, repaint, setDefaultPointIndex, setHitRectCenter
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

lineEnd0

protected TPoint lineEnd0

lineEnd1

protected TPoint lineEnd1

handle

protected org.opensourcephysics.cabrillo.tracker.LineProfileStep.Handle handle

endsEnabled

protected boolean endsEnabled

end0Shapes

protected java.util.Map<TrackerPanel,java.awt.Shape> end0Shapes

end1Shapes

protected java.util.Map<TrackerPanel,java.awt.Shape> end1Shapes

shaftShapes

protected java.util.Map<TrackerPanel,java.awt.Shape> shaftShapes

line

protected LineProfile line

corners

protected org.opensourcephysics.cabrillo.tracker.LineProfileStep.Corner[][] corners

endX

protected org.opensourcephysics.cabrillo.tracker.LineProfileStep.GridIntersection[] endX

endY

protected org.opensourcephysics.cabrillo.tracker.LineProfileStep.GridIntersection[] endY

sweepX

protected org.opensourcephysics.cabrillo.tracker.LineProfileStep.GridIntersection[][] sweepX

sweepY

protected org.opensourcephysics.cabrillo.tracker.LineProfileStep.GridIntersection[][] sweepY

sorter

protected java.util.TreeSet<org.opensourcephysics.cabrillo.tracker.LineProfileStep.Intersection> sorter

vertices

protected java.util.ArrayList<org.opensourcephysics.cabrillo.tracker.LineProfileStep.GridVertex> vertices
Constructor Detail

LineProfileStep

public LineProfileStep(LineProfile track,
                       int n,
                       double x1,
                       double y1,
                       double x2,
                       double y2)
Constructs a LineProfileStep with specified end point coordinates in image space.

Parameters:
track - the track
n - the frame number
x1 - the x coordinate of end 1
y1 - the y coordinate of end 1
x2 - the x coordinate of end 2
y2 - the y coordinate of end 2
Method Detail

getLineEnd0

public TPoint getLineEnd0()
Gets end 1.

Returns:
end 1

getLineEnd1

public TPoint getLineEnd1()
Gets end 2.

Returns:
end 2

getHandle

public TPoint getHandle()
Gets the center handle.

Returns:
the handle

setEndsEnabled

public void setEndsEnabled(boolean enabled)
Enables and disables the interactivity of the ends.

Parameters:
enabled - true to enable the ends

isEndsEnabled

public boolean isEndsEnabled()
Gets whether the ends are enabled.

Returns:
true if the ends are enabled

setFootprint

public void setFootprint(Footprint footprint)
Overrides Step setFootprint method.

Overrides:
setFootprint in class Step
Parameters:
footprint - the footprint

findInteractive

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

Overrides:
findInteractive in class Step
Parameters:
panel - the drawing panel
xpix - the x pixel position
ypix - the y pixel position
Returns:
the TPoint that is hit, or null

draw

public void draw(DrawingPanel panel,
                 java.awt.Graphics _g)
Overrides Step draw method.

Overrides:
draw in class Step
Parameters:
panel - the drawing panel requesting the drawing
_g - the graphics context on which to draw

getMark

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

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

getBounds

public java.awt.Rectangle getBounds(TrackerPanel trackerPanel)
Overrides Step getBounds method.

Overrides:
getBounds in class Step
Parameters:
trackerPanel - the tracker panel drawing the step
Returns:
the bounding rectangle

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

getProfileData

public double[][] getProfileData(TrackerPanel trackerPanel)
Gets the line profile data.

Parameters:
trackerPanel - the tracker panel
Returns:
an integer array of values for image pixels along the line

rotate

protected void rotate()
Rotates this step about its center to keep it either horizontal or parallel to the x-axis.


getLength

public static int getLength()
Gets the step length.

Returns:
the length of the points array