Commit Graph

80 Commits

Author SHA1 Message Date
Gabriel Ozouf
43f50b7b2d [interactive_curve_view_range] Missing refresh
The normalized status would not be refreshed after a call to setDefault
triggered by InteractiveCurveViewController::viewWillAppear.

Change-Id: I923ef3ca0585dbcc1f32b992d7dd1f4a3a206532
2020-11-04 15:58:16 +01:00
Gabriel Ozouf
f0cd0694a6 [apps/shared] Activating Auto zoom resets cursor
Change-Id: Ib815286e1316e20f72b31d3d9206aa032b06eff4
2020-11-04 15:58:11 +01:00
Gabriel Ozouf
bf76b56f90 [apps/shared] Change Zoom button in curves
Zoom is now called navigate, and its button is placed before the Axes
button.

Change-Id: Ied194c20438e573a237ce36f221b9be87cfd4bab
2020-11-04 15:58:11 +01:00
Gabriel Ozouf
43d21180bc [apps/shared] Deactivate zoomAuto on pan and zoom
The Auto mode for curve ranges must be deactivated when moving the
cursor outside the screen and when activating navigation (formerly
Zoom).

Change-Id: I281a1d069c2ebcc30e7ead469c4f48438054d7c2
2020-11-04 15:58:11 +01:00
Gabriel Ozouf
5c67f92d18 [apps/interactive_curve_view_controller] Buttons
Add two new buttons to toggle Auto and Normalized modes for curves.

Change-Id: Ib583d087ce5ae779d24f6a8bbc72ab7140752dd5
2020-11-04 15:58:10 +01:00
Gabriel Ozouf
cc22b0d298 [apps/shared] Reset curve range to default in Auto
When the range is set to ZoomAuto, the range is recomputed before
displaying the curve.
2020-11-04 15:58:10 +01:00
Gabriel Ozouf
8970e294aa [apps] Remove modelVersion from curves apps
The graph range used to be reset to default whenever all functions were
modified. As we no longer want to reset the range without the user's
input, we do not need to track whether the functions changed at all.

/!\ As of this commit, there is no longer a way to restore the default
zoom, until a new automatic zoom button is added.

Change-Id: Ie74e8fd61e13055fa6ce2b2d1e883182d4ecffce
2020-11-04 15:58:09 +01:00
Gabriel Ozouf
5a07db3452 [apps] Remove "Preadjustments" menu for curves
Change-Id: I1a30efd502c5db36325d87fa0f1dffacc37a4f1c
2020-11-04 15:58:08 +01:00
Gabriel Ozouf
26bbdead7d [apps/shared] Allow movement from undef curve
Fix a bug preventing the cursor from moving to other curves using UP and
DOWN when the y value was undef.
To reproduce :
  - In Graph, define f(x) = 1 and g(x) = ln(x), then draw the curves
  - Press DOWN to select g
  - Press LEFT until g is not defined anymore
--> Pressing UP or DOWN won't allow you to select f

Change-Id: I79ed4a57b78ac0b8dac3f66e722e358bd4be18d9
2020-11-04 15:32:59 +01:00
Hugo Saint-Vignes
9e12b61849 [apps/graph] Round x before evaluating graph cursor on scroll
Change-Id: I13500669963eb8130e188a898bed0bf63655add6
2020-11-04 15:07:20 +01:00
Hugo Saint-Vignes
bd2609bcba [apps/graph] Remove horizontal margins when panning on some graph calculations
Change-Id: I1a28555c5b4f04986b223617ab15110711a74841
2020-11-04 15:07:20 +01:00
Gabriel Ozouf
4007f4d452 [apps] Tweaked panning for better cache alignement
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
2020-11-04 14:45:35 +01:00
Joachim LF
d37bf9e344 [Apps/Shared] Fixed interval and curve view exit 2020-07-29 10:07:07 +02:00
Léa Saviot
a0c5a1fe1c [apps] InteractCurveVwCtlr::addMargin adds more than the required margin 2020-05-15 02:52:54 -07:00
Léa Saviot
53705fb333 [apps/graph_ctrlr] Reload range if no previous model is present
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
2020-03-11 11:43:36 +01:00
Léa Saviot
aab8974934 [apps] Memoize five model checksums 2020-03-11 11:43:36 +01:00
Romain Goyet
7f43b73049 [apps] Don't forget to call viewWillAppear
At the moment ViewController::viewWillAppear doesn't do anything, so
there is no real impact. But if we want to use it it needs to be called
from subclasses.
2020-02-17 10:31:24 -05:00
Léa Saviot
88ab0e686c [apps] Less operations in willExitResponderChain if exiting app
If nextFirstResponder is nullptr, it means we are exiting the app, so
there is no need to relayout, reselect, ...
We did it bbefore because a long time ago, we used to keep all apps side
by side so they had to be thouroughly cleaned when exiting
2020-02-12 15:13:22 +01:00
Ruben Dashyan
2fb6824947 [apps/shared/interactive_curve_view_controller] Rewrite comment about addMargin 2020-02-12 15:13:16 +01:00
Léa Saviot
274795fcab [apps/graph] setDefault when changing models if non cartesian functions 2019-09-12 09:54:02 +02:00
Léa Saviot
a4099c4c3e [apps/graph] xAuto and YAuto for polar/param 2019-09-03 14:21:14 +02:00
Émilie Feral
2d5b60640d [apps/shared] Fix InteractiveCurveViewController::moveCursorVertically
for Sequence and Regression (add a TODO for Graph)
2019-08-30 17:14:26 +02:00
Léa Saviot
a945c02edf [poincare/Coordinate2D] Rename members x1 and x2 2019-08-29 11:07:22 +02:00
Léa Saviot
28a721e96e [apps] Start fixing apps as cursor has new member variable 2019-08-29 11:07:22 +02:00
Ruben Dashyan
585b77c38f [apps/shared/curve_view] Clarify coordinates' conventions 2019-07-30 14:15:08 +02:00
Ruben Dashyan
44809f4b3f Substitute Escher app() by Container::activeApp() 2019-07-19 15:06:25 +02:00
Ruben Dashyan
055d601854 [apps] Define TextFieldDelegate::textFieldDelegateApp() directly from ::app() 2019-07-19 15:06:25 +02:00
Ruben Dashyan
0e1c1a017d [apps] Implement TextFieldDelegate methods in GraphControllers 2019-05-03 15:54:22 +02:00
Ruben Dashyan
ba6282be45 [apps/shared] Remove InteractiveCurveViewController::didEnterResponderChain
In order to avoid reloading after Ion::Events::Toolbox/Var, but only in
viewWillAppear.
The previous behavior was masking a bug in
Regression::GraphController::viewWillAppear where the cursor could be
moved after reloading the bannerView.
2019-05-03 15:54:21 +02:00
Ruben Dashyan
7b5c891f44 [apps/shared] Clean InteractiveCurveViewController::handleEvent 2019-05-03 15:54:21 +02:00
Ruben Dashyan
94cf542ba3 [apps] Factorize InteractiveCurveViewController::moveCursorVertically 2019-05-03 15:54:21 +02:00
Ruben Dashyan
67f9f79322 [apps] Implement InteractiveCurveViewController::isCursorVisible
It was a pure virtual method implemented in derived classes
  Shared::FunctionGraphController,
  Regression::GraphController.
