Commit Graph

51 Commits

Author SHA1 Message Date
Gabriel Ozouf
17f39e5e39 [apps/graph] Take cursor into account for Y range
Additional checks have been added to ensure that the first move of the
cursor from the center of the graph would not cause the window to pan up
or down.

Change-Id: I44d7e86223941076cbf03db7a221e9c0427a64e4
2020-11-04 15:30:53 +01:00
Gabriel Ozouf
8104caea50 [apps/shared] New automatic zoom on curves
Initial zoom for displaying curves is computed according to the
following rules :
  - For polar and parametric curves, the algorithm has not changed.
    Vertical and horizontal ranges are chosen in order to display the
    full curve with orthonormal graduations.
  - For cartesian curves, the horizontal range is chosen in order to
    display all points of interest (roots, extrema, asymptotes...).
    The vertical range is fitted to be able to display those points, but
    also cuts out points outside of the function's order of magnitude.

Change-Id: Idf8233fc2e6586b85d34c4da152c83e75513d85c
2020-11-04 15:30:53 +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
Léa Saviot
ee78948cf8 [apps/interactive_curve_view_range] Clean panToMakePointVisible 2020-05-15 02:52:54 -07:00
Léa Saviot
456cd3c73a Revert "[apps] Add FLT_EPSILON in float comparisons in interactive_curve_vw_rge"
This reverts commit 18381fd334.
2020-05-15 02:52:54 -07:00
Romain Goyet
950862f8d0 Use std::min and std::max 2020-04-14 09:31:02 -04:00
Léa Saviot
e5a2208b27 [apps/interactive_curve_view_range] Recompute yRange after setDefault
Scenario : f(x)=8x, scroll to the right until the window range has
changed, then set the preadjustment to default -> the x change had no
impact on the yRange because we did not set the yAuto before doing the
changes.
2020-02-25 15:07:16 +01:00
Léa Saviot
97b495a4dc [apps/interactive_curve_view_range] Orthonormal keep max grid unit
When setting the axes then putting on the orthnormalization, 2 * (max of
the two axes units) is put to 1 cm instead of doing 2 units = 1cm. This
roughly keeps the configuration of the window.
2020-02-12 15:13:21 +01:00
Émilie Feral
45d42287e2 [apps/shared] MemoizedCurveViewRange is composed of two Range1D to
factorize setters and getters
2019-09-03 15:34:35 +02:00
Léa Saviot
4ecf6835e7 [apps] Code cleaning 2019-09-03 14:21:14 +02:00
Léa Saviot
a4099c4c3e [apps/graph] xAuto and YAuto for polar/param 2019-09-03 14:21:14 +02:00
Léa Saviot
18a458bae5 [apps/graph] init Range to -5..5 if polar/param 2019-09-02 17:56:56 +02:00
Ruben Dashyan
7e9762e933 [apps/shared/*_curve_view_range] Define and use defaultRangeWidthFor 2019-08-29 15:13:41 +02:00
Ruben Dashyan
5dc429dae5 [apps/*curve_view_range] Use existing method 2019-08-29 15:13:41 +02:00
Ruben Dashyan
8957cb9fea [apps/shared/curve_view_range] Define and use x|yCenter accessors 2019-08-29 15:13:41 +02:00
Ruben Dashyan
e99196b2ea [apps/interactive_curve_view_range] Clean yAuto 2019-08-29 15:13:41 +02:00
Émilie Feral
927b69067c Merge branch 'version-11' into f7 2019-05-03 17:25:53 +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
Léa Saviot
496d346049 Remove max/min inline from KDCoordinate header 2019-05-03 15:53:19 +02:00
Léa Saviot
380ac52cd8 [ion/crc32] crc32Byte and crc32Word 2019-04-25 17:11:06 +02:00
Léa Saviot
43031928c3 Remove max/min inline from KDCoordinate header 2019-04-12 15:16:51 +02:00
Léa Saviot
6720ad7b38 [apps] Rename interestingXRange as interestingXHalfRange 2019-01-10 11:42:05 +01:00
Léa Saviot
cea413e91d [apps] Fix Orthonormal setting in graphs
It was not perfectly orthormal.
2019-01-10 11:42:02 +01:00
Léa Saviot
020e459379 [apps] Clean shared/interactive_curve_view_range.cpp 2019-01-10 11:42:02 +01:00
Léa Saviot
18381fd334 [apps] Add FLT_EPSILON in float comparisons in interactive_curve_vw_rge
This fixes the removal of yAuto when displaying the function f(x)=cos(x)
2019-01-10 11:42:02 +01:00
Léa Saviot
404db60a3d [apps/shared] Code cleaning and inlining 2019-01-10 11:42:02 +01:00
Lionel Debroux
1a8c6b6ae9 [poincare, escher, ion, apps] Split the huge umbrella header poincare.h, to reduce build time.
This should be a NFC, but surprisingly, it also reduces size... so what does it change ?
2018-10-23 11:49:09 +02:00
Émilie Feral
48f890ef93 [poincare] AngleUnit, FormatComplex and PrintFloatMode are now
enumeration of Preferences class
2018-07-30 13:48:04 +02:00
Émilie Feral
05cd2b5866 [shared] Sequence/Function: on graph zoom on center if the cursor is undefined 2018-05-16 18:51:35 +02:00
Léa Saviot
b67e04214f [apps] Coding style.
Change-Id: I020cc98f87999b69e9c0d969126e9c1ae2f811f2
2018-04-06 14:31:48 +02:00
Zhaofeng Li
6679cb0a20 [apps] Fix exam mode 2018-04-04 13:42:00 +02:00
Émilie Feral
05055c387f [apps] Graph: when setting default range of a function, take
into account the potential periodicity
2018-03-22 10:48:06 +01:00
Jacob Young
da1e66e798 Fix #115 by fixing the math.h and cmath includes. 2017-10-13 18:08:15 +02:00
Émilie Feral
be8a0c6df3 [apps] Replace sizeInBits>>2 sizeInBits/sizeof(uint32_t) in checksums
Change-Id: I4f96514caa4552d2158bb9ebdc328a6453554934
2017-08-25 14:18:27 +02:00
Émilie Feral
1964d61fdc [libaxx] add cmath and use cmath instead of math.h when required
Change-Id: Id839b17d33c69e2e002f370e553ff35246a1bc90
2017-08-16 09:55:29 +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
Émilie Feral
9800cf6467 [apps/shared] In interactive range, fix bug
Change-Id: Ie1034cbe7898556a3b78a39ef8b1e6cbe42cd5a5
2017-06-05 11:38:25 +02:00
Émilie Feral
39f422a95a [apps/shared] In interactive curve view controller, repaire bugs due to
wrong initialisation of the range

Change-Id: I2222e27df19b8130ddb3926eba584f7e6d90b7ba
2017-06-05 11:17:17 +02:00
Émilie Feral
a54e45e8ef [apps.shared] In interactive curve view range, avoid inconsistent window
range

Change-Id: Iaa787b0c96b3ccdc34249c9649f3378182cf7f69
2017-06-02 14:07:56 +02:00
Émilie Feral
7d057e6b7a [apps/shared] Fix edge cases in interactive curve view range
Change-Id: Id7b397f516d43f9fe6d9d5522ef614b4198e3b69
2017-05-30 10:55:36 +02:00
Émilie Feral
6b2ae04a13 [apps/sequence][apps/regression][apps/graph] Move ranges and cursor in
snapshot

Change-Id: I3e5a163ae4b3a6860969ef12d939513cffed7710
2017-05-18 14:16:41 +02:00
Émilie Feral
0ec90c36f8 [apps/shared] In range, never set NAN values
Change-Id: I7511952acafdedb5b85aeee38232abe153523a49
2017-04-13 16:04:49 +02:00
Émilie Feral
e95ea50d3c [apps/shared] Fix bug in go to parameter controllers
Change-Id: I196378c4921583af42dc4a2e64e3a6c32038f9d1
2017-03-29 18:36:47 +02:00
Émilie Feral
ffd6e61328 [apps/shared] In range, fix bug when clipping range values
Change-Id: Ibd6dd8bf5668aaabc9f47c781a606b41cb64e6db
2017-03-29 18:36:46 +02:00
Émilie Feral
784fe53679 [apps/calculation] Reset expression scroll when changing selection
Change-Id: Ia2a46a7d39c735d55947cca03a8f84e1f711d12b
2017-03-29 15:04:26 +02:00
Émilie Feral
bb718b07c7 [apps/sequence] Clip default range initialisation to 0 on X range for
sequences

Change-Id: I501a397ce3016ba605bd9aca950b87a2ca295000
2017-03-28 14:49:27 +02:00
Émilie Feral
dc6acc0d48 [apps/shared] Clip displayed range in graph view in interactive curve
view range

Change-Id: I4654a1f9c06420d6ade8a86a13c0d89f025f324f
2017-03-20 14:55:59 +01:00
Émilie Feral
b218beb3c6 [apps/graph] Avoid setting the curve view range to infinite values
Change-Id: I33efddacec47e76d298823e6f7c7aadd49c93c4f
2017-03-02 15:35:03 +01:00
Émilie Feral
e5e9f7cc41 [poincare][apps] Make preferences a const object accessible from
anywhere (poincare and apps)

Change-Id: I49cc6bf940d1efeb6b153daac949ffcb23999a8d
2017-02-20 09:39:24 +01:00
Émilie Feral
23026b6718 [apps/shared] Namespace shared
Change-Id: I6dec7ce900bb4e801a25c567fe5e242cb744cf29
2017-02-13 17:15:06 +01:00