krita
kis_tool_freehand.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KIS_TOOL_FREEHAND_H_
00022 #define KIS_TOOL_FREEHAND_H_
00023
00024 #include "kis_types.h"
00025 #include "kis_tool_paint.h"
00026 #include "kis_point.h"
00027 #include "koffice_export.h"
00028
00029 class KisPainter;
00030 class KisBrush;
00031 class KisEvent;
00032 class KisPaintLayer;
00033
00034
00035 class KRITACORE_EXPORT KisToolFreehand : public KisToolPaint {
00036 Q_OBJECT
00037 typedef KisToolPaint super;
00038
00039 public:
00040 KisToolFreehand(const QString transactionText);
00041 virtual ~KisToolFreehand();
00042
00043 virtual void update(KisCanvasSubject *subject);
00044
00045 virtual void buttonPress(KisButtonPressEvent *e);
00046 virtual void move(KisMoveEvent *e);
00047 virtual void buttonRelease(KisButtonReleaseEvent *e);
00048
00049 virtual enumToolType toolType() { return TOOL_FREEHAND; }
00050
00051 protected:
00052 virtual void paintAt(const KisPoint &pos,
00053 const double pressure,
00054 const double xTilt,
00055 const double yTilt);
00056
00057 virtual void paintLine(const KisPoint & pos1,
00058 const double pressure1,
00059 const double xtilt1,
00060 const double ytilt1,
00061 const KisPoint & pos2,
00062 const double pressure2,
00063 const double xtilt2,
00064 const double ytilt2);
00065
00066
00067
00068 inline KisPainter * painter() { return m_painter; };
00069 virtual void initPaint(KisEvent *e);
00070 virtual void endPaint();
00071
00072 KisImageSP currentImage();
00073
00074 void paintOutline(const KisPoint& point);
00075
00076 protected:
00077 KisPoint m_prevPos;
00078 double m_prevPressure;
00079 double m_prevXTilt;
00080 double m_prevYTilt;
00081 double m_dragDist;
00082
00083 bool m_paintIncremental;
00084 bool m_paintOnSelection;
00085
00086 KisPaintDeviceSP m_target;
00087 KisLayerSP m_tempLayer;
00088 KisPaintDeviceSP m_source;
00089
00090 QString m_transactionText;
00091 enumBrushMode m_mode;
00092 KisPainter *m_painter;
00093
00094 KisImageSP m_currentImage;
00095 private:
00096 bool m_paintedOutline;
00097 };
00098
00099
00100
00101 #endif // KIS_TOOL_FREEHAND_H_
00102
|