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 };
29 private:
34 bool createToolLayer();
35 
39 void mergeToolLayer();
40 
44 void deleteToolLayer();
45 protected:
50 
52 
57 
59 
64 
69 
73 bool isDrawing = false;
74 
75 public:
82 
86 virtual ~IntelliTool() = 0;
87 
93 virtual void onMouseRightPressed(int x, int y);
94 
100 virtual void onMouseRightReleased(int x, int y);
101 
107 virtual void onMouseLeftPressed(int x, int y);
108 
114 virtual void onMouseLeftReleased(int x, int y);
115 
120 virtual void onWheelScrolled(int value);
121 
127 virtual void onMouseMoved(int x, int y);
128 
130 
131 bool getIsDrawing();
132 
133 };
134 #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: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:56
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:58
IntelliTool::Tooltype::FLOODFILL
@ FLOODFILL
IntelliToolsettings.h
IntelliTool::Area
PaintingArea * Area
A pointer to the general PaintingArea to interact with.
Definition: IntelliTool.h:49
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:73
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: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:63
IntelliTool::Tooltype::PLAIN
@ PLAIN
IntelliColorPicker.h
IntelliTool::Tooltype::POLYGON
@ POLYGON
IntelliTool::getTooltype
Tooltype getTooltype()
Definition: IntelliTool.cpp:96
IntelliTool::Canvas
LayerObject * Canvas
A pointer to the drawing canvas of the tool, work on this.
Definition: IntelliTool.h:68
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:100
IntelliTool::ActiveType
Tooltype ActiveType
Definition: IntelliTool.h:51
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:43
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:48
IntelliToolsettings
Definition: IntelliToolsettings.h:7
IntelliTool::~IntelliTool
virtual ~IntelliTool()=0
An abstract Destructor.
Definition: IntelliTool.cpp:11
IntelliTool::Tooltype::CIRCLE
@ CIRCLE