diff --git a/src/IntelliPhoto.pro b/src/IntelliPhoto.pro index 47bf20e..9b0956d 100644 --- a/src/IntelliPhoto.pro +++ b/src/IntelliPhoto.pro @@ -28,7 +28,7 @@ SOURCES += \ Tool/IntelliToolLine.cpp \ Tool/IntelliToolPen.cpp \ Tool/IntelliToolPlain.cpp \ - Tool/IntelliToolRechteck.cpp \ + Tool/IntelliToolRectangle.cpp \ main.cpp HEADERS += \ @@ -44,7 +44,7 @@ HEADERS += \ Tool/IntelliToolLine.h \ Tool/IntelliToolPen.h \ Tool/IntelliToolPlain.h \ - Tool/IntelliToolRechteck.h \ + Tool/IntelliToolRectangle.h \ Tool/intellitoolcircle.h FORMS += \ diff --git a/src/Layer/PaintingArea.cpp b/src/Layer/PaintingArea.cpp index 1783a40..95ef554 100644 --- a/src/Layer/PaintingArea.cpp +++ b/src/Layer/PaintingArea.cpp @@ -14,12 +14,12 @@ #include "Tool/IntelliToolPlain.h" #include "Tool/IntelliToolLine.h" #include "Tool/IntelliToolCircle.h" -#include "Tool/IntelliToolRechteck.h" +#include "Tool/IntelliToolRectangle.h" PaintingArea::PaintingArea(int maxWidth, int maxHeight, QWidget *parent) :QWidget(parent){ //test yout tool here and reset after accomplished test - this->Tool = new IntelliToolRechteck(this, &colorPicker); + this->Tool = new IntelliToolRectangle(this, &colorPicker); this->setUp(maxWidth, maxHeight); //tetsing this->addLayer(200,200,0,0,ImageType::Shaped_Image); diff --git a/src/Tool/IntelliToolRechteck.cpp b/src/Tool/IntelliToolRectangle.cpp similarity index 73% rename from src/Tool/IntelliToolRechteck.cpp rename to src/Tool/IntelliToolRectangle.cpp index 05b1e79..0c89762 100644 --- a/src/Tool/IntelliToolRechteck.cpp +++ b/src/Tool/IntelliToolRectangle.cpp @@ -1,18 +1,18 @@ -#include"IntelliToolRechteck.h" +#include"IntelliToolRectangle.h" #include "Layer/PaintingArea.h" #include "QInputDialog" -IntelliToolRechteck::IntelliToolRechteck(PaintingArea* Area, IntelliColorPicker* colorPicker) +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); } -IntelliToolRechteck::~IntelliToolRechteck(){ +IntelliToolRectangle::~IntelliToolRectangle(){ } -void IntelliToolRechteck::drawRechteck(QPoint otherCornor){ +void IntelliToolRectangle::drawRectangle(QPoint otherCornor){ int xMin = std::min(originCornor.x(), otherCornor.x()); int xMax = std::max(originCornor.x(), otherCornor.x()); @@ -30,36 +30,36 @@ void IntelliToolRechteck::drawRechteck(QPoint otherCornor){ this->Canvas->image->drawLine(QPoint(xMax, yMax),QPoint(xMax, yMin), this->colorPicker->getFirstColor(), edgeWidth); } -void IntelliToolRechteck::onMouseRightPressed(int x, int y){ +void IntelliToolRectangle::onMouseRightPressed(int x, int y){ IntelliTool::onMouseRightPressed(x,y); } -void IntelliToolRechteck::onMouseRightReleased(int x, int y){ +void IntelliToolRectangle::onMouseRightReleased(int x, int y){ IntelliTool::onMouseRightReleased(x,y); } -void IntelliToolRechteck::onMouseLeftPressed(int x, int y){ +void IntelliToolRectangle::onMouseLeftPressed(int x, int y){ IntelliTool::onMouseLeftPressed(x,y); this->originCornor=QPoint(x,y); - drawRechteck(originCornor); + drawRectangle(originCornor); Canvas->image->calculateVisiblity(); } -void IntelliToolRechteck::onMouseLeftReleased(int x, int y){ +void IntelliToolRectangle::onMouseLeftReleased(int x, int y){ IntelliTool::onMouseLeftReleased(x,y); } -void IntelliToolRechteck::onMouseMoved(int x, int y){ +void IntelliToolRectangle::onMouseMoved(int x, int y){ IntelliTool::onMouseMoved(x,y); if(this->drawing){ this->Canvas->image->drawPlain(Qt::transparent); QPoint next(x,y); - drawRechteck(next); + drawRectangle(next); } IntelliTool::onMouseMoved(x,y); } -void IntelliToolRechteck::onWheelScrolled(int value){ +void IntelliToolRectangle::onWheelScrolled(int value){ IntelliTool::onWheelScrolled(value); this->edgeWidth+=value; if(this->edgeWidth<=0){ diff --git a/src/Tool/IntelliToolRechteck.h b/src/Tool/IntelliToolRectangle.h similarity index 61% rename from src/Tool/IntelliToolRechteck.h rename to src/Tool/IntelliToolRectangle.h index f3db883..2b59629 100644 --- a/src/Tool/IntelliToolRechteck.h +++ b/src/Tool/IntelliToolRectangle.h @@ -1,20 +1,20 @@ -#ifndef INTELLIRECHTECKTOOL_H -#define INTELLIRECHTECKTOOL_H +#ifndef INTELLIRECTANGLETOOL_H +#define INTELLIRECTANGLETOOL_H #include "IntelliTool.h" #include "QColor" #include "QPoint" -class IntelliToolRechteck : public IntelliTool{ - void drawRechteck(QPoint otherCornor); +class IntelliToolRectangle : public IntelliTool{ + void drawRectangle(QPoint otherCornor); QPoint originCornor; int alphaInner; int edgeWidth; public: - IntelliToolRechteck(PaintingArea* Area, IntelliColorPicker* colorPicker); - virtual ~IntelliToolRechteck() override; + IntelliToolRectangle(PaintingArea* Area, IntelliColorPicker* colorPicker); + virtual ~IntelliToolRectangle() override; virtual void onMouseRightPressed(int x, int y) override; virtual void onMouseRightReleased(int x, int y) override; @@ -26,4 +26,4 @@ public: virtual void onMouseMoved(int x, int y) override; }; -#endif // INTELLIRECHTECKTOOL_H +#endif // INTELLIRECTANGLETOOL_H