Class PerspectiveTrack

All Implemented Interfaces:
PropertyChangeListener, EventListener, Drawable, Interactive, Measurable, Trackable

public class PerspectiveTrack extends TTrack
This is a track used for autotracking perspective filter corners.
Author:
Douglas Brown
  • Constructor Details

    • PerspectiveTrack

      public PerspectiveTrack(PerspectiveFilter filter)
      Constructor requires a PerspectiveFilter to control.
      Parameters:
      filter - the filter
  • Method Details

    • dispose

      public void dispose()
      Description copied from class: TTrack
      Disposes of resources when this track is deleted or cleared.
      Overrides:
      dispose in class TTrack
    • setTrackerPanel

      public void setTrackerPanel(TrackerPanel panel)
      Adds events for TrackerPanel.
      Overrides:
      setTrackerPanel in class TTrack
      Parameters:
      panel - the new TrackerPanel
    • propertyChange

      public void propertyChange(PropertyChangeEvent e)
      Responds to property change events.
      Specified by:
      propertyChange in interface PropertyChangeListener
      Overrides:
      propertyChange in class TTrack
      Parameters:
      e - the property change event
    • findInteractive

      public Interactive findInteractive(DrawingPanel panel, int xpix, int ypix)
      Finds the interactive drawable object located at the specified pixel position.
      Specified by:
      findInteractive in interface Interactive
      Overrides:
      findInteractive in class TTrack
      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 TPoint that is hit
    • getMenu

      public JMenu getMenu(TrackerPanel trackerPanel, JMenu menu)
      Prepares menu items and returns a new menu. Subclasses should override this method and add track-specific menu items.
      Overrides:
      getMenu in class TTrack
      Parameters:
      trackerPanel - the tracker panel
      menu - the menu. If null, a dynamic menu is returned that adds items only when selected
      Returns:
      a menu
    • getMessage

      public String getMessage()
      Gets a message about this track to display in a message box.
      Overrides:
      getMessage in class TTrack
      Returns:
      the message
    • getStep

      public Step getStep(TPoint p, TrackerPanel trackerPanel)
      Gets the step associated with a TPoint.
      Overrides:
      getStep in class TTrack
      Parameters:
      p - a TPoint
      trackerPanel - the tracker panel holding the TPoint
      Returns:
      the step associated with the TPoint
    • deleteStep

      public Step deleteStep(int n)
      Deletes a step. This removes the perspective filter key frame data.
      Overrides:
      deleteStep in class TTrack
      Parameters:
      n - the frame number
      Returns:
      the deleted step
    • autoMarkAt

      public TPoint autoMarkAt(int n, double x, double y)
      Used by autoTracker to mark a step at a match target position.
      Overrides:
      autoMarkAt in class TTrack
      Parameters:
      n - the frame number
      x - the x target coordinate in image space
      y - the y target coordinate in image space
      Returns:
      the TPoint that was automarked
    • getMarkedPoint

      public TPoint getMarkedPoint(int n, int index)
      Used by autoTracker to get the marked point for a given frame and index.
      Overrides:
      getMarkedPoint in class TTrack
      Parameters:
      n - the frame number
      index - the index
      Returns:
      the step TPoint at the index
    • setTargetIndex

      protected void setTargetIndex(TPoint p)
      Sets the target index for the autotracker.
      Overrides:
      setTargetIndex in class TTrack
      Parameters:
      p - a TPoint associated with this track
    • getTargetDescription

      protected String getTargetDescription(int pointIndex)
      Returns a description of a target point with a given index.
      Overrides:
      getTargetDescription in class TTrack
      Parameters:
      pointIndex - the index
      Returns:
      the description
    • isAutoTrackable

      protected boolean isAutoTrackable(int pointIndex)
      Determines if the given point index is autotrackable.
      Overrides:
      isAutoTrackable in class TTrack
      Parameters:
      pointIndex - the points[] index
      Returns:
      true if autotrackable
    • isAutoTrackable

      protected boolean isAutoTrackable()
      Determines if at least one point in this track is autotrackable.
      Overrides:
      isAutoTrackable in class TTrack
      Returns:
      true if autotrackable
    • draw

      public void draw(DrawingPanel panel, Graphics _g)
      Description copied from class: TTrack
      Draws the steps on the tracker panel.
      Specified by:
      draw in interface Drawable
      Overrides:
      draw in class TTrack
      Parameters:
      panel - the drawing panel requesting the drawing
      _g - the graphics context on which to draw
    • getStepLength

      public int getStepLength()
      Description copied from class: TTrack
      Gets the length of the steps created by this track.
      Specified by:
      getStepLength in class TTrack
      Returns:
      the footprint length
    • getFootprintLength

      public int getFootprintLength()
      Description copied from class: TTrack
      Gets the length of the footprints required by this track.
      Specified by:
      getFootprintLength in class TTrack
      Returns:
      the footprint length
    • createStep

      public Step createStep(int n, double x, double y)
      Description copied from class: TTrack
      Creates a new step.
      Specified by:
      createStep in class TTrack
      Parameters:
      n - the frame number
      x - the x coordinate in image space
      y - the y coordinate in image space
      Returns:
      the new step
    • remark

      public void remark(Integer panelID)
      Description copied from class: TTrack
      Remarks all steps on the specified panel.
      Overrides:
      remark in class TTrack
    • getFormatMap

      public Map<String,String[]> getFormatMap()
      Specified by:
      getFormatMap in class TTrack
    • getFormatDescMap

      public Map<String,String> getFormatDescMap()
      Specified by:
      getFormatDescMap in class TTrack
    • getFormatVariables

      public String[] getFormatVariables()
      Specified by:
      getFormatVariables in class TTrack
    • getVarDimsImpl

      public String getVarDimsImpl(String variable)
      Specified by:
      getVarDimsImpl in class TTrack
    • getBaseType

      public String getBaseType()
      Specified by:
      getBaseType in class TTrack