-
- 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 enumDrawLayersIsolines.DistributionDistributions describing how values within an interval should be spaced.
-
Field Summary
Fields Modifier and Type Field Description private DrawLayersIsolines.Distributiondistributionprivate booleandrawValues
-
Constructor Summary
Constructors Constructor Description DrawLayersIsolines(IsolinesFinder algorithm)Every class extending this one should call this constructor.
-
Method Summary
Modifier and Type Method Description DrawLayersIsolines.DistributiongetDistribution()voidsetDistribution(DrawLayersIsolines.Distribution distribution)voidsetDrawValues(Boolean drawValues)<T, P extends Position2D<P>> voiddrawFunction(Function<out Object, out Number> function, Environment<T, P> environment, Graphics2D graphics, Wormhole2D<P> wormhole)RangedIntegergetNumberOfIsolines()voidsetNumberOfIsolines(RangedInteger nOfIsolines)static Array<double>logspace(double d1, double d2, int n, double base)generates n logarithmically-spaced points between d1 and d2 using the provided base. static Array<double>linspace(double d1, double d2, int n)generates n linearly-spaced points between d1 and d2. -
Methods inherited from class it.unibo.alchemist.boundary.gui.effects.DrawLayersValues
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
-
getDistribution
DrawLayersIsolines.Distribution getDistribution()
-
setDistribution
void setDistribution(DrawLayersIsolines.Distribution distribution)
- Parameters:
distribution- to set
-
setDrawValues
void setDrawValues(Boolean drawValues)
- Parameters:
drawValues- whether the values of the isolines are to be drawn or not
-
drawFunction
<T, P extends Position2D<P>> void drawFunction(Function<out Object, out Number> function, Environment<T, P> environment, Graphics2D graphics, Wormhole2D<P> wormhole)
-
getNumberOfIsolines
RangedInteger getNumberOfIsolines()
-
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 the provided base.
- Parameters:
d1- The min valued2- The max valuen- The number of points to generatedbase- the logarithmic base to use
-
-
-
-