IntelliToolGradient.h
Go to the documentation of this file.
#ifndef INTELLITOOLGRADIENT_H
#define INTELLITOOLGRADIENT_H
#include "IntelliTool.h"
class IntelliToolGradient : public IntelliTool {
public:
IntelliToolGradient(PaintingArea* Area, IntelliColorPicker* colorPicker, IntelliToolsettings* Toolsettings);
virtual ~IntelliToolGradient() override;
virtual void onMouseRightPressed(int x, int y) override;
virtual void onMouseRightReleased(int x, int y) override;
virtual void onMouseLeftPressed(int x, int y) override;
virtual void onMouseLeftReleased(int x, int y) override;
virtual void onWheelScrolled(int value) override;
virtual void onMouseMoved(int x, int y) override;
private:
QPoint startPoint;
QPoint endPoint;
double doubleStartPoint[2];
double VectorStartEnd[2];
QColor LineColor;
bool hasMoved;
void computeAndDrawPixelColor(QPoint Point, int FirstColor[4], int SecondColor[4], double NormalVector[2], double NormalDotNormal);
double dotProduct(double Vector1[2], double Vector2[2]);
double lenghtVector(double Vector[2]);
void computeGradientLayer();
};
#endif // INTELLITOOLGRADIENT_H
IntelliToolGradient::onMouseLeftReleased
virtual void onMouseLeftReleased(int x, int y) override
A function managing the left click Released of a Mouse. Call this in child classes!
Definition: IntelliToolGradient.cpp:32
IntelliToolGradient::onMouseRightReleased
virtual void onMouseRightReleased(int x, int y) override
A function managing the right click Released of a Mouse. Merging the Canvas to Active....
Definition: IntelliToolGradient.cpp:39
IntelliTool::colorPicker
IntelliColorPicker * colorPicker
A pointer to the IntelliColorPicker of the PaintingArea to interact with, and get the colors.
Definition: IntelliTool.h:64
IntelliTool.h
IntelliTool::Toolsettings
IntelliToolsettings * Toolsettings
Toolsettings a refrence to the tool settings.
Definition: IntelliTool.h:69
IntelliTool::Area
PaintingArea * Area
A pointer to the general PaintingArea to interact with.
Definition: IntelliTool.h:54
IntelliToolGradient::~IntelliToolGradient
virtual ~IntelliToolGradient() override
~IntelliToolGradient basic destructor.
Definition: IntelliToolGradient.cpp:13
IntelliToolGradient::onMouseRightPressed
virtual void onMouseRightPressed(int x, int y) override
A function managing the right click Pressed of a Mouse. Constructing the Canvas to draw on....
Definition: IntelliToolGradient.cpp:28
PaintingArea
The PaintingArea class manages the methods and stores information about the current painting area,...
Definition: PaintingArea.h:57
IntelliToolGradient::onWheelScrolled
virtual void onWheelScrolled(int value) override
A function managing the scroll event. A positive value means scrolling outwards. Call this in child c...
Definition: IntelliToolGradient.cpp:54
IntelliToolGradient::IntelliToolGradient
IntelliToolGradient(PaintingArea *Area, IntelliColorPicker *colorPicker, IntelliToolsettings *Toolsettings)
IntelliToolGradient basic constructor of the gradient tool.
Definition: IntelliToolGradient.cpp:6
IntelliToolGradient::onMouseLeftPressed
virtual void onMouseLeftPressed(int x, int y) override
A function managing the left click Pressed of a Mouse. Resetting the current draw....
Definition: IntelliToolGradient.cpp:17
IntelliTool
An abstract class that manages the basic events, like mouse clicks or scrolls events.
Definition: IntelliTool.h:17
IntelliToolGradient::onMouseMoved
virtual void onMouseMoved(int x, int y) override
A function managing the mouse moved event. Call this in child classes!
Definition: IntelliToolGradient.cpp:43
IntelliColorPicker
The IntelliColorPicker manages the selected colors for one whole project.
Definition: IntelliColorPicker.h:14
IntelliToolsettings
The IntelliToolsettings class managing the settings of the tools, independent of an existing tool.
Definition: IntelliToolsettings.h:9
IntelliToolGradient
The IntelliToolGradient class that represents a gradient call.
Definition: IntelliToolGradient.h:7