mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
The new zoom implemented for ContinuousFunction is now factorized inside Function to benefit the Sequence class. The same things is done to code added to Graph::GraphController, which is moved into FunctionGraphController. This removes the reimplementation of several methods, most notably computeYRange, as the implementation for function is general enough to work on sequences. Change-Id: I9b8211354064f46c3fa3dde3191dcb39d627a1d2
30 lines
846 B
C++
30 lines
846 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:
|
|
static constexpr float k_defaultXHalfRange = 10.0f;
|
|
bool didChangeRange(InteractiveCurveViewRange * interactiveCurveViewRange);
|
|
virtual float interestingXMin() const { return -k_defaultXHalfRange; }
|
|
virtual bool defaultRangeIsNormalized() const { return false; }
|
|
virtual void interestingRanges(InteractiveCurveViewRange * range) 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
|