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 "basetool.h"
22#include "movemode.h"
23#include "preferencemanager.h"
24#include "undoredomanager.h"
25
26class Layer;
27class VectorImage;
28
29
30class MoveTool : public BaseTool
31{
32 Q_OBJECT
33public:
34 explicit MoveTool(QObject* parent);
35 ToolType type() override;
36 void loadSettings() override;
37 void saveSettings() override;
38 QCursor cursor() override;
39 QCursor cursor(MoveMode mode) const;
40
41 void pointerPressEvent(PointerEvent*) override;
42 void pointerReleaseEvent(PointerEvent*) override;
43 void pointerMoveEvent(PointerEvent*) override;
44
45 bool leavingThisTool() override;
46 bool isActive() const override;
47
48 void resetToDefault() override;
49 void setShowSelectionInfo(const bool b) override;
50
51private:
52 void applyTransformation();
53 void updateSettings(const SETTING setting);
54
55 void beginInteraction(const QPointF& pos, Qt::KeyboardModifiers keyMod, Layer* layer);
56 void createVectorSelection(const QPointF& pos, Qt::KeyboardModifiers keyMod, Layer* layer);
57 void transformSelection(const QPointF& pos, Qt::KeyboardModifiers keyMod);
58 void storeClosestVectorCurve(const QPointF& pos, Layer* layer);
59
60 void setCurveSelected(VectorImage* vectorImage, Qt::KeyboardModifiers keyMod);
61 void setAreaSelected(const QPointF& pos, VectorImage* vectorImage, Qt::KeyboardModifiers keyMod);
62
63 Layer* currentPaintableLayer();
64
65 QPointF mCurrentPoint;
66 qreal mRotatedAngle = 0.0;
67 int mRotationIncrement = 0;
68 MoveMode mPerspMode;
69 QPointF mOffset;
70
71 const UndoSaveState* mUndoSaveState = nullptr;
72};
73
74#endif
BaseTool
Definition: basetool.h:70
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:267
MoveTool::isActive
bool isActive() const override
Check if the tool is active.
Definition: movetool.cpp:350
MoveTool::leavingThisTool
bool leavingThisTool() override
Will clean up active connections.
Definition: movetool.cpp:336
MoveTool::storeClosestVectorCurve
void storeClosestVectorCurve(const QPointF &pos, Layer *layer)
MoveTool::storeClosestVectorCurve stores the curves closest to the mouse position in mClosestCurves.
Definition: movetool.cpp:316
PointerEvent
Definition: pointerevent.h:8
VectorImage
Definition: vectorimage.h:32
QCursor
QObject
QObject::Q_OBJECT
Q_OBJECTQ_OBJECT
QObject::parent
QObject * parent() const const
QPointF
Qt::KeyboardModifiers
typedef KeyboardModifiers
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 Thu Jun 5 2025 14:06:43 for Pencil2D by doxygen 1.9.6 based on revision 4c63407997b2c03e5048716586dec6fbbb755173