public class IteratorITracePoint2DUtil extends Object
ITrace2DDataAccumulating
.
Modifier and Type | Class and Description |
---|---|
static class |
IteratorITracePoint2DUtil.SkipResult
Simple struct to return the last skipped
ITracePoint2D along with
the skip count. |
Modifier and Type | Method and Description |
---|---|
static IteratorITracePoint2DUtil.SkipResult |
scrollToFirstVisibleXValue(Iterator<ITracePoint2D> traceIt)
Scrolls the given iterator to the first point that is in visible scaled x
range [0.0 ..
|
public static IteratorITracePoint2DUtil.SkipResult scrollToFirstVisibleXValue(Iterator<ITracePoint2D> traceIt)
Note: this only makes sense if the given iterator returns trace points with order of x values (ascending or descending!
Assumption: The points in the iterator already have been scaled to the
visible range (by Chart2D). So this works by using
ITracePoint2D.getScaledX()
and finding out if the value is within
[0.0 .. 1.0].
Note: the state of the given iterator is changed. After this call you may continue iterating. You most probably will first consume the position 0 of the result (interpolated point to the lower x bound) and position 1 of the result (first trace point above given x point).
Note: There is no guarantee that the iterator will return visible points after this call as y bounds or the upper x bound is not checked!
traceIt
- the source iterator to scroll.Copyright © 2017. All rights reserved.