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
buckettool.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 BUCKETTOOL_H
19#define BUCKETTOOL_H
20
21#include "stroketool.h"
22
23#include "bitmapimage.h"
24#include "bitmapbucket.h"
25
26class Layer;
27class VectorImage;
28
29class BucketTool : public BaseTool
30{
31 Q_OBJECT
32public:
33 explicit BucketTool(QObject* parent = nullptr);
34
35 QCursor cursor() override;
36 ToolType type() const override { return BUCKET; }
37
38 ToolProperties& toolProperties() override { return mSettings.toolProperties(); }
39 const BucketToolProperties& settings() const { return mSettings; }
40
41 void loadSettings() override;
42
43 void pointerPressEvent(PointerEvent*) override;
44 void pointerMoveEvent(PointerEvent*) override;
45 void pointerReleaseEvent(PointerEvent*) override;
46
47 void paintBitmap();
48 void paintVector(Layer* layer);
49
50 void applyChanges();
51
52 void setStrokeThickness(qreal width);
53 void setColorTolerance(int tolerance);
54 void setColorToleranceEnabled(bool enabled);
55 void setFillExpand(int fillExpandValue);
56 void setFillExpandEnabled(bool enabled);
57 void setFillReferenceMode(int referenceMode);
58 void setFillMode(int mode);
59
60 QPointF getCurrentPoint() const;
61 QPointF getCurrentPixel() const;
62
63signals:
64 void fillModeChanged(int mode);
65 void fillReferenceModeChanged(int referenceMode);
66 void fillExpandEnabledChanged(bool isON);
67 void fillExpandChanged(int fillExpandValue);
68 void toleranceEnabledChanged(bool isON);
69 void toleranceChanged(int width);
70 void strokeThicknessChanged(qreal width);
71
72private:
73
74 BitmapBucket mBitmapBucket;
75 VectorImage* vectorImage = nullptr;
76
77 bool mFilledOnMove = false;
78
79 BucketToolProperties mSettings;
80 StrokeInterpolator mInterpolator;
81 const UndoSaveState* mUndoSaveState = nullptr;
82};
83
84#endif // BUCKETTOOL_H
BaseTool
Definition: basetool.h:47
BitmapBucket
Definition: bitmapbucket.h:35
BucketTool
Definition: buckettool.h:30
Layer
Definition: layer.h:33
PointerEvent
Definition: pointerevent.h:8
StrokeInterpolator
Definition: strokeinterpolator.h:30
VectorImage
Definition: vectorimage.h:32
QCursor
QObject
QObject::Q_OBJECT
Q_OBJECTQ_OBJECT
QObject::parent
QObject * parent() const const
QPointF
BucketToolProperties
Definition: toolproperties.h:490
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