IntelliPhoto 0.7

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 //for unit testing
9 class UnitTest;
10
11 struct LayerObject;
12 class PaintingArea;
13
17 class IntelliTool {
18 friend UnitTest;
19 public:
23 enum class Tooltype {
24 CIRCLE,
25 FLOODFILL,
26 GRADIENT,
27 LINE,
28 PEN,
29 PLAIN,
30 POLYGON,
31 RECTANGLE,
32 NONE
33 };
34 private:
39 bool createToolLayer();
40
44 void mergeToolLayer();
45
49 void deleteToolLayer();
50 protected:
54 PaintingArea* Area;
55
59 Tooltype ActiveType;
60
64 IntelliColorPicker* colorPicker;
65
69 IntelliToolsettings* Toolsettings;
70
74 LayerObject* activeLayer;
75
79 LayerObject* Canvas;
80
84 bool isDrawing = false;
85
86 public:
92 IntelliTool(PaintingArea* Area, IntelliColorPicker* colorPicker, IntelliToolsettings* Toolsettings);
93
97 virtual ~IntelliTool() = 0;
98
104 virtual void onMouseRightPressed(int x, int y);
105
111 virtual void onMouseRightReleased(int x, int y);
112
118 virtual void onMouseLeftPressed(int x, int y);
119
125 virtual void onMouseLeftReleased(int x, int y);
126
131 virtual void onWheelScrolled(int value);
132
138 virtual void onMouseMoved(int x, int y);
139
144 Tooltype getTooltype() const;
145
150 bool getIsDrawing() const;
151
152 };
153 #endif
IntelliTool::Tooltype::PEN
@ 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:19
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:37
IntelliTool::colorPicker
IntelliColorPicker * colorPicker
A pointer to the IntelliColorPicker of the PaintingArea to interact with, and get the colors.
Definition: IntelliTool.h:64
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:30
IntelliTool::getIsDrawing
bool getIsDrawing() const
getIsDrawing returns if the tool is currently drawing
Definition: IntelliTool.cpp:105
IntelliTool::Toolsettings
IntelliToolsettings * Toolsettings
Toolsettings a refrence to the tool settings.
Definition: IntelliTool.h:69
IntelliTool::getTooltype
Tooltype getTooltype() const
getTooltype returns the tools type
Definition: IntelliTool.cpp:101
IntelliTool::Tooltype::FLOODFILL
@ FLOODFILL
IntelliToolsettings.h
IntelliTool::Tooltype::NONE
@ NONE
IntelliTool::Area
PaintingArea * Area
A pointer to the general PaintingArea to interact with.
Definition: IntelliTool.h:54
IntelliTool::Tooltype
Tooltype
The Tooltype enum categorising the toosl.
Definition: IntelliTool.h:23
PaintingArea
The PaintingArea class manages the methods and stores information about the current painting area,...
Definition: PaintingArea.h:57
IntelliTool::isDrawing
bool isDrawing
A flag checking if the user is currently drawing or not.
Definition: IntelliTool.h:84
LayerObject
The LayerObject struct holds all the information needed to construct a layer.
Definition: PaintingArea.h:23
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:26
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:74
IntelliTool::Tooltype::PLAIN
@ PLAIN
IntelliColorPicker.h
IntelliTool::Tooltype::POLYGON
@ POLYGON
IntelliTool::Canvas
LayerObject * Canvas
A pointer to the drawing canvas of the tool, work on this.
Definition: IntelliTool.h:79
IntelliTool
An abstract class that manages the basic events, like mouse clicks or scrolls events.
Definition: IntelliTool.h:17
IntelliTool::ActiveType
Tooltype ActiveType
ActiveType the type of the active tool.
Definition: IntelliTool.h:59
IntelliColorPicker
The IntelliColorPicker manages the selected colors for one whole project.
Definition: IntelliColorPicker.h:14
IntelliTool::IntelliTool
IntelliTool(PaintingArea *Area, IntelliColorPicker *colorPicker, IntelliToolsettings *Toolsettings)
A constructor setting the general Painting Area and colorPicker.
Definition: IntelliTool.cpp:5
IntelliTool::Tooltype::RECTANGLE
@ RECTANGLE
UnitTest
Definition: mainUnitTest.cpp:8
IntelliTool::Tooltype::LINE
@ LINE
IntelliTool::Tooltype::GRADIENT
@ GRADIENT
IntelliTool::onMouseMoved
virtual void onMouseMoved(int x, int y)
A function managing the mouse moved event. Call this in child classes!
Definition: IntelliTool.cpp:47
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:52
IntelliToolsettings
The IntelliToolsettings class managing the settings of the tools, independent of an existing tool.
Definition: IntelliToolsettings.h:9
IntelliTool::~IntelliTool
virtual ~IntelliTool()=0
An abstract Destructor.
Definition: IntelliTool.cpp:15
IntelliTool::Tooltype::CIRCLE
@ CIRCLE