mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-20 09:17:23 +01:00
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
30 lines
873 B
C++
30 lines
873 B
C++
#ifndef SHARED_INTERACTIVE_CURVE_VIEW_DELEGATE_H
|
|
#define SHARED_INTERACTIVE_CURVE_VIEW_DELEGATE_H
|
|
|
|
#include <assert.h>
|
|
|
|
namespace Shared {
|
|
|
|
class InteractiveCurveViewRange;
|
|
|
|
class InteractiveCurveViewRangeDelegate {
|
|
public:
|
|
bool didChangeRange(InteractiveCurveViewRange * interactiveCurveViewRange);
|
|
virtual float interestingXMin() const { return -interestingXHalfRange(); }
|
|
virtual float interestingXHalfRange() const { return 10.0f; }
|
|
virtual bool defaultRangeIsNormalized() const { return false; }
|
|
virtual void interestingRanges(float * xm, float * xM, float * ym, float * yM) const { assert(false); }
|
|
virtual float addMargin(float x, float range, bool isVertical, bool isMin) = 0;
|
|
protected:
|
|
struct Range {
|
|
float min;
|
|
float max;
|
|
};
|
|
private:
|
|
virtual Range computeYRange(InteractiveCurveViewRange * interactiveCurveViewRange) = 0;
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|