mirror of
https://github.com/creyD/intelliphoto.git
synced 2026-04-15 04:40:37 +02:00
Restyled project for uncrustify
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
#include "QDebug"
|
||||
|
||||
IntelliColorPicker::IntelliColorPicker(PaintingArea* Area)
|
||||
:IntelliTool(Area){
|
||||
firstColor = {255,0,0,255};
|
||||
secondColor = {0,0,255,255};
|
||||
: IntelliTool(Area){
|
||||
firstColor = {255,0,0,255};
|
||||
secondColor = {0,0,255,255};
|
||||
}
|
||||
|
||||
IntelliColorPicker::~IntelliColorPicker(){
|
||||
@@ -12,25 +12,25 @@ IntelliColorPicker::~IntelliColorPicker(){
|
||||
}
|
||||
|
||||
void IntelliColorPicker::getColorbar(int firstOrSecondColor = 1){
|
||||
QString Titel;
|
||||
QColor newColor;
|
||||
if(firstOrSecondColor == 1){
|
||||
Titel = "Choose first Color";
|
||||
newColor = QColorDialog::getColor(this->firstColor,nullptr,Titel);
|
||||
this->firstColor = newColor;
|
||||
qDebug() << "Firstcolor" << this->firstColor;
|
||||
}
|
||||
else{
|
||||
Titel = "Choose second Color";
|
||||
newColor = QColorDialog::getColor(this->secondColor,nullptr,Titel);
|
||||
this->secondColor = newColor;
|
||||
}
|
||||
QString Titel;
|
||||
QColor newColor;
|
||||
if(firstOrSecondColor == 1) {
|
||||
Titel = "Choose first Color";
|
||||
newColor = QColorDialog::getColor(this->firstColor,nullptr,Titel);
|
||||
this->firstColor = newColor;
|
||||
qDebug() << "Firstcolor" << this->firstColor;
|
||||
}
|
||||
else{
|
||||
Titel = "Choose second Color";
|
||||
newColor = QColorDialog::getColor(this->secondColor,nullptr,Titel);
|
||||
this->secondColor = newColor;
|
||||
}
|
||||
}
|
||||
|
||||
QColor IntelliColorPicker::getFirstColor(){
|
||||
return firstColor;
|
||||
return firstColor;
|
||||
}
|
||||
|
||||
QColor IntelliColorPicker::getSecondColor(){
|
||||
return secondColor;
|
||||
return secondColor;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#include"IntelliTool.h"
|
||||
#include"Layer/PaintingArea.h"
|
||||
#include "IntelliTool.h"
|
||||
#include "Layer/PaintingArea.h"
|
||||
|
||||
IntelliTool::IntelliTool(PaintingArea* Area, IntelliColorPicker* colorPicker){
|
||||
this->Area=Area;
|
||||
this->colorPicker=colorPicker;
|
||||
this->Area=Area;
|
||||
this->colorPicker=colorPicker;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,71 +12,70 @@ IntelliTool::~IntelliTool(){
|
||||
}
|
||||
|
||||
void IntelliTool::onMouseRightPressed(int x, int y){
|
||||
if(drawing){
|
||||
drawing=false;
|
||||
this->deleteToolLayer();
|
||||
}
|
||||
if(drawing) {
|
||||
drawing=false;
|
||||
this->deleteToolLayer();
|
||||
}
|
||||
}
|
||||
|
||||
void IntelliTool::onMouseRightReleased(int x, int y){
|
||||
//optional for tool
|
||||
//optional for tool
|
||||
}
|
||||
|
||||
void IntelliTool::onMouseLeftPressed(int x, int y){
|
||||
this->drawing=true;
|
||||
//create drawing layer
|
||||
this->createToolLayer();
|
||||
Canvas->image->calculateVisiblity();
|
||||
this->drawing=true;
|
||||
//create drawing layer
|
||||
this->createToolLayer();
|
||||
Canvas->image->calculateVisiblity();
|
||||
}
|
||||
|
||||
void IntelliTool::onMouseLeftReleased(int x, int y){
|
||||
if(drawing){
|
||||
drawing=false;
|
||||
this->mergeToolLayer();
|
||||
this->deleteToolLayer();
|
||||
Active->image->calculateVisiblity();
|
||||
}
|
||||
if(drawing) {
|
||||
drawing=false;
|
||||
this->mergeToolLayer();
|
||||
this->deleteToolLayer();
|
||||
Active->image->calculateVisiblity();
|
||||
}
|
||||
}
|
||||
|
||||
void IntelliTool::onMouseMoved(int x, int y){
|
||||
if(drawing)
|
||||
Canvas->image->calculateVisiblity();
|
||||
if(drawing)
|
||||
Canvas->image->calculateVisiblity();
|
||||
}
|
||||
|
||||
void IntelliTool::onWheelScrolled(int value){
|
||||
//if needed for future general tasks implement in here
|
||||
//if needed for future general tasks implement in here
|
||||
}
|
||||
|
||||
void IntelliTool::createToolLayer(){
|
||||
Area->createTempLayerAfter(Area->activeLayer);
|
||||
this->Active=&Area->layerBundle[Area->activeLayer];
|
||||
this->Canvas=&Area->layerBundle[Area->activeLayer+1];
|
||||
Area->createTempLayerAfter(Area->activeLayer);
|
||||
this->Active=&Area->layerBundle[Area->activeLayer];
|
||||
this->Canvas=&Area->layerBundle[Area->activeLayer+1];
|
||||
}
|
||||
|
||||
void IntelliTool::mergeToolLayer(){
|
||||
QColor clr_0;
|
||||
QColor clr_1;
|
||||
for(int y=0; y<Active->height; y++){
|
||||
for(int x=0; x<Active->width; x++){
|
||||
clr_0=Active->image->imageData.pixelColor(x,y);
|
||||
clr_1=Canvas->image->imageData.pixelColor(x,y);
|
||||
float t = static_cast<float>(clr_1.alpha())/255.f;
|
||||
int r =static_cast<int>(static_cast<float>(clr_1.red())*(t)+static_cast<float>(clr_0.red())*(1.f-t)+0.5f);
|
||||
int g =static_cast<int>(static_cast<float>(clr_1.green())*(t)+static_cast<float>(clr_0.green())*(1.f-t)+0.5f);
|
||||
int b =static_cast<int>(static_cast<float>(clr_1.blue())*(t)+static_cast<float>(clr_0.blue()*(1.f-t))+0.5f);
|
||||
int a =std::min(clr_0.alpha()+clr_1.alpha(), 255);
|
||||
clr_0.setRed(r);
|
||||
clr_0.setGreen(g);
|
||||
clr_0.setBlue(b);
|
||||
clr_0.setAlpha(a);
|
||||
QColor clr_0;
|
||||
QColor clr_1;
|
||||
for(int y=0; y<Active->height; y++) {
|
||||
for(int x=0; x<Active->width; x++) {
|
||||
clr_0=Active->image->imageData.pixelColor(x,y);
|
||||
clr_1=Canvas->image->imageData.pixelColor(x,y);
|
||||
float t = static_cast<float>(clr_1.alpha())/255.f;
|
||||
int r =static_cast<int>(static_cast<float>(clr_1.red())*(t)+static_cast<float>(clr_0.red())*(1.f-t)+0.5f);
|
||||
int g =static_cast<int>(static_cast<float>(clr_1.green())*(t)+static_cast<float>(clr_0.green())*(1.f-t)+0.5f);
|
||||
int b =static_cast<int>(static_cast<float>(clr_1.blue())*(t)+static_cast<float>(clr_0.blue()*(1.f-t))+0.5f);
|
||||
int a =std::min(clr_0.alpha()+clr_1.alpha(), 255);
|
||||
clr_0.setRed(r);
|
||||
clr_0.setGreen(g);
|
||||
clr_0.setBlue(b);
|
||||
clr_0.setAlpha(a);
|
||||
|
||||
Active->image->imageData.setPixelColor(x, y, clr_0);
|
||||
}
|
||||
}
|
||||
Active->image->imageData.setPixelColor(x, y, clr_0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void IntelliTool::deleteToolLayer(){
|
||||
Area->deleteLayer(Area->activeLayer+1);
|
||||
this->Canvas=nullptr;
|
||||
Area->deleteLayer(Area->activeLayer+1);
|
||||
this->Canvas=nullptr;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,101 +10,101 @@ class PaintingArea;
|
||||
/*!
|
||||
* \brief An abstract class that manages the basic events, like mouse clicks or scrolls events.
|
||||
*/
|
||||
class IntelliTool{
|
||||
class IntelliTool {
|
||||
private:
|
||||
/*!
|
||||
* \brief A function that creates a layer to draw on.
|
||||
*/
|
||||
void createToolLayer();
|
||||
/*!
|
||||
* \brief A function that creates a layer to draw on.
|
||||
*/
|
||||
void createToolLayer();
|
||||
|
||||
/*!
|
||||
* \brief A function that merges the drawing- and the active- layer.
|
||||
*/
|
||||
void mergeToolLayer();
|
||||
/*!
|
||||
* \brief A function that merges the drawing- and the active- layer.
|
||||
*/
|
||||
void mergeToolLayer();
|
||||
|
||||
/*!
|
||||
* \brief A function that deletes the drawinglayer.
|
||||
*/
|
||||
void deleteToolLayer();
|
||||
/*!
|
||||
* \brief A function that deletes the drawinglayer.
|
||||
*/
|
||||
void deleteToolLayer();
|
||||
protected:
|
||||
/*!
|
||||
* \brief A pointer to the general PaintingArea to interact with.
|
||||
*/
|
||||
PaintingArea* Area;
|
||||
/*!
|
||||
* \brief A pointer to the general PaintingArea to interact with.
|
||||
*/
|
||||
PaintingArea* Area;
|
||||
|
||||
/*!
|
||||
* \brief A pointer to the IntelliColorPicker of the PaintingArea to interact with, and get the colors.
|
||||
*/
|
||||
IntelliColorPicker* colorPicker;
|
||||
/*!
|
||||
* \brief A pointer to the IntelliColorPicker of the PaintingArea to interact with, and get the colors.
|
||||
*/
|
||||
IntelliColorPicker* colorPicker;
|
||||
|
||||
/*!
|
||||
* \brief A pointer to the underlying active Layer, do not work on this. This is used for data grabbing or previews.
|
||||
*/
|
||||
LayerObject* Active;
|
||||
/*!
|
||||
* \brief A pointer to the underlying active Layer, do not work on this. This is used for data grabbing or previews.
|
||||
*/
|
||||
LayerObject* Active;
|
||||
|
||||
/*!
|
||||
* \brief A pointer to the drawing canvas of the tool, work on this.
|
||||
*/
|
||||
LayerObject* Canvas;
|
||||
/*!
|
||||
* \brief A pointer to the drawing canvas of the tool, work on this.
|
||||
*/
|
||||
LayerObject* Canvas;
|
||||
|
||||
/*!
|
||||
* \brief A flag checking if the user is currently drawing or not.
|
||||
*/
|
||||
bool drawing = false;
|
||||
/*!
|
||||
* \brief A flag checking if the user is currently drawing or not.
|
||||
*/
|
||||
bool drawing = false;
|
||||
|
||||
public:
|
||||
/*!
|
||||
* \brief A constructor setting the general Painting Area and colorPicker.
|
||||
* \param Area - The general PaintingArea used by the project.
|
||||
* \param colorPicker - The general colorPicker used by the project.
|
||||
*/
|
||||
IntelliTool(PaintingArea* Area, IntelliColorPicker* colorPicker);
|
||||
/*!
|
||||
* \brief A constructor setting the general Painting Area and colorPicker.
|
||||
* \param Area - The general PaintingArea used by the project.
|
||||
* \param colorPicker - The general colorPicker used by the project.
|
||||
*/
|
||||
IntelliTool(PaintingArea* Area, IntelliColorPicker* colorPicker);
|
||||
|
||||
/*!
|
||||
* \brief An abstract Destructor.
|
||||
*/
|
||||
virtual ~IntelliTool() = 0;
|
||||
/*!
|
||||
* \brief An abstract Destructor.
|
||||
*/
|
||||
virtual ~IntelliTool() = 0;
|
||||
|
||||
/*!
|
||||
* \brief A function managing the right click Pressed of a Mouse. Constructing the Canvas to draw on. Call this in child classes!
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseRightPressed(int x, int y);
|
||||
/*!
|
||||
* \brief A function managing the right click Pressed of a Mouse. Constructing the Canvas to draw on. Call this in child classes!
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseRightPressed(int x, int y);
|
||||
|
||||
/*!
|
||||
* \brief A function managing the right click Released of a Mouse. Merging the Canvas to Active. Call this in child classes!
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseRightReleased(int x, int y);
|
||||
/*!
|
||||
* \brief A function managing the right click Released of a Mouse. Merging the Canvas to Active. Call this in child classes!
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseRightReleased(int x, int y);
|
||||
|
||||
/*!
|
||||
* \brief A function managing the left click Pressed of a Mouse. Resetting the current draw. Call this in child classes!
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseLeftPressed(int x, int y);
|
||||
/*!
|
||||
* \brief A function managing the left click Pressed of a Mouse. Resetting the current draw. Call this in child classes!
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseLeftPressed(int x, int y);
|
||||
|
||||
/*!
|
||||
* \brief A function managing the left click Released of a Mouse. Call this in child classes!
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseLeftReleased(int x, int y);
|
||||
/*!
|
||||
* \brief A function managing the left click Released of a Mouse. Call this in child classes!
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseLeftReleased(int x, int y);
|
||||
|
||||
/*!
|
||||
* \brief A function managing the scroll event. A positive value means scrolling outwards. Call this in child classes!
|
||||
* \param value - The absolute the scroll has changed.
|
||||
*/
|
||||
virtual void onWheelScrolled(int value);
|
||||
/*!
|
||||
* \brief A function managing the scroll event. A positive value means scrolling outwards. Call this in child classes!
|
||||
* \param value - The absolute the scroll has changed.
|
||||
*/
|
||||
virtual void onWheelScrolled(int value);
|
||||
|
||||
/*!
|
||||
* \brief A function managing the mouse moved event. Call this in child classes!
|
||||
* \param x - The x coordinate of the new mouse position.
|
||||
* \param y - The y coordinate of the new mouse position.
|
||||
*/
|
||||
virtual void onMouseMoved(int x, int y);
|
||||
/*!
|
||||
* \brief A function managing the mouse moved event. Call this in child classes!
|
||||
* \param x - The x coordinate of the new mouse position.
|
||||
* \param y - The y coordinate of the new mouse position.
|
||||
*/
|
||||
virtual void onMouseMoved(int x, int y);
|
||||
|
||||
|
||||
};
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
#include <cmath>
|
||||
|
||||
IntelliToolCircle::IntelliToolCircle(PaintingArea* Area, IntelliColorPicker* colorPicker)
|
||||
:IntelliTool(Area, colorPicker){
|
||||
this->alphaInner = QInputDialog::getInt(nullptr,"Inner Alpha Value", "Value:", 0,0,255,1);
|
||||
this->edgeWidth = QInputDialog::getInt(nullptr,"Outer edge width", "Value:", 0,1,255,1);
|
||||
: IntelliTool(Area, colorPicker){
|
||||
this->alphaInner = QInputDialog::getInt(nullptr,"Inner Alpha Value", "Value:", 0,0,255,1);
|
||||
this->edgeWidth = QInputDialog::getInt(nullptr,"Outer edge width", "Value:", 0,1,255,1);
|
||||
}
|
||||
|
||||
IntelliToolCircle::~IntelliToolCircle(){
|
||||
@@ -14,74 +14,74 @@ IntelliToolCircle::~IntelliToolCircle(){
|
||||
}
|
||||
|
||||
void IntelliToolCircle::drawCyrcle(int radius){
|
||||
int outer = radius+20;
|
||||
QColor inner = this->colorPicker->getSecondColor();
|
||||
inner.setAlpha(alphaInner);
|
||||
int yMin, yMax, xMin, xMax;
|
||||
yMin = Middle.y()-radius;
|
||||
yMax = Middle.y()+radius;
|
||||
// x = x0+-sqrt(r2-(y-y0)2)
|
||||
for(int i=yMin; i<=yMax; i++){
|
||||
xMin = Middle.x()-sqrt(pow(radius,2)-pow(i-Middle.y(),2));
|
||||
xMax = Middle.x()+sqrt(pow(radius,2)-pow(i-Middle.y(),2));
|
||||
this->Canvas->image->drawLine(QPoint(xMin,i), QPoint(xMax,i),inner,1);
|
||||
}
|
||||
int outer = radius+20;
|
||||
QColor inner = this->colorPicker->getSecondColor();
|
||||
inner.setAlpha(alphaInner);
|
||||
int yMin, yMax, xMin, xMax;
|
||||
yMin = Middle.y()-radius;
|
||||
yMax = Middle.y()+radius;
|
||||
// x = x0+-sqrt(r2-(y-y0)2)
|
||||
for(int i=yMin; i<=yMax; i++) {
|
||||
xMin = Middle.x()-sqrt(pow(radius,2)-pow(i-Middle.y(),2));
|
||||
xMax = Middle.x()+sqrt(pow(radius,2)-pow(i-Middle.y(),2));
|
||||
this->Canvas->image->drawLine(QPoint(xMin,i), QPoint(xMax,i),inner,1);
|
||||
}
|
||||
|
||||
//TODO implement circle drawing algorithm bresenham
|
||||
radius = radius +(this->edgeWidth/2.)-1.;
|
||||
yMin = (Middle.y()-radius);
|
||||
yMax = (Middle.y()+radius);
|
||||
for(int i=yMin; i<=yMax; i++){
|
||||
xMin = Middle.x()-sqrt(pow(radius,2)-pow(i-Middle.y(),2));
|
||||
xMax = Middle.x()+sqrt(pow(radius,2)-pow(i-Middle.y(),2));
|
||||
this->Canvas->image->drawPoint(QPoint(xMin,i), colorPicker->getFirstColor(),edgeWidth);
|
||||
this->Canvas->image->drawPoint(QPoint(xMax,i), colorPicker->getFirstColor(),edgeWidth);
|
||||
}
|
||||
//TODO implement circle drawing algorithm bresenham
|
||||
radius = radius +(this->edgeWidth/2.)-1.;
|
||||
yMin = (Middle.y()-radius);
|
||||
yMax = (Middle.y()+radius);
|
||||
for(int i=yMin; i<=yMax; i++) {
|
||||
xMin = Middle.x()-sqrt(pow(radius,2)-pow(i-Middle.y(),2));
|
||||
xMax = Middle.x()+sqrt(pow(radius,2)-pow(i-Middle.y(),2));
|
||||
this->Canvas->image->drawPoint(QPoint(xMin,i), colorPicker->getFirstColor(),edgeWidth);
|
||||
this->Canvas->image->drawPoint(QPoint(xMax,i), colorPicker->getFirstColor(),edgeWidth);
|
||||
}
|
||||
|
||||
xMin = (Middle.x()-radius);
|
||||
xMax = (Middle.x()+radius);
|
||||
for(int i=xMin; i<=xMax; i++){
|
||||
int yMin = Middle.y()-sqrt(pow(radius,2)-pow(i-Middle.x(),2));
|
||||
int yMax = Middle.y()+sqrt(pow(radius,2)-pow(i-Middle.x(),2));
|
||||
this->Canvas->image->drawPoint(QPoint(i, yMin), colorPicker->getFirstColor(),edgeWidth);
|
||||
this->Canvas->image->drawPoint(QPoint(i, yMax), colorPicker->getFirstColor(),edgeWidth);
|
||||
}
|
||||
xMin = (Middle.x()-radius);
|
||||
xMax = (Middle.x()+radius);
|
||||
for(int i=xMin; i<=xMax; i++) {
|
||||
int yMin = Middle.y()-sqrt(pow(radius,2)-pow(i-Middle.x(),2));
|
||||
int yMax = Middle.y()+sqrt(pow(radius,2)-pow(i-Middle.x(),2));
|
||||
this->Canvas->image->drawPoint(QPoint(i, yMin), colorPicker->getFirstColor(),edgeWidth);
|
||||
this->Canvas->image->drawPoint(QPoint(i, yMax), colorPicker->getFirstColor(),edgeWidth);
|
||||
}
|
||||
}
|
||||
|
||||
void IntelliToolCircle::onMouseRightPressed(int x, int y){
|
||||
IntelliTool::onMouseRightPressed(x,y);
|
||||
IntelliTool::onMouseRightPressed(x,y);
|
||||
}
|
||||
|
||||
void IntelliToolCircle::onMouseRightReleased(int x, int y){
|
||||
IntelliTool::onMouseRightReleased(x,y);
|
||||
IntelliTool::onMouseRightReleased(x,y);
|
||||
}
|
||||
|
||||
void IntelliToolCircle::onMouseLeftPressed(int x, int y){
|
||||
IntelliTool::onMouseLeftPressed(x,y);
|
||||
this->Middle=QPoint(x,y);
|
||||
int radius = 1;
|
||||
drawCyrcle(radius);
|
||||
Canvas->image->calculateVisiblity();
|
||||
IntelliTool::onMouseLeftPressed(x,y);
|
||||
this->Middle=QPoint(x,y);
|
||||
int radius = 1;
|
||||
drawCyrcle(radius);
|
||||
Canvas->image->calculateVisiblity();
|
||||
}
|
||||
|
||||
void IntelliToolCircle::onMouseLeftReleased(int x, int y){
|
||||
IntelliTool::onMouseLeftReleased(x,y);
|
||||
IntelliTool::onMouseLeftReleased(x,y);
|
||||
}
|
||||
|
||||
void IntelliToolCircle::onWheelScrolled(int value){
|
||||
IntelliTool::onWheelScrolled(value);
|
||||
this->edgeWidth+=value;
|
||||
if(this->edgeWidth<=0){
|
||||
this->edgeWidth=1;
|
||||
}
|
||||
IntelliTool::onWheelScrolled(value);
|
||||
this->edgeWidth+=value;
|
||||
if(this->edgeWidth<=0) {
|
||||
this->edgeWidth=1;
|
||||
}
|
||||
}
|
||||
|
||||
void IntelliToolCircle::onMouseMoved(int x, int y){
|
||||
if(this->drawing){
|
||||
this->Canvas->image->drawPlain(Qt::transparent);
|
||||
QPoint next(x,y);
|
||||
int radius = static_cast<int>(sqrt(pow((Middle.x()-x),2)+pow((Middle.y()-y),2)));
|
||||
drawCyrcle(radius);
|
||||
}
|
||||
IntelliTool::onMouseMoved(x,y);
|
||||
if(this->drawing) {
|
||||
this->Canvas->image->drawPlain(Qt::transparent);
|
||||
QPoint next(x,y);
|
||||
int radius = static_cast<int>(sqrt(pow((Middle.x()-x),2)+pow((Middle.y()-y),2)));
|
||||
drawCyrcle(radius);
|
||||
}
|
||||
IntelliTool::onMouseMoved(x,y);
|
||||
}
|
||||
|
||||
@@ -7,80 +7,80 @@
|
||||
/*!
|
||||
* \brief The IntelliToolCircle class represents a tool to draw a circle.
|
||||
*/
|
||||
class IntelliToolCircle : public IntelliTool{
|
||||
/*!
|
||||
* \brief A function that implements a circle drawing algorithm.
|
||||
* \param radius - The radius of the circle.
|
||||
*/
|
||||
void drawCyrcle(int radius);
|
||||
class IntelliToolCircle : public IntelliTool {
|
||||
/*!
|
||||
* \brief A function that implements a circle drawing algorithm.
|
||||
* \param radius - The radius of the circle.
|
||||
*/
|
||||
void drawCyrcle(int radius);
|
||||
|
||||
/*!
|
||||
* \brief The center of the circle.
|
||||
*/
|
||||
QPoint Middle;
|
||||
/*!
|
||||
* \brief The center of the circle.
|
||||
*/
|
||||
QPoint Middle;
|
||||
|
||||
/*!
|
||||
* \brief The alpha value of the inner circle.
|
||||
*/
|
||||
int alphaInner;
|
||||
/*!
|
||||
* \brief The alpha value of the inner circle.
|
||||
*/
|
||||
int alphaInner;
|
||||
|
||||
/*!
|
||||
* \brief The width of the outer circle edge.
|
||||
*/
|
||||
int edgeWidth;
|
||||
/*!
|
||||
* \brief The width of the outer circle edge.
|
||||
*/
|
||||
int edgeWidth;
|
||||
public:
|
||||
/*!
|
||||
* \brief A constructor setting the general paintingArea and colorPicker. And reading in the inner alpha and edgeWidth.
|
||||
* \param Area - The general paintingArea used by the project.
|
||||
* \param colorPicker - The general colorPicker used by the project.
|
||||
*/
|
||||
IntelliToolCircle(PaintingArea* Area, IntelliColorPicker* colorPicker);
|
||||
/*!
|
||||
* \brief A constructor setting the general paintingArea and colorPicker. And reading in the inner alpha and edgeWidth.
|
||||
* \param Area - The general paintingArea used by the project.
|
||||
* \param colorPicker - The general colorPicker used by the project.
|
||||
*/
|
||||
IntelliToolCircle(PaintingArea* Area, IntelliColorPicker* colorPicker);
|
||||
|
||||
/*!
|
||||
* \brief A Destructor.
|
||||
*/
|
||||
virtual ~IntelliToolCircle() override;
|
||||
/*!
|
||||
* \brief A Destructor.
|
||||
*/
|
||||
virtual ~IntelliToolCircle() override;
|
||||
|
||||
/*!
|
||||
* \brief A function managing the right click pressed of a mouse. Clearing the canvas layer.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseRightPressed(int x, int y) override;
|
||||
/*!
|
||||
* \brief A function managing the right click pressed of a mouse. Clearing the canvas layer.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseRightPressed(int x, int y) override;
|
||||
|
||||
/*!
|
||||
* \brief A function managing the right click released of a mouse.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseRightReleased(int x, int y) override;
|
||||
/*!
|
||||
* \brief A function managing the right click released of a mouse.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseRightReleased(int x, int y) override;
|
||||
|
||||
/*!
|
||||
* \brief A function managing the left click pressed of a mouse. Sets the middle point of the cricle.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseLeftPressed(int x, int y) override;
|
||||
/*!
|
||||
* \brief A function managing the left click pressed of a mouse. Sets the middle point of the cricle.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseLeftPressed(int x, int y) override;
|
||||
|
||||
/*!
|
||||
* \brief A function managing the left click released of a mouse.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseLeftReleased(int x, int y) override;
|
||||
/*!
|
||||
* \brief A function managing the left click released of a mouse.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseLeftReleased(int x, int y) override;
|
||||
|
||||
/*!
|
||||
* \brief A function managing the scroll event. Changing the edge Width relative to value.
|
||||
* \param value - The absolute the scroll has changed.
|
||||
*/
|
||||
virtual void onWheelScrolled(int value) override;
|
||||
/*!
|
||||
* \brief A function managing the scroll event. Changing the edge Width relative to value.
|
||||
* \param value - The absolute the scroll has changed.
|
||||
*/
|
||||
virtual void onWheelScrolled(int value) override;
|
||||
|
||||
/*!
|
||||
* \brief A function managing the mouse moved event. Draws a circle with radius of eulerian norm of mouse position and the middle point.
|
||||
* \param x - The x coordinate of the new mouse position.
|
||||
* \param y - The y coordinate of the new mouse position.
|
||||
*/
|
||||
virtual void onMouseMoved(int x, int y) override;
|
||||
/*!
|
||||
* \brief A function managing the mouse moved event. Draws a circle with radius of eulerian norm of mouse position and the middle point.
|
||||
* \param x - The x coordinate of the new mouse position.
|
||||
* \param y - The y coordinate of the new mouse position.
|
||||
*/
|
||||
virtual void onMouseMoved(int x, int y) override;
|
||||
};
|
||||
|
||||
#endif // INTELLITOOLCIRCLE_H
|
||||
|
||||
@@ -6,75 +6,74 @@
|
||||
#include <queue>
|
||||
|
||||
IntelliToolFloodFill::IntelliToolFloodFill(PaintingArea* Area, IntelliColorPicker* colorPicker)
|
||||
:IntelliTool(Area, colorPicker){
|
||||
: IntelliTool(Area, colorPicker){
|
||||
}
|
||||
|
||||
IntelliToolFloodFill::~IntelliToolFloodFill(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
void IntelliToolFloodFill::onMouseRightPressed(int x, int y){
|
||||
IntelliTool::onMouseRightPressed(x,y);
|
||||
IntelliTool::onMouseRightPressed(x,y);
|
||||
}
|
||||
|
||||
void IntelliToolFloodFill::onMouseRightReleased(int x, int y){
|
||||
IntelliTool::onMouseRightReleased(x,y);
|
||||
IntelliTool::onMouseRightReleased(x,y);
|
||||
}
|
||||
|
||||
void IntelliToolFloodFill::onMouseLeftPressed(int x, int y){
|
||||
if(!(x>=0 && x<Area->getWidthOfActive() && y>=0 && y<Area->getHeightOfActive())){
|
||||
return;
|
||||
}
|
||||
IntelliTool::onMouseLeftPressed(x,y);
|
||||
if(!(x>=0 && x<Area->getWidthOfActive() && y>=0 && y<Area->getHeightOfActive())) {
|
||||
return;
|
||||
}
|
||||
IntelliTool::onMouseLeftPressed(x,y);
|
||||
|
||||
QPoint start(x,y);
|
||||
std::queue<QPoint> Q;
|
||||
Q.push(start);
|
||||
QPoint start(x,y);
|
||||
std::queue<QPoint> Q;
|
||||
Q.push(start);
|
||||
|
||||
QColor oldColor = this->Active->image->getPixelColor(start);
|
||||
QColor newColor = this->colorPicker->getFirstColor();
|
||||
Canvas->image->drawPixel(start,newColor);
|
||||
QColor oldColor = this->Active->image->getPixelColor(start);
|
||||
QColor newColor = this->colorPicker->getFirstColor();
|
||||
Canvas->image->drawPixel(start,newColor);
|
||||
|
||||
QPoint left, right, top, down;
|
||||
while(!Q.empty()){
|
||||
QPoint Current = Q.front();
|
||||
Q.pop();
|
||||
QPoint left, right, top, down;
|
||||
while(!Q.empty()) {
|
||||
QPoint Current = Q.front();
|
||||
Q.pop();
|
||||
|
||||
left = QPoint(Current.x()-1,Current.y() );
|
||||
right = QPoint(Current.x()+1,Current.y() );
|
||||
top = QPoint(Current.x() ,Current.y()-1);
|
||||
down = QPoint(Current.x() ,Current.y()+1);
|
||||
if((right.x() < Canvas->width) && (Canvas->image->getPixelColor(right) != newColor) && (Active->image->getPixelColor(right) == oldColor)){
|
||||
Canvas->image->drawPixel(right,newColor);
|
||||
Q.push(right);
|
||||
}
|
||||
if((left.x() >= 0) && (Canvas->image->getPixelColor(left) != newColor) && (Active->image->getPixelColor(left) == oldColor)){
|
||||
Canvas->image->drawPixel(left,newColor);
|
||||
Q.push(left);
|
||||
}
|
||||
if((top.y() >= 0) && (Canvas->image->getPixelColor(top) != newColor) && (Active->image->getPixelColor(top) == oldColor)){
|
||||
Canvas->image->drawPixel(top,newColor);
|
||||
Q.push(top);
|
||||
}
|
||||
if((down.y() < Canvas->height) && (Canvas->image->getPixelColor(down) != newColor) && (Active->image->getPixelColor(down) == oldColor)){
|
||||
Canvas->image->drawPixel(down,newColor);
|
||||
Q.push(down);
|
||||
}
|
||||
}
|
||||
left = QPoint(Current.x()-1,Current.y() );
|
||||
right = QPoint(Current.x()+1,Current.y() );
|
||||
top = QPoint(Current.x(),Current.y()-1);
|
||||
down = QPoint(Current.x(),Current.y()+1);
|
||||
if((right.x() < Canvas->width) && (Canvas->image->getPixelColor(right) != newColor) && (Active->image->getPixelColor(right) == oldColor)) {
|
||||
Canvas->image->drawPixel(right,newColor);
|
||||
Q.push(right);
|
||||
}
|
||||
if((left.x() >= 0) && (Canvas->image->getPixelColor(left) != newColor) && (Active->image->getPixelColor(left) == oldColor)) {
|
||||
Canvas->image->drawPixel(left,newColor);
|
||||
Q.push(left);
|
||||
}
|
||||
if((top.y() >= 0) && (Canvas->image->getPixelColor(top) != newColor) && (Active->image->getPixelColor(top) == oldColor)) {
|
||||
Canvas->image->drawPixel(top,newColor);
|
||||
Q.push(top);
|
||||
}
|
||||
if((down.y() < Canvas->height) && (Canvas->image->getPixelColor(down) != newColor) && (Active->image->getPixelColor(down) == oldColor)) {
|
||||
Canvas->image->drawPixel(down,newColor);
|
||||
Q.push(down);
|
||||
}
|
||||
}
|
||||
|
||||
Canvas->image->calculateVisiblity();
|
||||
Canvas->image->calculateVisiblity();
|
||||
}
|
||||
|
||||
void IntelliToolFloodFill::onMouseLeftReleased(int x, int y){
|
||||
IntelliTool::onMouseLeftReleased(x,y);
|
||||
IntelliTool::onMouseLeftReleased(x,y);
|
||||
}
|
||||
|
||||
void IntelliToolFloodFill::onWheelScrolled(int value){
|
||||
IntelliTool::onWheelScrolled(value);
|
||||
IntelliTool::onWheelScrolled(value);
|
||||
|
||||
}
|
||||
|
||||
void IntelliToolFloodFill::onMouseMoved(int x, int y){
|
||||
IntelliTool::onMouseMoved(x,y);
|
||||
IntelliTool::onMouseMoved(x,y);
|
||||
}
|
||||
|
||||
@@ -7,61 +7,61 @@
|
||||
/*!
|
||||
* \brief The IntelliToolFloodFill class represents a tool to flood FIll a certian area.
|
||||
*/
|
||||
class IntelliToolFloodFill : public IntelliTool{
|
||||
class IntelliToolFloodFill : public IntelliTool {
|
||||
public:
|
||||
/*!
|
||||
* \brief A constructor setting the general paintingArea and colorPicker.
|
||||
* \param Area - The general paintingArea used by the project.
|
||||
* \param colorPicker - The general colorPicker used by the project.
|
||||
*/
|
||||
IntelliToolFloodFill(PaintingArea* Area, IntelliColorPicker* colorPicker);
|
||||
/*!
|
||||
* \brief A constructor setting the general paintingArea and colorPicker.
|
||||
* \param Area - The general paintingArea used by the project.
|
||||
* \param colorPicker - The general colorPicker used by the project.
|
||||
*/
|
||||
IntelliToolFloodFill(PaintingArea* Area, IntelliColorPicker* colorPicker);
|
||||
|
||||
/*!
|
||||
* \brief A Destructor.
|
||||
*/
|
||||
virtual ~IntelliToolFloodFill() override;
|
||||
/*!
|
||||
* \brief A Destructor.
|
||||
*/
|
||||
virtual ~IntelliToolFloodFill() override;
|
||||
|
||||
|
||||
/*!
|
||||
* \brief A function managing the right click pressed of a mouse. Clearing the canvas.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseRightPressed(int x, int y) override;
|
||||
/*!
|
||||
* \brief A function managing the right click pressed of a mouse. Clearing the canvas.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseRightPressed(int x, int y) override;
|
||||
|
||||
/*!
|
||||
* \brief A function managing the right click released of a mouse.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseRightReleased(int x, int y) override;
|
||||
/*!
|
||||
* \brief A function managing the right click released of a mouse.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseRightReleased(int x, int y) override;
|
||||
|
||||
/*!
|
||||
* \brief A function managing the left click pressed of a mouse. Sets the point to flood fill around and does this.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseLeftPressed(int x, int y) override;
|
||||
/*!
|
||||
* \brief A function managing the left click pressed of a mouse. Sets the point to flood fill around and does this.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseLeftPressed(int x, int y) override;
|
||||
|
||||
/*!
|
||||
* \brief A function managing the left click released of a mouse.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseLeftReleased(int x, int y) override;
|
||||
/*!
|
||||
* \brief A function managing the left click released of a mouse.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseLeftReleased(int x, int y) override;
|
||||
|
||||
/*!
|
||||
* \brief A function managing the scroll event.
|
||||
* \param value - The absolute the scroll has changed.
|
||||
*/
|
||||
virtual void onWheelScrolled(int value) override;
|
||||
/*!
|
||||
* \brief A function managing the scroll event.
|
||||
* \param value - The absolute the scroll has changed.
|
||||
*/
|
||||
virtual void onWheelScrolled(int value) override;
|
||||
|
||||
/*!
|
||||
* \brief A function managing the mouse moved event.
|
||||
* \param x - The x coordinate of the new mouse position.
|
||||
* \param y - The y coordinate of the new mouse position.
|
||||
*/
|
||||
virtual void onMouseMoved(int x, int y) override;
|
||||
/*!
|
||||
* \brief A function managing the mouse moved event.
|
||||
* \param x - The x coordinate of the new mouse position.
|
||||
* \param y - The y coordinate of the new mouse position.
|
||||
*/
|
||||
virtual void onMouseMoved(int x, int y) override;
|
||||
};
|
||||
|
||||
#endif // INTELLITOOLFLOODFILL_H
|
||||
|
||||
@@ -4,60 +4,59 @@
|
||||
#include "QInputDialog"
|
||||
|
||||
IntelliToolLine::IntelliToolLine(PaintingArea* Area, IntelliColorPicker* colorPicker)
|
||||
:IntelliTool(Area, colorPicker){
|
||||
this->lineWidth = QInputDialog::getInt(nullptr,"Line Width Input", "Width",1,1,50,1);
|
||||
//create checkbox or scroll dialog to get line style
|
||||
this->lineStyle = LineStyle::SOLID_LINE;
|
||||
: IntelliTool(Area, colorPicker){
|
||||
this->lineWidth = QInputDialog::getInt(nullptr,"Line Width Input", "Width",1,1,50,1);
|
||||
//create checkbox or scroll dialog to get line style
|
||||
this->lineStyle = LineStyle::SOLID_LINE;
|
||||
}
|
||||
|
||||
IntelliToolLine::~IntelliToolLine(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
void IntelliToolLine::onMouseRightPressed(int x, int y){
|
||||
IntelliTool::onMouseRightPressed(x,y);
|
||||
IntelliTool::onMouseRightPressed(x,y);
|
||||
}
|
||||
|
||||
void IntelliToolLine::onMouseRightReleased(int x, int y){
|
||||
IntelliTool::onMouseRightReleased(x,y);
|
||||
IntelliTool::onMouseRightReleased(x,y);
|
||||
}
|
||||
|
||||
void IntelliToolLine::onMouseLeftPressed(int x, int y){
|
||||
IntelliTool::onMouseLeftPressed(x,y);
|
||||
this->start=QPoint(x,y);
|
||||
this->Canvas->image->drawPoint(start, colorPicker->getFirstColor(),lineWidth);
|
||||
Canvas->image->calculateVisiblity();
|
||||
IntelliTool::onMouseLeftPressed(x,y);
|
||||
this->start=QPoint(x,y);
|
||||
this->Canvas->image->drawPoint(start, colorPicker->getFirstColor(),lineWidth);
|
||||
Canvas->image->calculateVisiblity();
|
||||
}
|
||||
|
||||
void IntelliToolLine::onMouseLeftReleased(int x, int y){
|
||||
IntelliTool::onMouseLeftReleased(x,y);
|
||||
IntelliTool::onMouseLeftReleased(x,y);
|
||||
}
|
||||
|
||||
void IntelliToolLine::onWheelScrolled(int value){
|
||||
IntelliTool::onWheelScrolled(value);
|
||||
this->lineWidth+=value;
|
||||
if(this->lineWidth<=0){
|
||||
this->lineWidth=1;
|
||||
}
|
||||
IntelliTool::onWheelScrolled(value);
|
||||
this->lineWidth+=value;
|
||||
if(this->lineWidth<=0) {
|
||||
this->lineWidth=1;
|
||||
}
|
||||
}
|
||||
|
||||
void IntelliToolLine::onMouseMoved(int x, int y){
|
||||
if(this->drawing){
|
||||
this->Canvas->image->drawPlain(Qt::transparent);
|
||||
QPoint next(x,y);
|
||||
switch(lineStyle){
|
||||
case LineStyle::SOLID_LINE:
|
||||
this->Canvas->image->drawLine(start,next,colorPicker->getFirstColor(),lineWidth);
|
||||
break;
|
||||
case LineStyle::DOTTED_LINE:
|
||||
QPoint p1 =start.x() <= next.x() ? start : next;
|
||||
QPoint p2 =start.x() < next.x() ? next : start;
|
||||
int m = (float)(p2.y()-p1.y())/(float)(p2.x()-p1.x())+0.5f;
|
||||
int c = start.y()-start.x()*m;
|
||||
if(this->drawing) {
|
||||
this->Canvas->image->drawPlain(Qt::transparent);
|
||||
QPoint next(x,y);
|
||||
switch(lineStyle) {
|
||||
case LineStyle::SOLID_LINE:
|
||||
this->Canvas->image->drawLine(start,next,colorPicker->getFirstColor(),lineWidth);
|
||||
break;
|
||||
case LineStyle::DOTTED_LINE:
|
||||
QPoint p1 =start.x() <= next.x() ? start : next;
|
||||
QPoint p2 =start.x() < next.x() ? next : start;
|
||||
int m = (float)(p2.y()-p1.y())/(float)(p2.x()-p1.x())+0.5f;
|
||||
int c = start.y()-start.x()*m;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
IntelliTool::onMouseMoved(x,y);
|
||||
break;
|
||||
}
|
||||
}
|
||||
IntelliTool::onMouseMoved(x,y);
|
||||
}
|
||||
|
||||
@@ -7,83 +7,83 @@
|
||||
/*!
|
||||
* \brief The LineStyle enum classifing all ways of drawing a line.
|
||||
*/
|
||||
enum class LineStyle{
|
||||
SOLID_LINE,
|
||||
DOTTED_LINE
|
||||
enum class LineStyle {
|
||||
SOLID_LINE,
|
||||
DOTTED_LINE
|
||||
};
|
||||
|
||||
/*!
|
||||
* \brief The IntelliToolFloodFill class represents a tool to draw a line.
|
||||
*/
|
||||
class IntelliToolLine : public IntelliTool{
|
||||
/*!
|
||||
* \brief The starting point of the line.
|
||||
*/
|
||||
QPoint start;
|
||||
class IntelliToolLine : public IntelliTool {
|
||||
/*!
|
||||
* \brief The starting point of the line.
|
||||
*/
|
||||
QPoint start;
|
||||
|
||||
/*!
|
||||
* \brief The width of the line to draw.
|
||||
*/
|
||||
int lineWidth;
|
||||
/*!
|
||||
* \brief The width of the line to draw.
|
||||
*/
|
||||
int lineWidth;
|
||||
|
||||
/*!
|
||||
* \brief The style of the line. Apropriate to LineStyle.
|
||||
*/
|
||||
LineStyle lineStyle;
|
||||
/*!
|
||||
* \brief The style of the line. Apropriate to LineStyle.
|
||||
*/
|
||||
LineStyle lineStyle;
|
||||
public:
|
||||
|
||||
/*!
|
||||
* \brief A constructor setting the general paintingArea and colorPicker. And reading in the lineWidth and lineStyle.
|
||||
* \param Area - The general paintingArea used by the project.
|
||||
* \param colorPicker - The general colorPicker used by the project.
|
||||
*/
|
||||
IntelliToolLine(PaintingArea* Area, IntelliColorPicker* colorPicker);
|
||||
/*!
|
||||
* \brief A constructor setting the general paintingArea and colorPicker. And reading in the lineWidth and lineStyle.
|
||||
* \param Area - The general paintingArea used by the project.
|
||||
* \param colorPicker - The general colorPicker used by the project.
|
||||
*/
|
||||
IntelliToolLine(PaintingArea* Area, IntelliColorPicker* colorPicker);
|
||||
|
||||
/*!
|
||||
* \brief An abstract Destructor.
|
||||
*/
|
||||
virtual ~IntelliToolLine() override;
|
||||
/*!
|
||||
* \brief An abstract Destructor.
|
||||
*/
|
||||
virtual ~IntelliToolLine() override;
|
||||
|
||||
/*!
|
||||
* \brief A function managing the right click pressed of a mouse. Clearing the canvas.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseRightPressed(int x, int y) override;
|
||||
/*!
|
||||
* \brief A function managing the right click pressed of a mouse. Clearing the canvas.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseRightPressed(int x, int y) override;
|
||||
|
||||
/*!
|
||||
* \brief A function managing the right click released of a mouse.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseRightReleased(int x, int y) override;
|
||||
/*!
|
||||
* \brief A function managing the right click released of a mouse.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseRightReleased(int x, int y) override;
|
||||
|
||||
/*!
|
||||
* \brief A function managing the left click pressed of a mouse. Sets the starting point of the line.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseLeftPressed(int x, int y) override;
|
||||
/*!
|
||||
* \brief A function managing the left click pressed of a mouse. Sets the starting point of the line.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseLeftPressed(int x, int y) override;
|
||||
|
||||
/*!
|
||||
* \brief A function managing the left click released of a mouse.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseLeftReleased(int x, int y) override;
|
||||
/*!
|
||||
* \brief A function managing the left click released of a mouse.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseLeftReleased(int x, int y) override;
|
||||
|
||||
/*!
|
||||
* \brief A function managing the scroll event. Changing the lineWidth relative to value.
|
||||
* \param value - The absolute the scroll has changed.
|
||||
*/
|
||||
virtual void onWheelScrolled(int value) override;
|
||||
/*!
|
||||
* \brief A function managing the scroll event. Changing the lineWidth relative to value.
|
||||
* \param value - The absolute the scroll has changed.
|
||||
*/
|
||||
virtual void onWheelScrolled(int value) override;
|
||||
|
||||
/*!
|
||||
* \brief A function managing the mouse moved event. Drawing a Line from the startpoint to the current mouse position.
|
||||
* \param x - The x coordinate of the new mouse position.
|
||||
* \param y - The y coordinate of the new mouse position.
|
||||
*/
|
||||
virtual void onMouseMoved(int x, int y) override;
|
||||
/*!
|
||||
* \brief A function managing the mouse moved event. Drawing a Line from the startpoint to the current mouse position.
|
||||
* \param x - The x coordinate of the new mouse position.
|
||||
* \param y - The y coordinate of the new mouse position.
|
||||
*/
|
||||
virtual void onMouseMoved(int x, int y) override;
|
||||
};
|
||||
|
||||
#endif // INTELLITOOLLINE_H
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
#include "QInputDialog"
|
||||
|
||||
IntelliToolPen::IntelliToolPen(PaintingArea* Area, IntelliColorPicker* colorPicker)
|
||||
:IntelliTool(Area, colorPicker){
|
||||
this->penWidth = QInputDialog::getInt(nullptr, "Pen width", "Width:", 1,0, 50, 1);
|
||||
: IntelliTool(Area, colorPicker){
|
||||
this->penWidth = QInputDialog::getInt(nullptr, "Pen width", "Width:", 1,0, 50, 1);
|
||||
}
|
||||
|
||||
IntelliToolPen::~IntelliToolPen(){
|
||||
@@ -14,37 +14,37 @@ IntelliToolPen::~IntelliToolPen(){
|
||||
}
|
||||
|
||||
void IntelliToolPen::onMouseRightPressed(int x, int y){
|
||||
IntelliTool::onMouseRightPressed(x,y);
|
||||
IntelliTool::onMouseRightPressed(x,y);
|
||||
}
|
||||
|
||||
void IntelliToolPen::onMouseRightReleased(int x, int y){
|
||||
IntelliTool::onMouseRightReleased(x,y);
|
||||
IntelliTool::onMouseRightReleased(x,y);
|
||||
}
|
||||
|
||||
void IntelliToolPen::onMouseLeftPressed(int x, int y){
|
||||
IntelliTool::onMouseLeftPressed(x,y);
|
||||
this->point=QPoint(x,y);
|
||||
this->Canvas->image->drawPixel(point, colorPicker->getFirstColor());
|
||||
Canvas->image->calculateVisiblity();
|
||||
IntelliTool::onMouseLeftPressed(x,y);
|
||||
this->point=QPoint(x,y);
|
||||
this->Canvas->image->drawPixel(point, colorPicker->getFirstColor());
|
||||
Canvas->image->calculateVisiblity();
|
||||
}
|
||||
|
||||
void IntelliToolPen::onMouseLeftReleased(int x, int y){
|
||||
IntelliTool::onMouseLeftReleased(x,y);
|
||||
IntelliTool::onMouseLeftReleased(x,y);
|
||||
}
|
||||
|
||||
void IntelliToolPen::onMouseMoved(int x, int y){
|
||||
if(this->drawing){
|
||||
QPoint newPoint(x,y);
|
||||
this->Canvas->image->drawLine(this->point, newPoint, colorPicker->getFirstColor(), penWidth);
|
||||
this->point=newPoint;
|
||||
}
|
||||
IntelliTool::onMouseMoved(x,y);
|
||||
if(this->drawing) {
|
||||
QPoint newPoint(x,y);
|
||||
this->Canvas->image->drawLine(this->point, newPoint, colorPicker->getFirstColor(), penWidth);
|
||||
this->point=newPoint;
|
||||
}
|
||||
IntelliTool::onMouseMoved(x,y);
|
||||
}
|
||||
|
||||
void IntelliToolPen::onWheelScrolled(int value){
|
||||
IntelliTool::onWheelScrolled(value);
|
||||
this->penWidth+=value;
|
||||
if(this->penWidth<=0){
|
||||
this->penWidth=1;
|
||||
}
|
||||
IntelliTool::onWheelScrolled(value);
|
||||
this->penWidth+=value;
|
||||
if(this->penWidth<=0) {
|
||||
this->penWidth=1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,73 +1,73 @@
|
||||
#ifndef INTELLITOOLPEN_H
|
||||
#define INTELLITOOLPEN_H
|
||||
|
||||
#include"IntelliTool.h"
|
||||
#include"QColor"
|
||||
#include"QPoint"
|
||||
#include "IntelliTool.h"
|
||||
#include "QColor"
|
||||
#include "QPoint"
|
||||
/*!
|
||||
* \brief The IntelliToolPen class represents a tool to draw a line.
|
||||
*/
|
||||
class IntelliToolPen : public IntelliTool{
|
||||
/*!
|
||||
* \brief penWidth - The width of the Pen while drawing.
|
||||
*/
|
||||
int penWidth;
|
||||
/*!
|
||||
* \brief point - Represents the previous point to help drawing a line.
|
||||
*/
|
||||
QPoint point;
|
||||
class IntelliToolPen : public IntelliTool {
|
||||
/*!
|
||||
* \brief penWidth - The width of the Pen while drawing.
|
||||
*/
|
||||
int penWidth;
|
||||
/*!
|
||||
* \brief point - Represents the previous point to help drawing a line.
|
||||
*/
|
||||
QPoint point;
|
||||
public:
|
||||
/*!
|
||||
* \brief A constructor setting the general paintingArea and colorPicker. Reading the penWidth.
|
||||
* \param Area - The general PaintingArea used by the project.
|
||||
* \param colorPicker - The general colorPicker used by the project.
|
||||
*/
|
||||
IntelliToolPen(PaintingArea* Area, IntelliColorPicker* colorPicker);
|
||||
/*!
|
||||
* \brief A Destructor.
|
||||
*/
|
||||
virtual ~IntelliToolPen() override;
|
||||
/*!
|
||||
* \brief A constructor setting the general paintingArea and colorPicker. Reading the penWidth.
|
||||
* \param Area - The general PaintingArea used by the project.
|
||||
* \param colorPicker - The general colorPicker used by the project.
|
||||
*/
|
||||
IntelliToolPen(PaintingArea* Area, IntelliColorPicker* colorPicker);
|
||||
/*!
|
||||
* \brief A Destructor.
|
||||
*/
|
||||
virtual ~IntelliToolPen() override;
|
||||
|
||||
/*!
|
||||
* \brief A function managing the right click pressed of a mouse. Resetting the current draw.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseRightPressed(int x, int y) override;
|
||||
/*!
|
||||
* \brief A function managing the right click pressed of a mouse. Resetting the current draw.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseRightPressed(int x, int y) override;
|
||||
|
||||
/*!
|
||||
* \brief A function managing the right click released of a mouse.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseRightReleased(int x, int y) override;
|
||||
/*!
|
||||
* \brief A function managing the right click released of a mouse.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseRightReleased(int x, int y) override;
|
||||
|
||||
/*!
|
||||
* \brief A function managing the left click pressed of a mouse. Starting the drawing procedure.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseLeftPressed(int x, int y) override;
|
||||
/*!
|
||||
* \brief A function managing the left click pressed of a mouse. Starting the drawing procedure.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseLeftPressed(int x, int y) override;
|
||||
|
||||
/*!
|
||||
* \brief A function managing the left click released of a mouse. Merging the drawing to the active layer.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseLeftReleased(int x, int y) override;
|
||||
/*!
|
||||
* \brief A function managing the left click released of a mouse. Merging the drawing to the active layer.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseLeftReleased(int x, int y) override;
|
||||
|
||||
/*!
|
||||
* \brief A function managing the scroll event. Changing penWidth relativ to value.
|
||||
* \param value - The absolute the scroll has changed.
|
||||
*/
|
||||
virtual void onWheelScrolled(int value) override;
|
||||
/*!
|
||||
* \brief A function managing the scroll event. Changing penWidth relativ to value.
|
||||
* \param value - The absolute the scroll has changed.
|
||||
*/
|
||||
virtual void onWheelScrolled(int value) override;
|
||||
|
||||
/*!
|
||||
* \brief A function managing the mouse moved event. To draw the line.
|
||||
* \param x - The x coordinate of the new mouse position.
|
||||
* \param y - The y coordinate of the new mouse position.
|
||||
*/
|
||||
virtual void onMouseMoved(int x, int y) override;
|
||||
/*!
|
||||
* \brief A function managing the mouse moved event. To draw the line.
|
||||
* \param x - The x coordinate of the new mouse position.
|
||||
* \param y - The y coordinate of the new mouse position.
|
||||
*/
|
||||
virtual void onMouseMoved(int x, int y) override;
|
||||
};
|
||||
|
||||
#endif // INTELLITOOLPEN_H
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "QColorDialog"
|
||||
|
||||
IntelliToolPlainTool::IntelliToolPlainTool(PaintingArea* Area, IntelliColorPicker* colorPicker)
|
||||
:IntelliTool(Area, colorPicker){
|
||||
: IntelliTool(Area, colorPicker){
|
||||
}
|
||||
|
||||
IntelliToolPlainTool::~IntelliToolPlainTool(){
|
||||
@@ -11,28 +11,27 @@ IntelliToolPlainTool::~IntelliToolPlainTool(){
|
||||
}
|
||||
|
||||
void IntelliToolPlainTool::onMouseLeftPressed(int x, int y){
|
||||
IntelliTool::onMouseLeftPressed(x,y);
|
||||
this->Canvas->image->drawPlain(colorPicker->getFirstColor());
|
||||
Canvas->image->calculateVisiblity();
|
||||
IntelliTool::onMouseLeftPressed(x,y);
|
||||
this->Canvas->image->drawPlain(colorPicker->getFirstColor());
|
||||
Canvas->image->calculateVisiblity();
|
||||
}
|
||||
|
||||
void IntelliToolPlainTool::onMouseLeftReleased(int x, int y){
|
||||
IntelliTool::onMouseLeftReleased(x,y);
|
||||
IntelliTool::onMouseLeftReleased(x,y);
|
||||
}
|
||||
|
||||
void IntelliToolPlainTool::onMouseRightPressed(int x, int y){
|
||||
IntelliTool::onMouseRightPressed(x,y);
|
||||
IntelliTool::onMouseRightPressed(x,y);
|
||||
}
|
||||
|
||||
void IntelliToolPlainTool::onMouseRightReleased(int x, int y){
|
||||
IntelliTool::onMouseRightReleased(x,y);
|
||||
IntelliTool::onMouseRightReleased(x,y);
|
||||
}
|
||||
|
||||
|
||||
void IntelliToolPlainTool::onMouseMoved(int x, int y){
|
||||
IntelliTool::onMouseMoved(x,y);
|
||||
IntelliTool::onMouseMoved(x,y);
|
||||
}
|
||||
|
||||
void IntelliToolPlainTool::onWheelScrolled(int value){
|
||||
IntelliTool::onWheelScrolled(value);
|
||||
IntelliTool::onWheelScrolled(value);
|
||||
}
|
||||
|
||||
@@ -6,59 +6,59 @@
|
||||
/*!
|
||||
* \brief The IntelliToolPlainTool class represents a tool to fill the whole canvas with one color.
|
||||
*/
|
||||
class IntelliToolPlainTool : public IntelliTool{
|
||||
class IntelliToolPlainTool : public IntelliTool {
|
||||
public:
|
||||
/*!
|
||||
* \brief A constructor setting the general paintingArea and colorPicker.
|
||||
* \param Area - The general paintingArea used by the project.
|
||||
* \param colorPicker - The general colorPicker used by the project.
|
||||
*/
|
||||
IntelliToolPlainTool(PaintingArea *Area, IntelliColorPicker* colorPicker);
|
||||
/*!
|
||||
* \brief A Destructor.
|
||||
*/
|
||||
virtual ~IntelliToolPlainTool() override;
|
||||
/*!
|
||||
* \brief A constructor setting the general paintingArea and colorPicker.
|
||||
* \param Area - The general paintingArea used by the project.
|
||||
* \param colorPicker - The general colorPicker used by the project.
|
||||
*/
|
||||
IntelliToolPlainTool(PaintingArea*Area, IntelliColorPicker* colorPicker);
|
||||
/*!
|
||||
* \brief A Destructor.
|
||||
*/
|
||||
virtual ~IntelliToolPlainTool() override;
|
||||
|
||||
/*!
|
||||
* \brief A function managing the right click pressed of a mouse. Resetting the current fill.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseRightPressed(int x, int y) override;
|
||||
/*!
|
||||
* \brief A function managing the right click pressed of a mouse. Resetting the current fill.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseRightPressed(int x, int y) override;
|
||||
|
||||
/*!
|
||||
* \brief A function managing the right click released of a mouse.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseRightReleased(int x, int y) override;
|
||||
/*!
|
||||
* \brief A function managing the right click released of a mouse.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseRightReleased(int x, int y) override;
|
||||
|
||||
/*!
|
||||
* \brief A function managing the left click pressed of a mouse. Filling the whole canvas.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseLeftPressed(int x, int y) override;
|
||||
/*!
|
||||
* \brief A function managing the left click pressed of a mouse. Filling the whole canvas.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseLeftPressed(int x, int y) override;
|
||||
|
||||
/*!
|
||||
* \brief A function managing the left click released of a mouse. Merging the fill to the active layer.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseLeftReleased(int x, int y) override;
|
||||
/*!
|
||||
* \brief A function managing the left click released of a mouse. Merging the fill to the active layer.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseLeftReleased(int x, int y) override;
|
||||
|
||||
/*!
|
||||
* \brief A function managing the scroll event.
|
||||
* \param value - The absolute the scroll has changed.
|
||||
*/
|
||||
virtual void onWheelScrolled(int value) override;
|
||||
/*!
|
||||
* \brief A function managing the scroll event.
|
||||
* \param value - The absolute the scroll has changed.
|
||||
*/
|
||||
virtual void onWheelScrolled(int value) override;
|
||||
|
||||
/*!
|
||||
* \brief A function managing the mouse moved event.
|
||||
* \param x - The x coordinate of the new mouse position.
|
||||
* \param y - The y coordinate of the new mouse position.
|
||||
*/
|
||||
virtual void onMouseMoved(int x, int y) override;
|
||||
/*!
|
||||
* \brief A function managing the mouse moved event.
|
||||
* \param x - The x coordinate of the new mouse position.
|
||||
* \param y - The y coordinate of the new mouse position.
|
||||
*/
|
||||
virtual void onMouseMoved(int x, int y) override;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
#include <QInputDialog>
|
||||
|
||||
IntelliToolPolygon::IntelliToolPolygon(PaintingArea* Area, IntelliColorPicker* colorPicker)
|
||||
:IntelliTool(Area, colorPicker){
|
||||
this->alphaInner = QInputDialog::getInt(nullptr,"Inner Alpha Value", "Value:", 0,0,255,1);
|
||||
lineWidth = QInputDialog::getInt(nullptr,"Line Width Input", "Width",1,1,50,1);;
|
||||
PointIsNearStart = false;
|
||||
isDrawing = false;
|
||||
: IntelliTool(Area, colorPicker){
|
||||
this->alphaInner = QInputDialog::getInt(nullptr,"Inner Alpha Value", "Value:", 0,0,255,1);
|
||||
lineWidth = QInputDialog::getInt(nullptr,"Line Width Input", "Width",1,1,50,1);;
|
||||
PointIsNearStart = false;
|
||||
isDrawing = false;
|
||||
}
|
||||
|
||||
IntelliToolPolygon::~IntelliToolPolygon(){
|
||||
@@ -17,93 +17,93 @@ IntelliToolPolygon::~IntelliToolPolygon(){
|
||||
}
|
||||
|
||||
void IntelliToolPolygon::onMouseLeftPressed(int x, int y){
|
||||
if(!isDrawing && x > 0 && y > 0 && x<Area->getWidthOfActive() && y<Area->getHeightOfActive()){
|
||||
IntelliTool::onMouseLeftPressed(x,y);
|
||||
QPoint drawingPoint = QPoint(x,y);
|
||||
if(!isDrawing && x > 0 && y > 0 && x<Area->getWidthOfActive() && y<Area->getHeightOfActive()) {
|
||||
IntelliTool::onMouseLeftPressed(x,y);
|
||||
QPoint drawingPoint = QPoint(x,y);
|
||||
|
||||
isDrawing = true;
|
||||
QPointList.push_back(drawingPoint);
|
||||
isDrawing = true;
|
||||
QPointList.push_back(drawingPoint);
|
||||
|
||||
this->Canvas->image->drawPoint(QPointList.back(), colorPicker->getFirstColor(), lineWidth);
|
||||
this->Canvas->image->calculateVisiblity();
|
||||
}
|
||||
else if(isDrawing && isNearStart(x,y,QPointList.front())){
|
||||
PointIsNearStart = true;
|
||||
this->Canvas->image->drawLine(QPointList.back(), QPointList.front(), colorPicker->getFirstColor(), lineWidth);
|
||||
this->Canvas->image->calculateVisiblity();
|
||||
}
|
||||
else if(isDrawing){
|
||||
QPoint drawingPoint(x,y);
|
||||
QPointList.push_back(drawingPoint);
|
||||
this->Canvas->image->drawLine(QPointList[QPointList.size() - 2], QPointList[QPointList.size() - 1], colorPicker->getFirstColor(), lineWidth);
|
||||
this->Canvas->image->calculateVisiblity();
|
||||
}
|
||||
this->Canvas->image->drawPoint(QPointList.back(), colorPicker->getFirstColor(), lineWidth);
|
||||
this->Canvas->image->calculateVisiblity();
|
||||
}
|
||||
else if(isDrawing && isNearStart(x,y,QPointList.front())) {
|
||||
PointIsNearStart = true;
|
||||
this->Canvas->image->drawLine(QPointList.back(), QPointList.front(), colorPicker->getFirstColor(), lineWidth);
|
||||
this->Canvas->image->calculateVisiblity();
|
||||
}
|
||||
else if(isDrawing) {
|
||||
QPoint drawingPoint(x,y);
|
||||
QPointList.push_back(drawingPoint);
|
||||
this->Canvas->image->drawLine(QPointList[QPointList.size() - 2], QPointList[QPointList.size() - 1], colorPicker->getFirstColor(), lineWidth);
|
||||
this->Canvas->image->calculateVisiblity();
|
||||
}
|
||||
}
|
||||
|
||||
void IntelliToolPolygon::onMouseRightPressed(int x, int y){
|
||||
isDrawing = false;
|
||||
PointIsNearStart = false;
|
||||
QPointList.clear();
|
||||
IntelliTool::onMouseRightPressed(x,y);
|
||||
isDrawing = false;
|
||||
PointIsNearStart = false;
|
||||
QPointList.clear();
|
||||
IntelliTool::onMouseRightPressed(x,y);
|
||||
}
|
||||
|
||||
void IntelliToolPolygon::onMouseLeftReleased(int x, int y){
|
||||
if(PointIsNearStart && QPointList.size() > 1){
|
||||
PointIsNearStart = false;
|
||||
isDrawing = false;
|
||||
std::vector<Triangle> Triangles = IntelliHelper::calculateTriangles(QPointList);
|
||||
QPoint Point;
|
||||
QColor colorTwo(colorPicker->getSecondColor());
|
||||
colorTwo.setAlpha(alphaInner);
|
||||
for(int i = 0; i < Active->width; i++){
|
||||
for(int j = 0; j < Active->height; j++){
|
||||
Point = QPoint(i,j);
|
||||
if(IntelliHelper::isInPolygon(Triangles,Point)){
|
||||
this->Canvas->image->drawPixel(Point, colorTwo);
|
||||
}
|
||||
}
|
||||
}
|
||||
for(int i=0; i<QPointList.size(); i++){
|
||||
int next = (i+1)%QPointList.size();
|
||||
this->Canvas->image->drawLine(QPointList[i], QPointList[next], colorPicker->getFirstColor(), lineWidth);
|
||||
}
|
||||
QPointList.clear();
|
||||
IntelliTool::onMouseLeftReleased(x,y);
|
||||
}
|
||||
if(PointIsNearStart && QPointList.size() > 1) {
|
||||
PointIsNearStart = false;
|
||||
isDrawing = false;
|
||||
std::vector<Triangle> Triangles = IntelliHelper::calculateTriangles(QPointList);
|
||||
QPoint Point;
|
||||
QColor colorTwo(colorPicker->getSecondColor());
|
||||
colorTwo.setAlpha(alphaInner);
|
||||
for(int i = 0; i < Active->width; i++) {
|
||||
for(int j = 0; j < Active->height; j++) {
|
||||
Point = QPoint(i,j);
|
||||
if(IntelliHelper::isInPolygon(Triangles,Point)) {
|
||||
this->Canvas->image->drawPixel(Point, colorTwo);
|
||||
}
|
||||
}
|
||||
}
|
||||
for(int i=0; i<QPointList.size(); i++) {
|
||||
int next = (i+1)%QPointList.size();
|
||||
this->Canvas->image->drawLine(QPointList[i], QPointList[next], colorPicker->getFirstColor(), lineWidth);
|
||||
}
|
||||
QPointList.clear();
|
||||
IntelliTool::onMouseLeftReleased(x,y);
|
||||
}
|
||||
}
|
||||
|
||||
void IntelliToolPolygon::onMouseRightReleased(int x, int y){
|
||||
IntelliTool::onMouseRightReleased(x,y);
|
||||
IntelliTool::onMouseRightReleased(x,y);
|
||||
}
|
||||
|
||||
void IntelliToolPolygon::onWheelScrolled(int value){
|
||||
IntelliTool::onWheelScrolled(value);
|
||||
if(!isDrawing){
|
||||
if(lineWidth + value < 10){
|
||||
lineWidth += value;
|
||||
}
|
||||
if(lineWidth < 1){
|
||||
lineWidth = 1;
|
||||
}
|
||||
}
|
||||
IntelliTool::onWheelScrolled(value);
|
||||
if(!isDrawing) {
|
||||
if(lineWidth + value < 10) {
|
||||
lineWidth += value;
|
||||
}
|
||||
if(lineWidth < 1) {
|
||||
lineWidth = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void IntelliToolPolygon::onMouseMoved(int x, int y){
|
||||
IntelliTool::onMouseMoved(x,y);
|
||||
IntelliTool::onMouseMoved(x,y);
|
||||
}
|
||||
|
||||
bool IntelliToolPolygon::isNearStart(int x, int y, QPoint Startpoint){
|
||||
bool isNear = false;
|
||||
int StartX = Startpoint.x();
|
||||
int StartY = Startpoint.y();
|
||||
int valueToNear = 10;
|
||||
bool isNear = false;
|
||||
int StartX = Startpoint.x();
|
||||
int StartY = Startpoint.y();
|
||||
int valueToNear = 10;
|
||||
|
||||
for(int i = StartX - valueToNear; i < StartX + valueToNear; i++){
|
||||
for(int j = StartY - valueToNear; j < StartY + valueToNear; j++){
|
||||
if((i == x) && (j == y)){
|
||||
isNear = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return isNear;
|
||||
for(int i = StartX - valueToNear; i < StartX + valueToNear; i++) {
|
||||
for(int j = StartY - valueToNear; j < StartY + valueToNear; j++) {
|
||||
if((i == x) && (j == y)) {
|
||||
isNear = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return isNear;
|
||||
}
|
||||
|
||||
@@ -10,92 +10,91 @@
|
||||
*/
|
||||
class IntelliToolPolygon : public IntelliTool
|
||||
{
|
||||
/*!
|
||||
* \brief Checks if the given Point lies near the starting Point.
|
||||
* \param x - x coordinate of a point.
|
||||
* \param y - y coordinate of a point.
|
||||
* \param Startpoint - The startingpoint to check for.
|
||||
* \return Returns true if the (x,y) point is near to the startpoint, otherwise false.
|
||||
*/
|
||||
bool isNearStart(int x, int y, QPoint Startpoint);
|
||||
/*!
|
||||
* \brief Checks if the given Point lies near the starting Point.
|
||||
* \param x - x coordinate of a point.
|
||||
* \param y - y coordinate of a point.
|
||||
* \param Startpoint - The startingpoint to check for.
|
||||
* \return Returns true if the (x,y) point is near to the startpoint, otherwise false.
|
||||
*/
|
||||
bool isNearStart(int x, int y, QPoint Startpoint);
|
||||
|
||||
/*!
|
||||
* \brief LineWidth of the drawing polygon.
|
||||
*/
|
||||
int lineWidth;
|
||||
/*!
|
||||
* \brief LineWidth of the drawing polygon.
|
||||
*/
|
||||
int lineWidth;
|
||||
|
||||
/*!
|
||||
* \brief IsDrawing true while drawing, else false.
|
||||
*/
|
||||
bool isDrawing;
|
||||
/*!
|
||||
* \brief IsDrawing true while drawing, else false.
|
||||
*/
|
||||
bool isDrawing;
|
||||
|
||||
/*!
|
||||
* \brief PointIsNearStart true, when last click near startpoint, else false.
|
||||
*/
|
||||
bool PointIsNearStart;
|
||||
/*!
|
||||
* \brief PointIsNearStart true, when last click near startpoint, else false.
|
||||
*/
|
||||
bool PointIsNearStart;
|
||||
|
||||
/*!
|
||||
* \brief The alpha value of the inner circle.
|
||||
*/
|
||||
int alphaInner;
|
||||
/*!
|
||||
* \brief The alpha value of the inner circle.
|
||||
*/
|
||||
int alphaInner;
|
||||
|
||||
/*!
|
||||
* \brief QPointList list of all points of the polygon.
|
||||
*/
|
||||
std::vector<QPoint> QPointList;
|
||||
/*!
|
||||
* \brief QPointList list of all points of the polygon.
|
||||
*/
|
||||
std::vector<QPoint> QPointList;
|
||||
public:
|
||||
/*!
|
||||
* \brief A constructor setting the general paintingArea and colorPicker.
|
||||
* \param Area - The general paintingArea used by the project.
|
||||
* \param colorPicker - The general colorPicker used by the project.
|
||||
*/
|
||||
IntelliToolPolygon(PaintingArea* Area, IntelliColorPicker* colorPicker);
|
||||
/*!
|
||||
* \brief A Destructor.
|
||||
*/
|
||||
~IntelliToolPolygon() override;
|
||||
/*!
|
||||
* \brief A constructor setting the general paintingArea and colorPicker.
|
||||
* \param Area - The general paintingArea used by the project.
|
||||
* \param colorPicker - The general colorPicker used by the project.
|
||||
*/
|
||||
IntelliToolPolygon(PaintingArea* Area, IntelliColorPicker* colorPicker);
|
||||
/*!
|
||||
* \brief A Destructor.
|
||||
*/
|
||||
~IntelliToolPolygon() override;
|
||||
|
||||
/*!
|
||||
* \brief A function managing the left click pressed of a mouse. Setting polygon points.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseLeftPressed(int x, int y) override;
|
||||
/*!
|
||||
* \brief A function managing the left click pressed of a mouse. Setting polygon points.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseLeftPressed(int x, int y) override;
|
||||
|
||||
/*!
|
||||
* \brief A function managing the left click released of a mouse. Merging the fill to the active layer.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseLeftReleased(int x, int y) override;
|
||||
/*!
|
||||
* \brief A function managing the left click released of a mouse. Merging the fill to the active layer.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseLeftReleased(int x, int y) override;
|
||||
|
||||
/*!
|
||||
* \brief A function managing the right click pressed of a mouse. Resetting the current fill.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseRightPressed(int x, int y) override;
|
||||
/*!
|
||||
* \brief A function managing the right click pressed of a mouse. Resetting the current fill.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseRightPressed(int x, int y) override;
|
||||
|
||||
/*!
|
||||
* \brief A function managing the right click released of a mouse.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseRightReleased(int x, int y) override;
|
||||
/*!
|
||||
* \brief A function managing the right click released of a mouse.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseRightReleased(int x, int y) override;
|
||||
|
||||
/*!
|
||||
* \brief A function managing the scroll event. CHanging the lineWidth relative to value.
|
||||
* \param value - The absolute the scroll has changed.
|
||||
*/
|
||||
virtual void onWheelScrolled(int value) override;
|
||||
|
||||
/*!
|
||||
* \brief A function managing the mouse moved event.
|
||||
* \param x - The x coordinate of the new mouse position.
|
||||
* \param y - The y coordinate of the new mouse position.
|
||||
*/
|
||||
virtual void onMouseMoved(int x, int y) override;
|
||||
/*!
|
||||
* \brief A function managing the scroll event. CHanging the lineWidth relative to value.
|
||||
* \param value - The absolute the scroll has changed.
|
||||
*/
|
||||
virtual void onWheelScrolled(int value) override;
|
||||
|
||||
/*!
|
||||
* \brief A function managing the mouse moved event.
|
||||
* \param x - The x coordinate of the new mouse position.
|
||||
* \param y - The y coordinate of the new mouse position.
|
||||
*/
|
||||
virtual void onMouseMoved(int x, int y) override;
|
||||
|
||||
|
||||
};
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#include"IntelliToolRectangle.h"
|
||||
#include "IntelliToolRectangle.h"
|
||||
#include "Layer/PaintingArea.h"
|
||||
#include "QInputDialog"
|
||||
|
||||
IntelliToolRectangle::IntelliToolRectangle(PaintingArea* Area, IntelliColorPicker* colorPicker)
|
||||
:IntelliTool(Area, colorPicker){
|
||||
this->alphaInner = QInputDialog::getInt(nullptr,"Inner Alpha Value", "Value:", 0,0,255,1);
|
||||
this->edgeWidth = QInputDialog::getInt(nullptr,"Outer edge width", "Value:", 0,1,255,1);
|
||||
: IntelliTool(Area, colorPicker){
|
||||
this->alphaInner = QInputDialog::getInt(nullptr,"Inner Alpha Value", "Value:", 0,0,255,1);
|
||||
this->edgeWidth = QInputDialog::getInt(nullptr,"Outer edge width", "Value:", 0,1,255,1);
|
||||
}
|
||||
|
||||
IntelliToolRectangle::~IntelliToolRectangle(){
|
||||
@@ -13,55 +13,55 @@ IntelliToolRectangle::~IntelliToolRectangle(){
|
||||
}
|
||||
|
||||
void IntelliToolRectangle::drawRectangle(QPoint otherCornor){
|
||||
int xMin = std::min(originCornor.x(), otherCornor.x());
|
||||
int xMax = std::max(originCornor.x(), otherCornor.x());
|
||||
int xMin = std::min(originCornor.x(), otherCornor.x());
|
||||
int xMax = std::max(originCornor.x(), otherCornor.x());
|
||||
|
||||
int yMin = std::min(originCornor.y(), otherCornor.y());
|
||||
int yMax = std::max(originCornor.y(), otherCornor.y());
|
||||
int yMin = std::min(originCornor.y(), otherCornor.y());
|
||||
int yMax = std::max(originCornor.y(), otherCornor.y());
|
||||
|
||||
QColor clr = colorPicker->getSecondColor();
|
||||
clr.setAlpha(alphaInner);
|
||||
for(int y=yMin; y<=yMax; y++){
|
||||
this->Canvas->image->drawLine(QPoint(xMin,y), QPoint(xMax, y), clr, 1);
|
||||
}
|
||||
this->Canvas->image->drawLine(QPoint(xMin, yMin),QPoint(xMin, yMax), this->colorPicker->getFirstColor(), edgeWidth);
|
||||
this->Canvas->image->drawLine(QPoint(xMin, yMin),QPoint(xMax, yMin), this->colorPicker->getFirstColor(), edgeWidth);
|
||||
this->Canvas->image->drawLine(QPoint(xMax, yMax),QPoint(xMin, yMax), this->colorPicker->getFirstColor(), edgeWidth);
|
||||
this->Canvas->image->drawLine(QPoint(xMax, yMax),QPoint(xMax, yMin), this->colorPicker->getFirstColor(), edgeWidth);
|
||||
QColor clr = colorPicker->getSecondColor();
|
||||
clr.setAlpha(alphaInner);
|
||||
for(int y=yMin; y<=yMax; y++) {
|
||||
this->Canvas->image->drawLine(QPoint(xMin,y), QPoint(xMax, y), clr, 1);
|
||||
}
|
||||
this->Canvas->image->drawLine(QPoint(xMin, yMin),QPoint(xMin, yMax), this->colorPicker->getFirstColor(), edgeWidth);
|
||||
this->Canvas->image->drawLine(QPoint(xMin, yMin),QPoint(xMax, yMin), this->colorPicker->getFirstColor(), edgeWidth);
|
||||
this->Canvas->image->drawLine(QPoint(xMax, yMax),QPoint(xMin, yMax), this->colorPicker->getFirstColor(), edgeWidth);
|
||||
this->Canvas->image->drawLine(QPoint(xMax, yMax),QPoint(xMax, yMin), this->colorPicker->getFirstColor(), edgeWidth);
|
||||
}
|
||||
|
||||
void IntelliToolRectangle::onMouseRightPressed(int x, int y){
|
||||
IntelliTool::onMouseRightPressed(x,y);
|
||||
IntelliTool::onMouseRightPressed(x,y);
|
||||
}
|
||||
|
||||
void IntelliToolRectangle::onMouseRightReleased(int x, int y){
|
||||
IntelliTool::onMouseRightReleased(x,y);
|
||||
IntelliTool::onMouseRightReleased(x,y);
|
||||
}
|
||||
|
||||
void IntelliToolRectangle::onMouseLeftPressed(int x, int y){
|
||||
IntelliTool::onMouseLeftPressed(x,y);
|
||||
this->originCornor=QPoint(x,y);
|
||||
drawRectangle(originCornor);
|
||||
Canvas->image->calculateVisiblity();
|
||||
IntelliTool::onMouseLeftPressed(x,y);
|
||||
this->originCornor=QPoint(x,y);
|
||||
drawRectangle(originCornor);
|
||||
Canvas->image->calculateVisiblity();
|
||||
}
|
||||
|
||||
void IntelliToolRectangle::onMouseLeftReleased(int x, int y){
|
||||
IntelliTool::onMouseLeftReleased(x,y);
|
||||
IntelliTool::onMouseLeftReleased(x,y);
|
||||
}
|
||||
|
||||
void IntelliToolRectangle::onMouseMoved(int x, int y){
|
||||
if(this->drawing){
|
||||
this->Canvas->image->drawPlain(Qt::transparent);
|
||||
QPoint next(x,y);
|
||||
drawRectangle(next);
|
||||
}
|
||||
IntelliTool::onMouseMoved(x,y);
|
||||
if(this->drawing) {
|
||||
this->Canvas->image->drawPlain(Qt::transparent);
|
||||
QPoint next(x,y);
|
||||
drawRectangle(next);
|
||||
}
|
||||
IntelliTool::onMouseMoved(x,y);
|
||||
}
|
||||
|
||||
void IntelliToolRectangle::onWheelScrolled(int value){
|
||||
IntelliTool::onWheelScrolled(value);
|
||||
this->edgeWidth+=value;
|
||||
if(this->edgeWidth<=0){
|
||||
this->edgeWidth=1;
|
||||
}
|
||||
IntelliTool::onWheelScrolled(value);
|
||||
this->edgeWidth+=value;
|
||||
if(this->edgeWidth<=0) {
|
||||
this->edgeWidth=1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,77 +8,77 @@
|
||||
/*!
|
||||
* \brief The IntelliToolRectangle class represents a tool to draw a rectangle.
|
||||
*/
|
||||
class IntelliToolRectangle : public IntelliTool{
|
||||
/*!
|
||||
* \brief A function that implements a rectagle drawing algorithm.
|
||||
* \param otherCornor - The second corner point of the rectangle.
|
||||
*/
|
||||
void drawRectangle(QPoint otherCornor);
|
||||
class IntelliToolRectangle : public IntelliTool {
|
||||
/*!
|
||||
* \brief A function that implements a rectagle drawing algorithm.
|
||||
* \param otherCornor - The second corner point of the rectangle.
|
||||
*/
|
||||
void drawRectangle(QPoint otherCornor);
|
||||
|
||||
/*!
|
||||
* \brief originCornor - The first corner point of the rectangle.
|
||||
*/
|
||||
QPoint originCornor;
|
||||
/*!
|
||||
* \brief alphaInner- Represents the alpha value of the inside.
|
||||
*/
|
||||
int alphaInner;
|
||||
/*!
|
||||
* \brief edgeWidth - The width of the rectangle edges.
|
||||
*/
|
||||
int edgeWidth;
|
||||
/*!
|
||||
* \brief originCornor - The first corner point of the rectangle.
|
||||
*/
|
||||
QPoint originCornor;
|
||||
/*!
|
||||
* \brief alphaInner- Represents the alpha value of the inside.
|
||||
*/
|
||||
int alphaInner;
|
||||
/*!
|
||||
* \brief edgeWidth - The width of the rectangle edges.
|
||||
*/
|
||||
int edgeWidth;
|
||||
public:
|
||||
/*!
|
||||
* \brief A constructor setting the general paintingArea and colorPicker. And reading in the alphaInner and edgeWidth.
|
||||
* \param Area - The general paintingArea used by the project.
|
||||
* \param colorPicker - The general colorPicker used by the project.
|
||||
*/
|
||||
IntelliToolRectangle(PaintingArea* Area, IntelliColorPicker* colorPicker);
|
||||
/*!
|
||||
* \brief A Destructor.
|
||||
*/
|
||||
virtual ~IntelliToolRectangle() override;
|
||||
/*!
|
||||
* \brief A constructor setting the general paintingArea and colorPicker. And reading in the alphaInner and edgeWidth.
|
||||
* \param Area - The general paintingArea used by the project.
|
||||
* \param colorPicker - The general colorPicker used by the project.
|
||||
*/
|
||||
IntelliToolRectangle(PaintingArea* Area, IntelliColorPicker* colorPicker);
|
||||
/*!
|
||||
* \brief A Destructor.
|
||||
*/
|
||||
virtual ~IntelliToolRectangle() override;
|
||||
|
||||
/*!
|
||||
* \brief A function managing the right click pressed of a mouse.Resetting the current draw.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseRightPressed(int x, int y) override;
|
||||
/*!
|
||||
* \brief A function managing the right click pressed of a mouse.Resetting the current draw.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseRightPressed(int x, int y) override;
|
||||
|
||||
/*!
|
||||
* \brief A function managing the right click released of a mouse.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseRightReleased(int x, int y) override;
|
||||
/*!
|
||||
* \brief A function managing the right click released of a mouse.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseRightReleased(int x, int y) override;
|
||||
|
||||
/*!
|
||||
* \brief A function managing the left click pressed of a mouse. Setting the originCorner and draws a rectangle.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseLeftPressed(int x, int y) override;
|
||||
/*!
|
||||
* \brief A function managing the left click pressed of a mouse. Setting the originCorner and draws a rectangle.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseLeftPressed(int x, int y) override;
|
||||
|
||||
/*!
|
||||
* \brief A function managing the left click released of a mouse. Merging the draw to the active layer.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseLeftReleased(int x, int y) override;
|
||||
/*!
|
||||
* \brief A function managing the left click released of a mouse. Merging the draw to the active layer.
|
||||
* \param x - The x coordinate relative to the active/canvas layer.
|
||||
* \param y - The y coordinate relative to the active/canvas layer.
|
||||
*/
|
||||
virtual void onMouseLeftReleased(int x, int y) override;
|
||||
|
||||
/*!
|
||||
* \brief A function managing the scroll event.Changing edgeWidth relativ to value.
|
||||
* \param value - The absolute the scroll has changed.
|
||||
*/
|
||||
virtual void onWheelScrolled(int value) override;
|
||||
/*!
|
||||
* \brief A function managing the scroll event.Changing edgeWidth relativ to value.
|
||||
* \param value - The absolute the scroll has changed.
|
||||
*/
|
||||
virtual void onWheelScrolled(int value) override;
|
||||
|
||||
/*!
|
||||
* \brief A function managing the mouse moved event.Drawing a rectangle to currrent mouse position.
|
||||
* \param x - The x coordinate of the new mouse position.
|
||||
* \param y - The y coordinate of the new mouse position.
|
||||
*/
|
||||
virtual void onMouseMoved(int x, int y) override;
|
||||
/*!
|
||||
* \brief A function managing the mouse moved event.Drawing a rectangle to currrent mouse position.
|
||||
* \param x - The x coordinate of the new mouse position.
|
||||
* \param y - The y coordinate of the new mouse position.
|
||||
*/
|
||||
virtual void onMouseMoved(int x, int y) override;
|
||||
};
|
||||
|
||||
#endif // INTELLIRECTANGLETOOL_H
|
||||
|
||||
Reference in New Issue
Block a user