Updating GraphingInterfaces to use Graphing Engine 2.0 (#561)
* Updated Graphing Interfaces to version 2.0.1
This commit is contained in:
parent
5ffe1bc858
commit
c3c001af28
@ -326,18 +326,24 @@ namespace Graphing
|
||||
// Zoom out on all axes by the predefined ratio
|
||||
ZoomOut,
|
||||
|
||||
// Zoom out on X axis only, leave the range of Y unchanged
|
||||
// Zoom out on X axis only, leave the range of Y (and Z in 3D) unchanged
|
||||
WidenX,
|
||||
|
||||
// Zoom in on X axis only, leave the range of Y unchanged
|
||||
// Zoom in on X axis only, leave the range of Y (and Z in 3D) unchanged
|
||||
ShrinkX,
|
||||
|
||||
// Zoom out on Y axis only, leave the range of X unchanged
|
||||
// Zoom out on Y axis only, leave the range of X (and Z in 3D) unchanged
|
||||
WidenY,
|
||||
|
||||
// Zoom in on Y axis only, leave the range of X unchanged
|
||||
// Zoom in on Y axis only, leave the range of X (and Z in 3D) 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,
|
||||
|
||||
@ -350,6 +356,12 @@ 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,
|
||||
|
||||
|
19
src/GraphingInterfaces/IEquation.h
Normal file
19
src/GraphingInterfaces/IEquation.h
Normal file
@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include "Common.h"
|
||||
#include "IEquationOptions.h"
|
||||
|
||||
namespace Graphing
|
||||
{
|
||||
struct IEquation : public NonCopyable, public NonMoveable
|
||||
{
|
||||
virtual ~IEquation() = default;
|
||||
|
||||
virtual std::shared_ptr<IEquationOptions> GetGraphEquationOptions() const = 0;
|
||||
|
||||
virtual unsigned int GetGraphEquationID() const = 0;
|
||||
|
||||
virtual bool TrySelectEquation() = 0;
|
||||
virtual bool IsEquationSelected() const = 0;
|
||||
};
|
||||
}
|
36
src/GraphingInterfaces/IEquationOptions.h
Normal file
36
src/GraphingInterfaces/IEquationOptions.h
Normal file
@ -0,0 +1,36 @@
|
||||
#pragma once
|
||||
|
||||
#include "Common.h"
|
||||
#include "GraphingEnums.h"
|
||||
|
||||
namespace Graphing
|
||||
{
|
||||
struct IEquationOptions : public NonCopyable, public NonMoveable
|
||||
{
|
||||
virtual ~IEquationOptions() = default;
|
||||
|
||||
virtual Graphing::Color GetGraphColor() const = 0;
|
||||
virtual void SetGraphColor(const Graphing::Color& color) = 0;
|
||||
virtual void ResetGraphColor() = 0;
|
||||
|
||||
virtual Graphing::Renderer::LineStyle GetLineStyle() const = 0;
|
||||
virtual void SetLineStyle(Graphing::Renderer::LineStyle value) = 0;
|
||||
virtual void ResetLineStyle() = 0;
|
||||
|
||||
virtual float GetLineWidth() const = 0;
|
||||
virtual void SetLineWidth(float value) = 0;
|
||||
virtual void ResetLineWidth() = 0;
|
||||
|
||||
virtual float GetSelectedEquationLineWidth() const = 0;
|
||||
virtual void SetSelectedEquationLineWidth(float value) = 0;
|
||||
virtual void ResetSelectedEquationLineWidth() = 0;
|
||||
|
||||
virtual float GetPointRadius() const = 0;
|
||||
virtual void SetPointRadius(float value) = 0;
|
||||
virtual void ResetPointRadius() = 0;
|
||||
|
||||
virtual float GetSelectedEquationPointRadius() const = 0;
|
||||
virtual void SetSelectedEquationPointRadius(float value) = 0;
|
||||
virtual void ResetSelectedEquationPointRadius() = 0;
|
||||
};
|
||||
}
|
@ -3,6 +3,8 @@
|
||||
#include "Common.h"
|
||||
#include "IGraphingOptions.h"
|
||||
#include "IGraphRenderer.h"
|
||||
#include "IEquation.h"
|
||||
#include <optional>
|
||||
|
||||
namespace Graphing
|
||||
{
|
||||
@ -10,10 +12,12 @@ namespace Graphing
|
||||
{
|
||||
virtual ~IGraph() = default;
|
||||
|
||||
virtual bool TryInitialize(const IExpression* graphingExp) = 0;
|
||||
virtual std::optional<std::vector<std::shared_ptr<IEquation>>> TryInitialize(const IExpression* graphingExp) = 0;
|
||||
|
||||
virtual IGraphingOptions& GetOptions() = 0;
|
||||
|
||||
virtual std::shared_ptr< Renderer::IGraphRenderer > GetRenderer() const = 0;
|
||||
|
||||
virtual bool TryResetSelection() = 0;
|
||||
};
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ 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;
|
||||
|
@ -273,6 +273,8 @@
|
||||
<ClInclude Include="..\GraphingInterfaces\IGraphingOptions.h" />
|
||||
<ClInclude Include="..\GraphingInterfaces\IGraphRenderer.h" />
|
||||
<ClInclude Include="..\GraphingInterfaces\IMathSolver.h" />
|
||||
<ClInclude Include="..\GraphingInterfaces\IEquation.h" />
|
||||
<ClInclude Include="..\GraphingInterfaces\IEquationOptions.h" />
|
||||
<ClInclude Include="Mocks\MathSolver.h" />
|
||||
<ClInclude Include="pch.h" />
|
||||
<ClInclude Include="targetver.h" />
|
||||
@ -294,4 +296,4 @@
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
Loading…
Reference in New Issue
Block a user