calculator/src/GraphingInterfaces/IGraphRenderer.h
Stephanie Anderl 76e33ef159
Updates ResetGrid to account for when equations are added during Manual Adjustment mode (#1231)
* updated the reset grid logic to track and set the initial range after an equation is added

* When in manual adjustment mode and an equation is added, replot the graph when reset is called

* remove members that are no longer needed

* Added logic to include the PrepareGraph() and removed re-graphing in the ResetGrid method

* skip SetDisplayRanges if TryInitialize returns a nullopt so there is no crash

* Updated the logic to handle the case where the range is updated via settings

* Fix bug with reset view hyperlink

* Updated the logic for graph settings updating the graph range

* Rebased with the latest, fixed issues with the rebase

 Author:    Stephanie Anderl <46726333+sanderl@users.noreply.github.com>

* Update the internals version of calculator to the latest so that the PrepareGraph API available
2020-06-17 12:30:19 -07:00

40 lines
1.4 KiB
C++

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#pragma once
#include "Common.h"
struct ID2D1Factory;
struct ID2D1RenderTarget;
namespace Graphing
{
struct IBitmap;
}
namespace Graphing::Renderer
{
struct IGraphRenderer : public NonCopyable, public NonMoveable
{
virtual ~IGraphRenderer() = default;
virtual HRESULT SetGraphSize(unsigned int width, unsigned int height) = 0;
virtual HRESULT SetDpi(float dpiX, float dpiY) = 0;
virtual HRESULT DrawD2D1(ID2D1Factory* pDirect2dFactory, ID2D1RenderTarget* pRenderTarget, bool& hasSomeMissingDataOut) = 0;
virtual HRESULT GetClosePointData(double inScreenPointX, double inScreenPointY, int& formulaIdOut, float& xScreenPointOut, float& yScreenPointOut, double& xValueOut, double& yValueOut, double& rhoValueOut, double& thetaValueOut, double& tValueOut) = 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;
virtual HRESULT GetDisplayRanges(double& xMin, double& xMax, double& yMin, double& yMax) = 0;
virtual HRESULT SetDisplayRanges(double xMin, double xMax, double yMin, double yMax) = 0;
virtual HRESULT PrepareGraph() = 0;
virtual HRESULT GetBitmap(std::shared_ptr<Graphing::IBitmap>& bitmapOut, bool& hasSomeMissingDataOut) = 0;
};
}