Class AbstractDistanceBasedHitDetector<H,P>
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.gui.visualization.core.plot.AbstractHitDetector<H,P>
-
- adams.gui.visualization.core.plot.AbstractDistanceBasedHitDetector<H,P>
-
- All Implemented Interfaces:
CleanUpHandler
,Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,HitDetector<H,P>
,Serializable
- Direct Known Subclasses:
AbstractScatterPlotHitDetector
,AbstractXYSequencePointHitDetector
,InstancePointHitDetector
,SpreadSheetRowPointHitDetector
,TimeseriesPointHitDetector
,ZScoreHitDetector
public abstract class AbstractDistanceBasedHitDetector<H,P> extends AbstractHitDetector<H,P>
Detects hits based on the difference between two points in the plot, based on their 2-dim coordinates.
Distance calcuation between point and line see here and DistancePoint.java- Author:
- fracpete (fracpete at waikato dot ac dot nz), Pieter Iserbyt (distance calculation between point and line)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected int
m_MinimumPixelDifference
the minimum pixel difference to use for determining hit or miss.-
Fields inherited from class adams.gui.visualization.core.plot.AbstractHitDetector
m_Debug, m_Enabled
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description AbstractDistanceBasedHitDetector()
Initializes the hit detector.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.protected double
distance(Point2D p1, Point2D p2, Point2D p3)
Returns the distance of p3 to the segment defined by p1,p2.protected int
getDefaultMinimumPixelDifference()
Returns the default minimum pixel difference.int
getMinimumPixelDifference()
Returns the minimum pixel difference before a hit is declared.String
minimumPixelDifferenceDetectorTipText()
Returns the tip text for this property.void
setMinimumPixelDifference(int value)
Sets the minimum pixel difference before a hit is declared.-
Methods inherited from class adams.gui.visualization.core.plot.AbstractHitDetector
cleanUp, detect, getDebug, isEnabled, isHit, locate, processHit, setDebug, setEnabled
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractOptionHandler
-
getDefaultMinimumPixelDifference
protected int getDefaultMinimumPixelDifference()
Returns the default minimum pixel difference.- Returns:
- the minimum
-
setMinimumPixelDifference
public void setMinimumPixelDifference(int value)
Sets the minimum pixel difference before a hit is declared.- Parameters:
value
- the number of pixels
-
getMinimumPixelDifference
public int getMinimumPixelDifference()
Returns the minimum pixel difference before a hit is declared.- Returns:
- the number of pixels
-
minimumPixelDifferenceDetectorTipText
public String minimumPixelDifferenceDetectorTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
distance
protected double distance(Point2D p1, Point2D p2, Point2D p3)
Returns the distance of p3 to the segment defined by p1,p2.- Parameters:
p1
- First point of the segmentp2
- Second point of the segmentp3
- Point to which we want to know the distance of the segment defined by p1,p2- Returns:
- The distance of p3 to the segment defined by p1,p2
-
-