Class InstancePointHitDetector

    • Field Detail

      • m_Owner

        protected InstancePanel m_Owner
        the owner of this detector.
    • Constructor Detail

      • InstancePointHitDetector

        public InstancePointHitDetector​(InstancePanel owner)
        Initializes the hit detector.
        Parameters:
        owner - the panel that uses this detector
    • Method Detail

      • getOwner

        public InstancePanel getOwner()
        Returns the owner.
        Returns:
        the owning panel
      • findEnclosingAttributeIndices

        protected int[] findEnclosingAttributeIndices​(Instance inst,
                                                      double x)
        Determines the enclosing attribute indices for the given x value. If the given x happens to be an exact point, then this points will be stored at index 0. If no index could be determined, then -1 will be stored.
        Parameters:
        inst - the underlying instance
        x - the x on the plot
        Returns:
        the indices
      • findClosestAttributeIndex

        protected int findClosestAttributeIndex​(Instance inst,
                                                double x)
        Returns the closest attribute index for the given x.
        Parameters:
        inst - the underlying Instance
        x - the x to get the index for
        Returns:
        the index
      • findInstancePoint

        protected InstancePoint findInstancePoint​(Instance inst,
                                                  int index)
        Returns the Instance point at the specified position.
        Parameters:
        inst - the Instance data structure to search
        index - the attribute index (original dataset)
        Returns:
        the InstancePoint, null if not found