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
polylinetool.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 POLYLINETOOL_H
19#define POLYLINETOOL_H
20
21#include <QPointF>
22
23#include "stroketool.h"
24
25class PolylineTool : public StrokeTool
26{
27 Q_OBJECT
28public:
29 explicit PolylineTool(QObject* parent = 0);
30 ToolType type() override;
31 void loadSettings() override;
32 void saveSettings() override;
33 QCursor cursor() override;
34 void resetToDefault() override;
35
36 void pointerPressEvent(PointerEvent*) override;
37 void pointerReleaseEvent(PointerEvent*) override;
38 void pointerMoveEvent(PointerEvent* event) override;
39 void pointerDoubleClickEvent(PointerEvent*) override;
40
41 bool keyPressEvent(QKeyEvent* event) override;
42 bool keyReleaseEvent(QKeyEvent* event) override;
43
44 void clearToolData() override;
45
46 void setWidth(const qreal width) override;
47 void setFeather(const qreal feather) override;
48 void setAA(const int AA) override;
49 void setClosedPath(const bool closed) override;
50
51 bool leavingThisTool() override;
52
53 bool isActive() const override;
54
55private:
56 QList<QPointF> mPoints;
57 bool mClosedPathOverrideEnabled = false;
58
59 void drawPolyline(QList<QPointF> points, QPointF endPoint);
60 void removeLastPolylineSegment();
61 void cancelPolyline();
62 void endPolyline(QList<QPointF> points);
63};
64
65#endif // POLYLINETOOL_H
PointerEvent
Definition: pointerevent.h:8
PolylineTool
Definition: polylinetool.h:26
PolylineTool::isActive
bool isActive() const override
Check if the tool is active.
Definition: polylinetool.cpp:117
PolylineTool::leavingThisTool
bool leavingThisTool() override
Will clean up active connections.
Definition: polylinetool.cpp:107
StrokeTool
Definition: stroketool.h:34
QCursor
QKeyEvent
QList
QObject
QObject::Q_OBJECT
Q_OBJECTQ_OBJECT
QObject::event
virtual bool event(QEvent *e)
QObject::parent
QObject * parent() const const
QPointF
Generated on Thu May 8 2025 04:47:53 for Pencil2D by doxygen 1.9.6 based on revision 4513250b1d5b1a3676ec0e67b06b7a885ceaae39