Method InteractiveCurveViewRange::panToMakePointVisible now moves the
range of a whole number of pixels when panning horizontally. This allows
the cache of cartesian functions not to be invalidated.
Change-Id: Idb9904fef134dd13458e1f2287b0fe5145e8aec7
This is unfortunately required in several cases:
- Sometimes when we use either float and double (this should be changed)
- Because KDCoordinate is not an int, so any arithmemtic promotes it to
an int
- Because we mix pointer differences and ints
We memoize the checksum of the x first models, and we check that one of
these models is still present when the graph view appears. If so, we do
not reload the range, other wise we reload it.
Scenario:
f(t) = [t^2 t+1] in parametric
Display the graph
f(x) = 1 on ]-inf;0]
g(x) = 2 on [0;inf[
Display the graph -> the range did not change
The resolution() method is useful to get a horizontal step equivalent to
the width of a pixel. A higher sampling ratio (or resolution) had been
introduced in the following commit.
[apps] In curve view, avoid white vertical lines in integral curves due to pixel rounding
It was a pure virtual method implemented in derived classes
Shared::FunctionGraphController,
Regression::GraphController.
InteractiveCurveViewRange does not need anymore to hold CurveViewCursor
* m_cursor.
cursorBottomMarginRatio(), displayBottomMarginRatio(),
estimatedBannerHeight() and k_viewHeight moved to
Shared::InteractiveCurveViewController from derived classes.
estimatedBannerNumberOfLines() moved from
Shared::FunctionGraphController to
Shared::InteractiveCurveViewController and implemented in
Regresssion::GraphController.
The method is exactly called once, by
InteractiveCurveViewController::viewWillAppear, which also calls
initCursorParameters afterwards, which in turn calls
selectFunctionWithCursor. Hence the removed lines were redundant.
It was implemented by the Graph and Sequence GraphController derived
classes and was used
1) in FunctionGraphController::viewWillAppear to set the cursorView
specific to each derived class,
2) in FunctionGraphController::cursor/displayBottomMarginRatio()
methods.
Instead
1) the viewWillAppear method of each derived classes sets its
cursorView itself
2) one may already get the cursorView through curveView().