Class AbstractTwoAxisGridModel

All Implemented Interfaces:
INameable, IBoundingBoxModel, IBoundsToFit, IMapPathModel, IScanPathModel, IScanPointGeneratorModel
Direct Known Subclasses:
AbstractOverlapModel, TwoAxisGridPointsModel, TwoAxisGridStepModel

public abstract class AbstractTwoAxisGridModel extends AbstractBoundingBoxModel implements IBoundsToFit
Abstract superclass for models representing a raster scan within a rectangular box in two-dimensional space. Previously AbstractGridModel
  • Constructor Details

    • AbstractTwoAxisGridModel

      protected AbstractTwoAxisGridModel()
  • Method Details

    • getOrientation

      public AbstractTwoAxisGridModel.Orientation getOrientation()
      By default the horizontal axis is the scanned first, i.e. is the fast axis. If this property is set the vertical axis is the scanned first.
      Returns:
      true if the vertical axis is scanned first, false if the horizontal axis is scanned first.
    • setOrientation

      public void setOrientation(AbstractTwoAxisGridModel.Orientation orientation)
    • isVerticalOrientation

      public boolean isVerticalOrientation()
    • isBoundsToFit

      public boolean isBoundsToFit()
      Specified by:
      isBoundsToFit in interface IBoundsToFit
    • setBoundsToFit

      public void setBoundsToFit(boolean boundsToFit)
      Specified by:
      setBoundsToFit in interface IBoundsToFit
    • updateFromPropertiesMap

      public void updateFromPropertiesMap(Map<String,Object> properties)
      Specified by:
      updateFromPropertiesMap in interface IScanPointGeneratorModel
      Overrides:
      updateFromPropertiesMap in class AbstractPointsModel
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class AbstractBoundingBoxModel
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class AbstractBoundingBoxModel
    • toString

      public String toString()
      Overrides:
      toString in class AbstractBoundingBoxModel
    • enforceShape

      public static TwoAxisGridPointsModel enforceShape(TwoAxisGridStepModel model)
      Turns a StepModel into an equivalent PointsModel. Some scans (e.g XANES) perform similar scans but with small offsets, which can catch on floating point calculation errors, giving off-by-one in dataset shapes when reconstructing. This utility method prevents this situation by converting to a PointsModel, which will always have the same shape, and performing the division to find the number of points using BigDecimal. The BoundingBox of the returned model may differ from that of the input method, due to StepModels being able to leave a portion of a step towards their end too small for another step. PointsModel however use the entire region, so this partial box is equivalent in terms of point placement.
      Parameters:
      model - - a TwoAxisGridStepModel
      Returns:
      pointsModel - a TwoAxisGridPointsModel that will output IPositions that very closely match the IPositions generated by the input
    • isAlternateBothAxes

      public boolean isAlternateBothAxes()
    • setAlternateBothAxes

      public void setAlternateBothAxes(boolean alternateBothAxes)