-
- 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.
-
Field Summary
Fields Modifier and Type Field Description private DrawLayersIsolines.Distribution
distribution
private boolean
drawValues
-
Constructor Summary
Constructors Constructor Description DrawLayersIsolines(IsolinesFinder algorithm, LayerToFunctionMapper mapper)
Every class extending this one should call this constructor.
-
Method Summary
Modifier and Type Method Description DrawLayersIsolines.Distribution
getDistribution()
void
setDistribution(DrawLayersIsolines.Distribution distribution)
void
setDrawValues(Boolean drawValues)
<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 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, LayerToFunctionMapper mapper)
Every class extending this one should call this constructor.- Parameters:
algorithm
- - the algorithm used to extract isolinesmapper
- - the function converting a layer to a function
-
-
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
-
-
-
-