InteractiveCurveViewRange does not need anymore to hold CurveViewCursor
* m_cursor.
2019-05-03 15:54:21 +02:00
Ruben Dashyan
8629254d9a [apps] Remove Shared::InteractiveCurveViewController::displayTop/BottomMarginRatio
and replace it by the existing cursorTop/BottomMarginRatio.
There was absolutely no reason to use different margin values.
2019-05-03 15:54:21 +02:00
Ruben Dashyan
d8f97d62a4 [apps] Factorize Shared::InteractiveCurveViewController methods
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.
2019-05-03 15:54:21 +02:00
Ruben Dashyan
e13651f6fb [apps] Remove Shared::InteractiveCurveViewController::initRangeParameters virtual method 2019-05-03 15:54:21 +02:00
Ruben Dashyan
ce712eac53 [apps/shared] Clean SimpleInteractiveCurveViewController constructor 2019-05-03 15:54:21 +02:00
Léa Saviot
de3d200b81 [apps/graph/reg/seq] Do not switch on y auto each time graph appears 2019-01-10 11:42:02 +01:00
Léa Saviot
19e8b2ee1c [apps] Fix InteractiveCurveViewController::addMargin 2019-01-10 11:42:02 +01:00
Léa Saviot
96c6143c6e [apps] Fix graph vertical navigation
It would loop when three equal functions are defined.
2018-12-12 11:14:51 +01:00
Léa Saviot
e3935fd9c0 [apps] Factorize closestCurveIndexVertically from Regression and Graph 2018-11-23 12:04:08 +01:00
Léa Saviot
bea78aa3b1 [apps/escher] Invocation::Action returns a bool 2018-11-23 12:04:04 +01:00
Émilie Feral
698332c355 [escher] InputTextDelegate and LayoutFieldDelegate don't inherit from
InputTextDelegate to avoid diamond inheritance
2018-11-23 12:04:03 +01:00
Romain Goyet
f8beae3b86 [kandinsky] Move to KDFont 2018-10-11 16:44:02 +02:00
Léa Saviot
68d915fb3e [apps/reg] Fix window sizing: cursor appears even with big bannerview 2018-07-18 10:32:46 +02:00
Émilie Feral
9cd50d8d9a [apps] Graph/Sequence: set different cursors for Sequence and Graph 2018-01-30 18:53:28 +01:00
Émilie Feral
1c49dab2b7 [apps] Graph: Handle enter on tangent graph controller 2018-01-30 18:19:27 +01:00
Émilie Feral
323ecc72c5 [apps] Shared: break InteractiveCurveViewController into 2 classes (to
shared the implementation of Zoom in/out and MoveCursorHorizontally)
2018-01-30 18:19:27 +01:00
Émilie Feral
0dec52a708 [apps] Graph: enable to specialize GraphController in different types
(Default, Tangent ...)
2018-01-30 18:19:27 +01:00
Jacob Young
17ac54cad5 Use cmath in c++ files. 2017-10-13 18:08:15 +02:00
Émilie Feral
d6528d84a9 [apps/shared] Change zoom to ensure to keep the same cusor position
Change-Id: Ie24fcdda2aad7da8872915511fcd2e71d19ff8a6
2017-06-09 11:35:53 +02:00