Commit Graph

74 Commits

Author SHA1 Message Date
Gabriel Ozouf
fe950386a0 [interactive_curve_view_range] Fix assert
Change-Id: I2ff3cfe90f10b33db3e18b321cf931c9f0946479
2020-11-04 15:58:37 +01:00
Gabriel Ozouf
ad7890a19c [interactive_curve_view_range] Missing refresh
Fixes the following bug :
  - Plot ln(x) (or any other curve that's normlalized by default)
  - Go back and replace ln(x) with log(x) (or any other curve that's NOT
    normalized by default)
--> The 'Equal Axes' button is still on.

Change-Id: I0ef50dc9866e908894bd4f5c3ade198f9b3ea318
2020-11-04 15:58:37 +01:00
Hugo Saint-Vignes
aa50a5eb7c [apps/shared] Silence warning for unused variable
Change-Id: I1df4a8c111688e00a82d4448d47fd571fec738e4
2020-11-04 15:58:36 +01:00
Gabriel Ozouf
3b24f9c2c3 [interactive_curve_view_range] Check auto status
Deactivate Auto status every time the range effectively changes.

Change-Id: I695b840d5e72061a73a229a6e726433660bdfdbf
2020-11-04 15:58:31 +01:00
Gabriel Ozouf
5a5955b513 [interactive_curve_view_range] Status unchanged
Only notify the delegate to the refresh the button when the status has
changed.

Change-Id: I6689d2c292ff96039a68cd1b437b18df5fb98829
2020-11-04 15:58:31 +01:00
Gabriel Ozouf
82a77df088 [interactive_curve_view_range] Missing resets
Added some missing resets of the Auto and Normalize statuses

Change-Id: I5514a2566c1f6ba73d04b526402b428b2edce4b4
2020-11-04 15:58:31 +01:00
Hugo Saint-Vignes
bb8a28ade0 [poincare/zoom] Simplify plot ranges after adding margins
Change-Id: If8904ca4e7d306376de785a125fe5fba168de718
2020-11-04 15:58:26 +01:00
Hugo Saint-Vignes
2f97dab6d1 [apps/shared] Add toggle buttons in Graph view
Change-Id: I7548d11fb114b2605ce34d3bda0776277b79ff9d
2020-11-04 15:58:25 +01:00
Gabriel Ozouf
c4cd3ecffa [poincare/zoom] Factor range sanitation
Checking wether the range that has been computed is suitable is now
done in Poincare::Zoom by SanitizeRange.

Change-Id: Ib7ff73a3beae29996b1a773744021ad85c6ba946
2020-11-04 15:58:22 +01:00
Gabriel Ozouf
3ba4f974f7 [interactive_curve_view_range] Move status update
The methods setDefault and normalize now update the zoomAuto and
zoomNormalize status.

Change-Id: I0400c22816c17d38fd1b3dee5c8a2f1ccfa79340
2020-11-04 15:58:21 +01:00
Gabriel Ozouf
958b172d08 [poincare/zoom] Handle undefined functions
Rework the logic so that :
  - an undefined function will be displayed with a clealry defined
    null range.
  - display both an undefined function and a correct function at the
    same time will not affect the correct range.

Change-Id: Ife9dc0d2ace667cab5a6b8826347078fca33e4d5
2020-11-04 15:58:21 +01:00
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