Commit Graph

63 Commits

Author SHA1 Message Date
Gabriel Ozouf
8ce9f363ad [interactive_curve_view_range] Force equal axes
Added a tolerance when checking orthonormality, so that ranges that are
nearly orthonormal will be made orthonormal.

Change-Id: Ie3bf076086561e3ff6374e7daa9dd1a884c52d5a
2020-11-04 15:58:19 +01:00
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
bcb4b3095b [function_graph_controller] Fix Y range expansion
The method FunctionGraphController::yRangeForCursorFirstMove expands the
Y range to include the values of the first cursor moves on the left and
the right of the center. It has been modified to preserve
orthonormality.

Change-Id: I898ab9721e45e2acde261f8b94b80cab81b39a92
2020-11-04 15:58:16 +01:00
Gabriel Ozouf
f54b15b9c8 [interactive_curve_view_range] Preserve ratio
Preserve orthonormality when adding margins to a default range.

Change-Id: Iaa1da8d36812e2dad1be3894198ee0fabcd3020f
2020-11-04 15:58:16 +01:00
Gabriel Ozouf
5d9c7b0c1f [interactive_curve_view_range] isOrthonormal
Change-Id: I154487908d1a2a11e01b2a4e51ef867e235babab
2020-11-04 15:58:15 +01:00
Gabriel Ozouf
08c96c5107 [poincare/zoom] Method SetToRatio
Added a method to Zoom to set a range to a specific ratio. This method
is used by InteractiveCurveViewRange::normalize.

Change-Id: Id3029439294ece02ea19fb6c6de90b9edc85d771
2020-11-04 15:58:14 +01:00
Gabriel Ozouf
26754a3230 [graph] Force same grid unit on orthonormal graphs
Change-Id: I2abca9eb1c4a14057323ee97e1044715f89620ff
2020-11-04 15:58:13 +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
e2725c8e61 [apps/interactive_curve_view_range] Status markers
Add member variable m_zoomAuto and m_zoomNormalized to remember the
interactive range's status.

Change-Id: I77c43ddd683d3c6011742801139d23f5e20c99fe
2020-11-04 15:58:10 +01:00
Gabriel Ozouf
1a5661fd4c [apps/range_parameter_controller] Remove YAuto
This allows for a great deal of simplifications in the class
RangeParamterController.

Change-Id: I5de55d4e8e1f598eb13b08fb8f042907f55b2fa8
2020-11-04 15:58:08 +01:00
Gabriel Ozouf
5a07db3452 [apps] Remove "Preadjustments" menu for curves
Change-Id: I1a30efd502c5db36325d87fa0f1dffacc37a4f1c
2020-11-04 15:58:08 +01:00
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