Files
Upsilon/apps/shared/interactive_curve_view_range_delegate.h
Gabriel Ozouf a9aeae94df [shared] Create helper functions for ranges
These functions are used to test the full algorithm used to compute
ranges.

Change-Id: I48069e245aa6e879f66aecc29709fc6f992f5220
2020-12-07 15:58:56 +01:00

29 lines
979 B
C++

#ifndef SHARED_INTERACTIVE_CURVE_VIEW_DELEGATE_H
#define SHARED_INTERACTIVE_CURVE_VIEW_DELEGATE_H
#include <poincare/context.h>
#include <assert.h>
namespace Shared {
class InteractiveCurveViewRange;
class FunctionStore;
class InteractiveCurveViewRangeDelegate {
public:
static constexpr float k_defaultXHalfRange = 10.0f;
static void InterestingRangesHelper(InteractiveCurveViewRange * range, Poincare::Context * context, FunctionStore * functionStore, float targetRatio);
static float AddMarginHelper(float x, float range, bool isVertical, bool isMin, float top, float bottom, float left, float right);
virtual float interestingXMin() const { return -k_defaultXHalfRange; }
virtual bool defaultRangeIsNormalized() const { return false; }
virtual void interestingRanges(InteractiveCurveViewRange * range) { assert(false); }
virtual float addMargin(float x, float range, bool isVertical, bool isMin) = 0;
virtual void updateZoomButtons() = 0;
};
}
#endif