IntelliPhoto 0.5

IntelliTool.h
Go to the documentation of this file.
1 #ifndef Intelli_Tool_H
2 #define Intelli_Tool_H
3
4 #include "IntelliHelper/IntelliColorPicker.h"
5 #include "IntelliHelper/IntelliToolsettings.h"
6 #include <vector>
7
8 struct LayerObject;
9 class PaintingArea;
10
14 class IntelliTool {
15 public:
16 enum class Tooltype {
17 CIRCLE,
18 FLOODFILL,
19 LINE,
20 PEN,
21 PLAIN,
22 POLYGON,
23 RECTANGLE
24 };
25 private:
29 void createToolLayer();
30
34 void mergeToolLayer();
35
39 void deleteToolLayer();
40 protected:
44 PaintingArea* Area;
45
46 Tooltype ActiveType;
47
51 IntelliColorPicker* colorPicker;
52
53 IntelliToolsettings* Toolsettings;
54
58 LayerObject* activeLayer;
59
63 LayerObject* Canvas;
64
68 bool isDrawing = false;
69
70 public:
76 IntelliTool(PaintingArea* Area, IntelliColorPicker* colorPicker, IntelliToolsettings* Toolsettings);
77
81 virtual ~IntelliTool() = 0;
82
88 virtual void onMouseRightPressed(int x, int y);
89
95 virtual void onMouseRightReleased(int x, int y);
96
102 virtual void onMouseLeftPressed(int x, int y);
103
109 virtual void onMouseLeftReleased(int x, int y);
110
115 virtual void onWheelScrolled(int value);
116
122 virtual void onMouseMoved(int x, int y);
123
124 Tooltype getTooltype();
125
126 bool getIsDrawing();
127
128 };
129 #endif
IntelliTool::Tooltype::PEN
IntelliTool::onMouseRightPressed
virtual void onMouseRightPressed(int x, int y)
A function managing the right click Pressed of a Mouse. Constructing the Canvas to draw on....
Definition: IntelliTool.cpp:15
IntelliTool::onMouseLeftReleased
virtual void onMouseLeftReleased(int x, int y)
A function managing the left click Released of a Mouse. Call this in child classes!
Definition: IntelliTool.cpp:33
IntelliTool::colorPicker
IntelliColorPicker * colorPicker
A pointer to the IntelliColorPicker of the PaintingArea to interact with, and get the colors.
Definition: IntelliTool.h:51
IntelliTool::onMouseLeftPressed
virtual void onMouseLeftPressed(int x, int y)
A function managing the left click Pressed of a Mouse. Resetting the current draw....
Definition: IntelliTool.cpp:26
IntelliTool::Toolsettings
IntelliToolsettings * Toolsettings
Definition: IntelliTool.h:53
IntelliTool::Tooltype::FLOODFILL
IntelliToolsettings.h
IntelliTool::Area
PaintingArea * Area
A pointer to the general PaintingArea to interact with.
Definition: IntelliTool.h:44
IntelliTool::Tooltype
Tooltype
Definition: IntelliTool.h:16
PaintingArea
The PaintingArea class manages the methods and stores information about the current painting area,...
Definition: PaintingArea.h:37
IntelliTool::isDrawing
bool isDrawing
A flag checking if the user is currently drawing or not.
Definition: IntelliTool.h:68
LayerObject
The LayerObject struct holds all the information needed to construct a layer.
Definition: PaintingArea.h:25
IntelliTool::onMouseRightReleased
virtual void onMouseRightReleased(int x, int y)
A function managing the right click Released of a Mouse. Merging the Canvas to Active....
Definition: IntelliTool.cpp:22
IntelliTool::activeLayer
LayerObject * activeLayer
A pointer to the underlying active Layer, do not work on this. This is used for data grabbing or prev...
Definition: IntelliTool.h:58
IntelliTool::Tooltype::PLAIN
IntelliColorPicker.h
IntelliTool::Tooltype::POLYGON
IntelliTool::getTooltype
Tooltype getTooltype()
Definition: IntelliTool.cpp:85
IntelliTool::Canvas
LayerObject * Canvas
A pointer to the drawing canvas of the tool, work on this.
Definition: IntelliTool.h:63
IntelliTool
An abstract class that manages the basic events, like mouse clicks or scrolls events.
Definition: IntelliTool.h:14
IntelliTool::getIsDrawing
bool getIsDrawing()
Definition: IntelliTool.cpp:89
IntelliTool::ActiveType
Tooltype ActiveType
Definition: IntelliTool.h:46
IntelliColorPicker
The IntelliColorPicker manages the selected colors for one whole project.
Definition: IntelliColorPicker.h:11
IntelliTool::IntelliTool
IntelliTool(PaintingArea *Area, IntelliColorPicker *colorPicker, IntelliToolsettings *Toolsettings)
A constructor setting the general Painting Area and colorPicker.
Definition: IntelliTool.cpp:4
IntelliTool::Tooltype::RECTANGLE
IntelliTool::Tooltype::LINE
IntelliTool::onMouseMoved
virtual void onMouseMoved(int x, int y)
A function managing the mouse moved event. Call this in child classes!
Definition: IntelliTool.cpp:42
IntelliTool::onWheelScrolled
virtual void onWheelScrolled(int value)
A function managing the scroll event. A positive value means scrolling outwards. Call this in child c...
Definition: IntelliTool.cpp:47
IntelliToolsettings
Definition: IntelliToolsettings.h:4
IntelliTool::~IntelliTool
virtual ~IntelliTool()=0
An abstract Destructor.
Definition: IntelliTool.cpp:11
IntelliTool::Tooltype::CIRCLE