Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifndef MORPH_TOOOL
Toshihiro Shimizu 890ddd
#define MORPH_TOOOL
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
// #include "tstroke.h"
Toshihiro Shimizu 890ddd
#include "tools/tool.h"
Toshihiro Shimizu 890ddd
#include "tvectorimage.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class MorphTool
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	TPointD m_lastPos;
Toshihiro Shimizu 890ddd
	TPointD m_curPos;
Toshihiro Shimizu 890ddd
	TPointD m_firstPos;
Toshihiro Shimizu 890ddd
	TAffine m_transformation;
Toshihiro Shimizu 890ddd
	TPointD m_delta;
Toshihiro Shimizu 890ddd
	TVectorImageP m_vi, m_vi2;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool m_active;
Toshihiro Shimizu 890ddd
	bool m_dragging;
Toshihiro Shimizu 890ddd
	double m_pixelSize;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	MorphTool();
Toshihiro Shimizu 890ddd
	~MorphTool();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void setImage(const TVectorImageP &vi);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void leftButtonDown(const TPointD &pos, const TMouseEvent &e);
Toshihiro Shimizu 890ddd
	void leftButtonDrag(const TPointD &pos, const TMouseEvent &e);
Toshihiro Shimizu 890ddd
	void leftButtonUp(const TPointD &pos, const TMouseEvent &e);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool keyDown(int key, TUINT32 flags, const TPoint &pos);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void draw();
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif