IntelliPhoto 0.5

IntelliToolPlain.cpp
Go to the documentation of this file.
1 #include "IntelliToolPlain.h"
2 #include "Layer/PaintingArea.h"
3 #include "QColorDialog"
4
5 IntelliToolPlainTool::IntelliToolPlainTool(PaintingArea* Area, IntelliColorPicker* colorPicker, IntelliToolsettings* Toolsettings)
6 : IntelliTool(Area, colorPicker, Toolsettings){
7 this->ActiveType = Tooltype::PLAIN;
8 }
9
10 IntelliToolPlainTool::~IntelliToolPlainTool(){
11 IntelliTool::onMouseRightPressed(0,0);
12 }
13
14 void IntelliToolPlainTool::onMouseLeftPressed(int x, int y){
15 IntelliTool::onMouseLeftPressed(x,y);
16 this->Canvas->image->drawPlain(colorPicker->getFirstColor());
17 Canvas->image->calculateVisiblity();
18 }
19
20 void IntelliToolPlainTool::onMouseLeftReleased(int x, int y){
21 IntelliTool::onMouseLeftReleased(x,y);
22 }
23
24 void IntelliToolPlainTool::onMouseRightPressed(int x, int y){
25 IntelliTool::onMouseRightPressed(x,y);
26 }
27
28 void IntelliToolPlainTool::onMouseRightReleased(int x, int y){
29 IntelliTool::onMouseRightReleased(x,y);
30 }
31
32 void IntelliToolPlainTool::onMouseMoved(int x, int y){
33 IntelliTool::onMouseMoved(x,y);
34 }
35
36 void IntelliToolPlainTool::onWheelScrolled(int value){
37 IntelliTool::onWheelScrolled(value);
38 }
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
IntelliToolPlainTool::onMouseLeftReleased
virtual void onMouseLeftReleased(int x, int y) override
A function managing the left click released of a mouse. Merging the fill to the active layer.
Definition: IntelliToolPlain.cpp:20
IntelliToolPlainTool::onWheelScrolled
virtual void onWheelScrolled(int value) override
A function managing the scroll event.
Definition: IntelliToolPlain.cpp:36
IntelliToolPlainTool::onMouseRightReleased
virtual void onMouseRightReleased(int x, int y) override
A function managing the right click released of a mouse.
Definition: IntelliToolPlain.cpp:28
PaintingArea
The PaintingArea class manages the methods and stores information about the current painting area,...
Definition: PaintingArea.h:37
IntelliToolPlain.h
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
IntelliToolPlainTool::onMouseLeftPressed
virtual void onMouseLeftPressed(int x, int y) override
A function managing the left click pressed of a mouse. Filling the whole canvas.
Definition: IntelliToolPlain.cpp:14
IntelliTool::Tooltype::PLAIN
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
PaintingArea.h
IntelliColorPicker::getFirstColor
QColor getFirstColor()
A function to read the primary selected color.
Definition: IntelliColorPicker.cpp:16
IntelliTool::ActiveType
Tooltype ActiveType
Definition: IntelliTool.h:46
IntelliColorPicker
The IntelliColorPicker manages the selected colors for one whole project.
Definition: IntelliColorPicker.h:11
IntelliToolPlainTool::onMouseRightPressed
virtual void onMouseRightPressed(int x, int y) override
A function managing the right click pressed of a mouse. Resetting the current fill.
Definition: IntelliToolPlain.cpp:24
LayerObject::image
IntelliImage * image
Definition: PaintingArea.h:26
IntelliToolPlainTool::IntelliToolPlainTool
IntelliToolPlainTool(PaintingArea *Area, IntelliColorPicker *colorPicker, IntelliToolsettings *Toolsettings)
A constructor setting the general paintingArea and colorPicker.
Definition: IntelliToolPlain.cpp:5
IntelliToolPlainTool::onMouseMoved
virtual void onMouseMoved(int x, int y) override
A function managing the mouse moved event.
Definition: IntelliToolPlain.cpp:32
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
IntelliImage::calculateVisiblity
virtual void calculateVisiblity()=0
An abstract function that calculates the visiblity of the Image data if needed.
IntelliToolPlainTool::~IntelliToolPlainTool
virtual ~IntelliToolPlainTool() override
A Destructor.
Definition: IntelliToolPlain.cpp:10
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
IntelliImage::drawPlain
virtual void drawPlain(const QColor &color)
A function that clears the whole image in a given Color.
Definition: IntelliImage.cpp:105