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
  • managers
overlaymanager.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 OVERLAYMANAGER_H
19#define OVERLAYMANAGER_H
20
21#include "pencildef.h"
22#include "movemode.h"
23#include "basemanager.h"
24
25#include <QPointF>
26
27#include "preferencesdef.h"
28
29class Editor;
30
31class OverlayManager : public BaseManager
32{
33 Q_OBJECT
34
35public:
36 explicit OverlayManager(Editor* editor);
37 ~OverlayManager() override;
38
39 bool init() override;
40 Status load(Object *o) override;
41 Status save(Object *o) override;
42
43 void settingsUpdated(SETTING setting, bool state);
44
45 void workingLayerChanged(Layer *) override;
46
47 MoveMode getMoveModeForPoint(const QPointF& pos, const QTransform& transform);
48 double selectionTolerance();
49
50 void updatePerspective(const QPointF& point);
51
52 MoveMode getMoveMode() const { return mMoveMode; }
53 void setMoveMode(MoveMode mode) { mMoveMode = mode; }
54 QPointF getSinglePerspectivePoint() const { return mSinglePerspectivePoint; }
55 QPointF getLeftPerspectivePoint() const { return mLeftPerspectivePoint; }
56 QPointF getRightPerspectivePoint() const { return mRightPerspectivePoint; }
57 QPointF getMiddlePerspectivePoint() const { return mMiddlePerspectivePoint; }
58
59 bool anyOverlayEnabled() const { return mSinglePerspectiveEnabled || mTwoPointPerspectiveEnabled || mThreePointPerspectiveEnabled; }
60
61private:
62 Editor* mEditor = nullptr;
63
64 QPointF mSinglePerspectivePoint; // for single point perspective.
65 QPointF mLeftPerspectivePoint;
66 QPointF mRightPerspectivePoint; // Left, right and middle are for
67 QPointF mMiddlePerspectivePoint; // two and three point perspective
68
69 MoveMode mMoveMode = MoveMode::NONE;
70
71 bool mSinglePerspectiveEnabled = false;
72 bool mTwoPointPerspectiveEnabled = false;
73 bool mThreePointPerspectiveEnabled = false;
74
75 const qreal mSelectionTolerance = 8.0;
76};
77
78#endif // OVERLAYMANAGER_H
BaseManager
Definition: basemanager.h:29
Editor
Definition: editor.h:71
Layer
Definition: layer.h:33
Object
Definition: object.h:42
OverlayManager
Definition: overlaymanager.h:32
Status
Definition: pencilerror.h:40
QObject::Q_OBJECT
Q_OBJECTQ_OBJECT
QPointF
QTransform
Generated on Thu May 8 2025 04:47:53 for Pencil2D by doxygen 1.9.6 based on revision 4513250b1d5b1a3676ec0e67b06b7a885ceaae39