/*
* 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 "curves/OE_curve.h"
#include "curves/OE_joincurve.h"
#include "stitchs/OE_stitchs.h"

namespace Pakal { class Archive; }

class OE_birailstitch : public OE_stitchs
{
	public:
		//OE_birailstitch();
		OE_birailstitch(OE_thread* thread);
		OE_birailstitch(OE_thread* thread, bool reverse1, bool reverse2, float offset1, float offset2, float len);
		~OE_birailstitch();

		virtual void persist(Pakal::Archive* archive) override;

		virtual bool check();

		//virtual void refresh();

		virtual void refresh(float dpi, bool force = false);

		virtual void refreshDependency();


		void setReverse1(bool reverse);
		void setOffset1(float offset);
		void setReverse2(bool reverse);
		void setOffset2(float offset);
		void setLen(float len);

		OE_joincurve* getJoincurve1();
		bool getReverse1();
		float getOffset1();
		OE_joincurve* getJoincurve2();
		bool getReverse2();
		float getOffset2();
		float getLen();

		static float defaultLen;

	protected:
		OE_joincurve curve1;
		OE_joincurve curve2;
		bool reverse1;
		float offset1;
		bool reverse2;
		float offset2;
		float len;
};

