Class LineProfileStep

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

    • lineEnd0

      protected TPoint lineEnd0
    • lineEnd1

      protected TPoint lineEnd1
    • handle

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

      protected boolean endsEnabled
    • panelEnd0Shapes

      protected Map<Integer,Shape> panelEnd0Shapes
    • panelEnd1Shapes

      protected Map<Integer,Shape> panelEnd1Shapes
    • panelShaftShapes

      protected Map<Integer,Shape> panelShaftShapes
    • 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 TreeSet<org.opensourcephysics.cabrillo.tracker.LineProfileStep.Intersection> sorter
    • vertices

      protected ArrayList<org.opensourcephysics.cabrillo.tracker.LineProfileStep.GridVertex> vertices
  • Constructor Details

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

    • 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, 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
    • clone

      public Object clone()
      Clones this Step.
      Overrides:
      clone in class Step
      Returns:
      a clone of this step
    • toString

      public 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
    • clearData

      public void clearData()