2019-12-26 12:58:58 -05:00
|
|
|
#pragma once
|
|
|
|
|
|
2019-12-29 02:38:41 -05:00
|
|
|
#include "IPlotter.h"
|
2019-12-26 12:58:58 -05:00
|
|
|
#include "PlotDirection.h"
|
|
|
|
|
#include "Vec2i.h"
|
|
|
|
|
|
|
|
|
|
namespace PortabilityLayer
|
|
|
|
|
{
|
2019-12-29 02:38:41 -05:00
|
|
|
class LinePlotter final : public IPlotter
|
2019-12-26 12:58:58 -05:00
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
LinePlotter();
|
2019-12-29 02:38:41 -05:00
|
|
|
PlotDirection PlotNext() override;
|
|
|
|
|
const Vec2i &GetPoint() const override;
|
2019-12-26 12:58:58 -05:00
|
|
|
|
|
|
|
|
void Reset(const Vec2i &pointA, const Vec2i &pointB);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
Vec2i m_point;
|
|
|
|
|
Vec2i m_endPoint;
|
|
|
|
|
int32_t m_dx;
|
|
|
|
|
int32_t m_dy;
|
|
|
|
|
int32_t m_err;
|
|
|
|
|
bool m_xIncrPos;
|
|
|
|
|
bool m_yIncrPos;
|
|
|
|
|
|
|
|
|
|
PlotDirection m_xyMove;
|
|
|
|
|
PlotDirection m_xMove;
|
|
|
|
|
PlotDirection m_yMove;
|
|
|
|
|
};
|
|
|
|
|
}
|