Add Pan/Zoom support for the graph surface (#458)

Description of the changes:
Add Pan/Zoom support for the graph surface.
Currently only supports Mouse/Pen/Touch interactions. Keyboard support will be added separately.

How changes were validated:
Manual
This commit is contained in:
Daniel Belcher
2019-04-22 14:29:57 -07:00
committed by GitHub
parent 091732aa94
commit 5ffe1bc858
4 changed files with 161 additions and 26 deletions

View File

@@ -326,24 +326,18 @@ namespace Graphing
// Zoom out on all axes by the predefined ratio
ZoomOut,
// Zoom out on X axis only, leave the range of Y (and Z in 3D) unchanged
// Zoom out on X axis only, leave the range of Y unchanged
WidenX,
// Zoom in on X axis only, leave the range of Y (and Z in 3D) unchanged
// Zoom in on X axis only, leave the range of Y unchanged
ShrinkX,
// Zoom out on Y axis only, leave the range of X (and Z in 3D) unchanged
// Zoom out on Y axis only, leave the range of X unchanged
WidenY,
// Zoom in on Y axis only, leave the range of X (and Z in 3D) unchanged
// Zoom in on Y axis only, leave the range of X unchanged
ShrinkY,
// Zoom out on Z axis only, leave the range of X and Y unchanged. Apply to 3D graph only but not 2D graph.
WidenZ,
// Zoom in on Z axis only, leave the range of X and Y unchanged. Apply to 3D graph only but not 2D graph.
ShrinkZ,
// Move the view window of the graph towards the negative X axis.
MoveNegativeX,
@@ -356,12 +350,6 @@ namespace Graphing
// Move the view window of the graph towards the positive Y axis.
MovePositiveY,
// Move the view window of the graph towards the negative Z axis.
MoveNegativeZ,
// Move the view window of the graph towards the positive Z axis.
MovePositiveZ,
// Zoom in on all axes by the predefined ratio. The ratio is smaller than used in ZoomIn result in a smoother motion
SmoothZoomIn,

View File

@@ -16,5 +16,10 @@ namespace Graphing::Renderer
virtual HRESULT DrawD2D1(ID2D1Factory* pDirect2dFactory, ID2D1RenderTarget* pRenderTarget, bool& hasSomeMissingDataOut) = 0;
virtual HRESULT GetClosePointData(float inScreenPointX, float inScreenPointY, int& formulaIdOut, float& xScreenPointOut, float& yScreenPointOut, float& xValueOut, float& yValueOut) = 0;
virtual HRESULT ScaleRange(double centerX, double centerY, double scale) = 0;
virtual HRESULT ChangeRange(ChangeRangeAction action) = 0;
virtual HRESULT MoveRangeByRatio(double ratioX, double ratioY) = 0;
virtual HRESULT ResetRange() = 0;
};
}