IntelliPhoto  0.5
IntelliTool.h
Go to the documentation of this file.
1 #ifndef Intelli_Tool_H
2 #define Intelli_Tool_H
3 
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:
20 enum class Tooltype {
21  CIRCLE,
22  FLOODFILL,
23  LINE,
24  PEN,
25  PLAIN,
26  POLYGON,
27  RECTANGLE,
28  NONE
29 };
30 private:
35 bool createToolLayer();
36 
40 void mergeToolLayer();
41 
45 void deleteToolLayer();
46 protected:
51 
53 
58 
60 
65 
70 
74 bool isDrawing = false;
75 
76 public:
83 
87 virtual ~IntelliTool() = 0;
88 
94 virtual void onMouseRightPressed(int x, int y);
95 
101 virtual void onMouseRightReleased(int x, int y);
102 
108 virtual void onMouseLeftPressed(int x, int y);
109 
115 virtual void onMouseLeftReleased(int x, int y);
116 
121 virtual void onWheelScrolled(int value);
122 
128 virtual void onMouseMoved(int x, int y);
129 
131 
132 bool getIsDrawing();
133 
134 };
135 #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:18
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:36
IntelliTool::colorPicker
IntelliColorPicker * colorPicker
A pointer to the IntelliColorPicker of the PaintingArea to interact with, and get the colors.
Definition: IntelliTool.h:57
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:29
IntelliTool::Toolsettings
IntelliToolsettings * Toolsettings
Definition: IntelliTool.h:59
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:50
IntelliTool::Tooltype
Tooltype
Definition: IntelliTool.h:20
PaintingArea
The PaintingArea class manages the methods and stores information about the current painting area,...
Definition: PaintingArea.h:53
IntelliTool::isDrawing
bool isDrawing
A flag checking if the user is currently drawing or not.
Definition: IntelliTool.h:74
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:25
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:64
IntelliTool::Tooltype::PLAIN
@ PLAIN
IntelliColorPicker.h
IntelliTool::Tooltype::POLYGON
@ POLYGON
IntelliTool::getTooltype
Tooltype getTooltype()
Definition: IntelliTool.cpp:99
IntelliTool::Canvas
LayerObject * Canvas
A pointer to the drawing canvas of the tool, work on this.
Definition: IntelliTool.h:69
IntelliTool
An abstract class that manages the basic events, like mouse clicks or scrolls events.
Definition: IntelliTool.h:17
IntelliTool::getIsDrawing
bool getIsDrawing()
Definition: IntelliTool.cpp:103
IntelliTool::ActiveType
Tooltype ActiveType
Definition: IntelliTool.h:52
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:4
IntelliTool::Tooltype::RECTANGLE
@ RECTANGLE
UnitTest
Definition: mainUnitTest.cpp:8
IntelliTool::Tooltype::LINE
@ 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:46
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:51
IntelliToolsettings
Definition: IntelliToolsettings.h:7
IntelliTool::~IntelliTool
virtual ~IntelliTool()=0
An abstract Destructor.
Definition: IntelliTool.cpp:14
IntelliTool::Tooltype::CIRCLE
@ CIRCLE