/*
* This file is part of project OpenEmbroidery. It's copyrighted by
* the contributors recorded in the version control history of the file.
* Original project location https://code.electrolab.fr/openEmbroidery/openEmbroidery_software
*
* SPDX-License-Identifier: CECILL-2.1
* License-Filename: Licence_CeCILL_V2.1-en.txt
*/

#pragma once

#include "actions/OE_actions.h"
#include "stitchs/OE_linkstitch.h"

class OE_actionAddPointLinkStitch : public OE_actions
{
	public:
		OE_actionAddPointLinkStitch(OE_document* doc, OE_linkstitch* stitch, int _pos, vector_2d _point);

		virtual ~OE_actionAddPointLinkStitch();

		virtual void undo();
		virtual void redo();

		void setOffset(vector_2d _offset);

	protected:
		OE_linkstitch* actionStitch;
		vector_2d point;
		vector_2d offset;
		int pos;
};

class OE_actionMovePointLinkStitch : public OE_actions
{
	public:
		OE_actionMovePointLinkStitch(OE_document* doc, OE_linkstitch* stitch, int _pos, vector_2d _offet);

		virtual ~OE_actionMovePointLinkStitch();

		virtual void undo();
		virtual void redo();

		void setOffset(vector_2d offset);

	protected:
		OE_linkstitch* actionStitch;
		vector_2d oldPoint;
		vector_2d offset;
		int pos;
};

class OE_actionDelPointLinkStitch : public OE_actions
{
	public:
		OE_actionDelPointLinkStitch(OE_document* doc, OE_linkstitch* stitch, int _pos);

		virtual ~OE_actionDelPointLinkStitch();

		virtual void undo();
		virtual void redo();

	protected:
		OE_linkstitch* actionStitch;
		vector_2d point;
		int pos;
};

