Pencil2D Animation
Download Community News Docs Contribute
  • Overview
  • Articles
  • Code
  •  
  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • File List
Loading...
Searching...
No Matches
  • core_lib
  • src
  • tool
movetool.h
1/*
2
3Pencil2D - Traditional Animation Software
4Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon
5Copyright (C) 2012-2020 Matthew Chiawen Chang
6
7This program is free software; you can redistribute it and/or
8modify it under the terms of the GNU General Public License
9as published by the Free Software Foundation; version 2 of the License.
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16*/
17
18#ifndef MOVETOOL_H
19#define MOVETOOL_H
20
21#include "transformtool.h"
22#include "movemode.h"
23#include "preferencemanager.h"
24#include "undoredomanager.h"
25
26class Layer;
27class VectorImage;
28
29
30class MoveTool : public TransformTool
31{
32 Q_OBJECT
33public:
34 explicit MoveTool(QObject* parent);
35 QCursor cursor() override;
36
37 QCursor cursor(MoveMode mode) const;
38 ToolType type() const override;
39
40 ToolProperties& toolProperties() override { return mSettings.toolProperties(); }
41 void loadSettings() override;
42
43 void pointerPressEvent(PointerEvent*) override;
44 void pointerReleaseEvent(PointerEvent*) override;
45 void pointerMoveEvent(PointerEvent*) override;
46
47 bool leavingThisTool() override;
48 bool isActive() const override;
49
50private:
51 void applyTransformation();
52 void updateSettings(const SETTING setting);
53
54 void beginInteraction(const QPointF& pos, Qt::KeyboardModifiers keyMod, Layer* layer);
55 void createVectorSelection(const QPointF& pos, Qt::KeyboardModifiers keyMod, Layer* layer);
56 void transformSelection(const QPointF& pos, Qt::KeyboardModifiers keyMod);
57 void storeClosestVectorCurve(const QPointF& pos, Layer* layer);
58
59 void setCurveSelected(VectorImage* vectorImage, Qt::KeyboardModifiers keyMod);
60 void setAreaSelected(const QPointF& pos, VectorImage* vectorImage, Qt::KeyboardModifiers keyMod);
61
62 Layer* currentPaintableLayer();
63
64 QPointF mCurrentPoint;
65 qreal mRotatedAngle = 0.0;
66 int mRotationIncrement = 0;
67 MoveMode mPerspMode;
68 QPointF mOffset;
69
70 const UndoSaveState* mUndoSaveState = nullptr;
71};
72
73#endif
Layer
Definition: layer.h:33
MoveTool
Definition: movetool.h:31
MoveTool::createVectorSelection
void createVectorSelection(const QPointF &pos, Qt::KeyboardModifiers keyMod, Layer *layer)
MoveTool::createVectorSelection In vector the selection rectangle is based on the bounding box of the...
Definition: movetool.cpp:263
MoveTool::isActive
bool isActive() const override
Check if the tool is active.
Definition: movetool.cpp:344
MoveTool::leavingThisTool
bool leavingThisTool() override
Will clean up active connections.
Definition: movetool.cpp:332
MoveTool::storeClosestVectorCurve
void storeClosestVectorCurve(const QPointF &pos, Layer *layer)
MoveTool::storeClosestVectorCurve stores the curves closest to the mouse position in mClosestCurves.
Definition: movetool.cpp:312
PointerEvent
Definition: pointerevent.h:8
TransformTool
Definition: transformtool.h:23
VectorImage
Definition: vectorimage.h:32
QCursor
QObject
QObject::Q_OBJECT
Q_OBJECTQ_OBJECT
QObject::parent
QObject * parent() const const
QPointF
Qt::KeyboardModifiers
typedef KeyboardModifiers
ToolProperties
Definition: toolproperties.h:204
UndoSaveState
This is the main undo/redo state structure which is meant to populate whatever states that needs to b...
Definition: undoredomanager.h:80
Generated on Tue Jan 6 2026 11:38:51 for Pencil2D by doxygen 1.9.6 based on revision f91a96748ec6712509b9b0ff47979db9c34d556f