2016-05-17 03:04:11 +12:00
|
|
|
#pragma once
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
#ifndef MORPH_TOOOL
|
|
|
|
#define MORPH_TOOOL
|
|
|
|
|
|
|
|
// #include "tstroke.h"
|
|
|
|
#include "tools/tool.h"
|
|
|
|
#include "tvectorimage.h"
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
class MorphTool {
|
|
|
|
TPointD m_lastPos;
|
|
|
|
TPointD m_curPos;
|
|
|
|
TPointD m_firstPos;
|
|
|
|
TAffine m_transformation;
|
|
|
|
TPointD m_delta;
|
|
|
|
TVectorImageP m_vi, m_vi2;
|
|
|
|
|
|
|
|
bool m_active;
|
|
|
|
bool m_dragging;
|
|
|
|
double m_pixelSize;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
public:
|
2016-06-15 18:43:10 +12:00
|
|
|
MorphTool();
|
|
|
|
~MorphTool();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
void setImage(const TVectorImageP &vi);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
void leftButtonDown(const TPointD &pos, const TMouseEvent &e);
|
|
|
|
void leftButtonDrag(const TPointD &pos, const TMouseEvent &e);
|
|
|
|
void leftButtonUp(const TPointD &pos, const TMouseEvent &e);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
2018-02-19 19:34:13 +13:00
|
|
|
bool keyDown(QKeyEvent *event);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
void draw();
|
2016-03-19 06:57:51 +13:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|