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 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:
30 bool createToolLayer();
31 
35 void mergeToolLayer();
36 
40 void deleteToolLayer();
41 protected:
46 
48 
53 
55 
60 
65 
69 bool isDrawing = false;
70 
71 public:
78 
82 virtual ~IntelliTool() = 0;
83 
89 virtual void onMouseRightPressed(int x, int y);
90 
96 virtual void onMouseRightReleased(int x, int y);
97 
103 virtual void onMouseLeftPressed(int x, int y);
104 
110 virtual void onMouseLeftReleased(int x, int y);
111 
116 virtual void onWheelScrolled(int value);
117 
123 virtual void onMouseMoved(int x, int y);
124 
126 
127 bool getIsDrawing();
128 
129 };
130 #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:52
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:54
IntelliTool::Tooltype::FLOODFILL
@ FLOODFILL
IntelliToolsettings.h
IntelliTool::Area
PaintingArea * Area
A pointer to the general PaintingArea to interact with.
Definition: IntelliTool.h:45
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:69
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:59
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:64
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:100
IntelliTool::ActiveType
Tooltype ActiveType
Definition: IntelliTool.h:47
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
@ RECTANGLE
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:4
IntelliTool::~IntelliTool
virtual ~IntelliTool()=0
An abstract Destructor.
Definition: IntelliTool.cpp:11
IntelliTool::Tooltype::CIRCLE
@ CIRCLE