Package 

Class DrawLayersIsolines

  • All Implemented Interfaces:
    it.unibo.alchemist.boundary.gui.effects.DrawLayers , it.unibo.alchemist.boundary.gui.effects.Effect , it.unibo.alchemist.boundary.gui.effects.FunctionDrawer , java.io.Serializable

    
    public abstract class DrawLayersIsolines
    extends DrawLayersValues
                        

    Draw layers isolines. The user must specify: - the number of isolines to draw - the min layer value - the max layer value - the distribution, used to space isoline values between min and max This class defines the drawFunction method, which is capable of drawing a layer's isolines given a function. The only responsibility left to subclasses is to provide a LayerToFunctionMapper.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public enum DrawLayersIsolines.Distribution

      Distributions describing how values within an interval should be spaced.

    • Constructor Summary

      Constructors 
      Constructor Description
      DrawLayersIsolines(IsolinesFinder algorithm) Every class extending this one should call this constructor.
    • Method Summary

      Modifier and Type Method Description
      <T, P extends Position2D<P>> void drawFunction(Function<out Object, out Number> function, Environment<T, P> environment, Graphics2D graphics, Wormhole2D<P> wormhole)
      RangedInteger getNumberOfIsolines()
      void setNumberOfIsolines(RangedInteger nOfIsolines)
      static Array<double> logspace(double d1, double d2, int n, double base) generates n logarithmically-spaced points between d1 and d2 using theprovided base.
      static Array<double> linspace(double d1, double d2, int n) generates n linearly-spaced points between d1 and d2.
      DrawLayersIsolines.Distribution getDistribution()
      void setDistribution(DrawLayersIsolines.Distribution distribution)
      void setDrawValues(Boolean drawValues)
      • Methods inherited from class it.unibo.alchemist.boundary.gui.effects.DrawLayersValues

        drawFunction, drawLayers, getMaxLayerValue, getMinLayerValue, setMaxLayerValue, setMinLayerValue
      • Methods inherited from class it.unibo.alchemist.boundary.gui.effects.AbstractDrawLayers

        drawLayers, getAlpha, getBlue, getColorSummary, getGreen, getMolString, getRed, isLayerFilter, setAlpha, setBlue, setGreen, setLayerFilter, setMolString, setRed
      • Methods inherited from class it.unibo.alchemist.boundary.gui.effects.DrawOnce

        apply, getMarkerNodeID
      • Methods inherited from class it.unibo.alchemist.boundary.gui.effects.Effect

        apply, apply, equals, hashCode
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DrawLayersIsolines

        DrawLayersIsolines(IsolinesFinder algorithm)
        Every class extending this one should call this constructor.
        Parameters:
        algorithm - - the algorithm used to extract isolines
    • Method Detail

      • setNumberOfIsolines

         void setNumberOfIsolines(RangedInteger nOfIsolines)
        Parameters:
        nOfIsolines - the number of isolines
      • logspace

         static Array<double> logspace(double d1, double d2, int n, double base)

        generates n logarithmically-spaced points between d1 and d2 using theprovided base.

        Parameters:
        d1 - The min value
        d2 - The max value
        n - The number of points to generated
        base - the logarithmic base to use
      • linspace

         static Array<double> linspace(double d1, double d2, int n)

        generates n linearly-spaced points between d1 and d2.

        Parameters:
        d1 - The min value
        d2 - The max value
        n - The number of points to generated
      • setDrawValues

         void setDrawValues(Boolean drawValues)
        Parameters:
        drawValues - whether the values of the isolines are to be drawn or not