Files
Upsilon/apps/shared/interactive_curve_view_range.h
Émilie Feral dc6acc0d48 [apps/shared] Clip displayed range in graph view in interactive curve
view range

Change-Id: I4654a1f9c06420d6ade8a86a13c0d89f025f324f
2017-03-20 14:55:59 +01:00

49 lines
1.4 KiB
C++

#ifndef SHARED_INTERACTIVE_CURVE_VIEW_RANGE_H
#define SHARED_INTERACTIVE_CURVE_VIEW_RANGE_H
#include <stdint.h>
#include "memoized_curve_view_range.h"
#include "curve_view_cursor.h"
#include "interactive_curve_view_range_delegate.h"
namespace Shared {
class InteractiveCurveViewRange : public MemoizedCurveViewRange {
public:
InteractiveCurveViewRange(CurveViewCursor * cursor, InteractiveCurveViewRangeDelegate * delegate);
void setCursor(CurveViewCursor * cursor);
uint32_t rangeChecksum() override;
//CurveViewWindow
bool yAuto();
void setXMin(float f) override;
void setXMax(float f) override;
void setYMin(float f) override;
void setYMax(float f) override;
void setYAuto(bool yAuto);
// Window
void zoom(float ratio);
void panWithVector(float x, float y);
void roundAbscissa();
void normalize();
void setTrigonometric();
virtual void setDefault();
void centerAxisAround(Axis axis, float position);
void panToMakePointVisible(float x, float y, float topMarginRatio, float rightMarginRatio, float bottomMarginRation, float leftMarginRation);
protected:
bool m_yAuto;
private:
constexpr static float k_minFloat = 1E-8f;
CurveViewCursor * m_cursor;
InteractiveCurveViewRangeDelegate * m_delegate;
};
typedef void (InteractiveCurveViewRange::*ParameterSetterPointer)(float);
typedef float (InteractiveCurveViewRange::*ParameterGetterPointer)();
typedef void (InteractiveCurveViewRange::*RangeMethodPointer)();
}
#endif