diff --git a/src/GraphingInterfaces/GraphingEnums.h b/src/GraphingInterfaces/GraphingEnums.h index 0686d74..47139ad 100644 --- a/src/GraphingInterfaces/GraphingEnums.h +++ b/src/GraphingInterfaces/GraphingEnums.h @@ -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, diff --git a/src/GraphingInterfaces/IEquation.h b/src/GraphingInterfaces/IEquation.h new file mode 100644 index 0000000..f49a0f9 --- /dev/null +++ b/src/GraphingInterfaces/IEquation.h @@ -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 GetGraphEquationOptions() const = 0; + + virtual unsigned int GetGraphEquationID() const = 0; + + virtual bool TrySelectEquation() = 0; + virtual bool IsEquationSelected() const = 0; + }; +} \ No newline at end of file diff --git a/src/GraphingInterfaces/IEquationOptions.h b/src/GraphingInterfaces/IEquationOptions.h new file mode 100644 index 0000000..1bdd073 --- /dev/null +++ b/src/GraphingInterfaces/IEquationOptions.h @@ -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; + }; +} \ No newline at end of file diff --git a/src/GraphingInterfaces/IGraph.h b/src/GraphingInterfaces/IGraph.h index 65322d9..9cabaf7 100644 --- a/src/GraphingInterfaces/IGraph.h +++ b/src/GraphingInterfaces/IGraph.h @@ -3,6 +3,8 @@ #include "Common.h" #include "IGraphingOptions.h" #include "IGraphRenderer.h" +#include "IEquation.h" +#include namespace Graphing { @@ -10,10 +12,12 @@ namespace Graphing { virtual ~IGraph() = default; - virtual bool TryInitialize(const IExpression* graphingExp) = 0; + virtual std::optional>> TryInitialize(const IExpression* graphingExp) = 0; virtual IGraphingOptions& GetOptions() = 0; virtual std::shared_ptr< Renderer::IGraphRenderer > GetRenderer() const = 0; + + virtual bool TryResetSelection() = 0; }; } diff --git a/src/GraphingInterfaces/IGraphRenderer.h b/src/GraphingInterfaces/IGraphRenderer.h index 85af9fe..ce72d86 100644 --- a/src/GraphingInterfaces/IGraphRenderer.h +++ b/src/GraphingInterfaces/IGraphRenderer.h @@ -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; diff --git a/src/MockGraphingImpl/MockGraphingImpl.vcxproj b/src/MockGraphingImpl/MockGraphingImpl.vcxproj index f01ea4d..24c70f4 100644 --- a/src/MockGraphingImpl/MockGraphingImpl.vcxproj +++ b/src/MockGraphingImpl/MockGraphingImpl.vcxproj @@ -273,6 +273,8 @@ + + @@ -294,4 +296,4 @@ - \ No newline at end of file +