Package org.opentrafficsim.draw.graphs
Class ContourDataSource.Axis
- java.lang.Object
-
- org.opentrafficsim.draw.graphs.ContourDataSource.Axis
-
- Enclosing class:
- ContourDataSource<G extends org.opentrafficsim.kpi.interfaces.GtuDataInterface>
static class ContourDataSource.Axis extends Object
Class to store and determine axis information such as granularity, ticks, and range.Copyright (c) 2013-2022 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.- Version:
- $Revision$, $LastChangedDate$, by $Author$, initial version 10 okt. 2018
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
-
Constructor Summary
Constructors Constructor Description Axis(double minValue, double maxValue, double granularity, double[] granularities)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) int
getBinCount()
Calculates the number of bins.(package private) double
getBinValue(int bin)
Calculates the center value of a bin.(package private) double[]
getTicks()
Returns the ticks, which are calculated if needed.(package private) int
getValueBin(double value)
Looks up the bin number of the value.boolean
isInterpolate()
Retrieve the interpolate flag.(package private) void
setGranularity(double granularity)
Sets the granularity.(package private) void
setInterpolate(boolean interpolate)
Sets interpolation, important is it required the data to have an additional row or column.(package private) void
setMaxValue(double maxValue)
Sets the maximum value.String
toString()
-
-
-
Method Detail
-
setMaxValue
void setMaxValue(double maxValue)
Sets the maximum value.- Parameters:
maxValue
- double; maximum value
-
setGranularity
void setGranularity(double granularity)
Sets the granularity.- Parameters:
granularity
- double; granularity
-
getTicks
double[] getTicks()
Returns the ticks, which are calculated if needed.- Returns:
- double[]; ticks
-
getBinCount
int getBinCount()
Calculates the number of bins.- Returns:
- int; number of bins
-
getBinValue
double getBinValue(int bin)
Calculates the center value of a bin.- Parameters:
bin
- int; bin number- Returns:
- double; center value of the bin
-
getValueBin
int getValueBin(double value)
Looks up the bin number of the value.- Parameters:
value
- double; value- Returns:
- int; bin number
-
setInterpolate
void setInterpolate(boolean interpolate)
Sets interpolation, important is it required the data to have an additional row or column.- Parameters:
interpolate
- boolean; interpolation
-
isInterpolate
public boolean isInterpolate()
Retrieve the interpolate flag.- Returns:
- boolean; true if interpolation is on; false if interpolation is off
-
-