From 3af7470a05ab53d2a3c2658f73b62954885eaa24 Mon Sep 17 00:00:00 2001 From: Jan Schuffenhauer Date: Fri, 17 Jan 2020 08:56:00 +0100 Subject: [PATCH 1/4] push thatv thing --- cppcheck_config.txt | 306 -------------------- cppcheck_errors.txt | 80 ----- src/IntelliHelper/IntelliColorPicker.cpp | 4 +- src/IntelliHelper/IntelliColorPicker.h | 4 +- src/IntelliHelper/IntelliRenderSettings.cpp | 2 +- src/IntelliHelper/IntelliRenderSettings.h | 2 +- src/IntelliHelper/IntelliToolsettings.cpp | 4 +- src/IntelliHelper/IntelliToolsettings.h | 4 +- src/Tool/IntelliTool.cpp | 4 +- src/Tool/IntelliTool.h | 4 +- 10 files changed, 14 insertions(+), 400 deletions(-) delete mode 100644 cppcheck_config.txt delete mode 100644 cppcheck_errors.txt diff --git a/cppcheck_config.txt b/cppcheck_config.txt deleted file mode 100644 index 6f6a929..0000000 --- a/cppcheck_config.txt +++ /dev/null @@ -1,306 +0,0 @@ -src/GUI/IntelliInputDialog.h:4:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] - -^ -src/GUI/IntelliInputDialog.cpp:2:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] - -^ -src/GUI/IntelliPhotoGui.h:4:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] - -^ -src/GUI/IntelliPhotoGui.h:5:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] - -^ -src/GUI/IntelliPhotoGui.h:6:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] - -^ -src/GUI/IntelliPhotoGui.h:7:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] - -^ -src/GUI/IntelliPhotoGui.h:8:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] - -^ -src/GUI/IntelliPhotoGui.h:9:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] - -^ -src/GUI/IntelliPhotoGui.h:10:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] - -^ -src/GUI/IntelliPhotoGui.h:11:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] - -^ -src/GUI/IntelliPhotoGui.h:12:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] - -^ -src/GUI/IntelliPhotoGui.cpp:4:0: information: Include file: "Layer/PaintingArea.h" not found. [missingInclude] - -^ -src/Image/IntelliImage.cpp:1:0: information: Include file: "Image/IntelliImage.h" not found. [missingInclude] - -^ -src/Image/IntelliImage.cpp:2:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] - -^ -src/Image/IntelliImage.cpp:3:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] - -^ -src/Image/IntelliRasterImage.cpp:1:0: information: Include file: "Image/IntelliRasterImage.h" not found. [missingInclude] - -^ -src/Image/IntelliRasterImage.cpp:2:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] - -^ -src/Image/IntelliRasterImage.cpp:3:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] - -^ -src/Image/IntelliRasterImage.cpp:4:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] - -^ -src/Image/IntelliShapedImage.cpp:1:0: information: Include file: "Image/IntelliShapedImage.h" not found. [missingInclude] - -^ -src/Image/IntelliShapedImage.cpp:2:0: information: Include file: "IntelliHelper/IntelliTriangulation.h" not found. [missingInclude] - -^ -src/Image/IntelliShapedImage.cpp:3:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] - -^ -src/Image/IntelliShapedImage.cpp:4:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] - -^ -src/Image/IntelliShapedImage.cpp:5:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] - -^ -src/IntelliHelper/IntelliColorPicker.h:4:0: information: Include file: "QColor" not found. [missingInclude] - -^ -src/IntelliHelper/IntelliColorPicker.h:5:0: information: Include file: "QPoint" not found. [missingInclude] - -^ -src/IntelliHelper/IntelliColorPicker.h:6:0: information: Include file: "QColorDialog" not found. [missingInclude] - -^ -src/IntelliHelper/IntelliToolsettings.cpp:2:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] - -^ -src/IntelliHelper/IntelliTriangulation.h:4:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] - -^ -src/IntelliHelper/IntelliTriangulation.h:5:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] - -^ -src/IntelliHelper/IntelliTriangulation.cpp:2:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] - -^ -src/IntelliHelper/IntelliTriangulation.cpp:3:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] - -^ -src/IntelliHelper/IntelliTriangulation.cpp:4:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] - -^ -src/Layer/PaintingArea.cpp:2:0: information: Include file: "string.h" not found. [missingInclude] - -^ -src/Layer/PaintingArea.cpp:4:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] - -^ -src/Layer/PaintingArea.cpp:6:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] - -^ -src/Layer/PaintingArea.cpp:7:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] - -^ -src/Layer/PaintingArea.cpp:8:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] - -^ -src/Layer/PaintingArea.h:5:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] - -^ -src/Layer/PaintingArea.h:6:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] - -^ -src/Layer/PaintingArea.h:7:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] - -^ -src/Layer/PaintingArea.h:8:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] - -^ -src/Layer/PaintingArea.h:9:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] - -^ -src/Layer/PaintingArea.h:10:0: information: Include file: "GUI/IntelliPhotoGui.h" not found. [missingInclude] - -^ -src/Layer/PaintingArea.h:11:0: information: Include file: "Image/IntelliImage.h" not found. [missingInclude] - -^ -src/Layer/PaintingArea.h:12:0: information: Include file: "Image/IntelliRasterImage.h" not found. [missingInclude] - -^ -src/Layer/PaintingArea.h:13:0: information: Include file: "Image/IntelliShapedImage.h" not found. [missingInclude] - -^ -src/Layer/PaintingArea.h:14:0: information: Include file: "Tool/IntelliTool.h" not found. [missingInclude] - -^ -src/Layer/PaintingArea.h:15:0: information: Include file: "IntelliHelper/IntelliColorPicker.h" not found. [missingInclude] - -^ -src/Layer/PaintingArea.cpp:11:0: information: Include file: "Image/IntelliRasterImage.h" not found. [missingInclude] - -^ -src/Layer/PaintingArea.cpp:12:0: information: Include file: "Image/IntelliShapedImage.h" not found. [missingInclude] - -^ -src/Layer/PaintingArea.cpp:13:0: information: Include file: "Tool/IntelliToolPen.h" not found. [missingInclude] - -^ -src/Layer/PaintingArea.cpp:14:0: information: Include file: "Tool/IntelliToolPlain.h" not found. [missingInclude] - -^ -src/Layer/PaintingArea.cpp:15:0: information: Include file: "Tool/IntelliToolLine.h" not found. [missingInclude] - -^ -src/Layer/PaintingArea.cpp:16:0: information: Include file: "Tool/IntelliToolCircle.h" not found. [missingInclude] - -^ -src/Layer/PaintingArea.cpp:17:0: information: Include file: "Tool/IntelliToolRectangle.h" not found. [missingInclude] - -^ -src/Layer/PaintingArea.cpp:18:0: information: Include file: "Tool/IntelliToolFloodFill.h" not found. [missingInclude] - -^ -src/Layer/PaintingArea.cpp:19:0: information: Include file: "Tool/IntelliToolPolygon.h" not found. [missingInclude] - -^ -src/Tool/IntelliColorPicker.cpp:1:0: information: Include file: "IntelliColorPicker.h" not found. [missingInclude] - -^ -src/Tool/IntelliColorPicker.cpp:2:0: information: Include file: "QDebug" not found. [missingInclude] - -^ -src/Tool/IntelliTool.h:4:0: information: Include file: "IntelliHelper/IntelliColorPicker.h" not found. [missingInclude] - -^ -src/Tool/IntelliTool.h:5:0: information: Include file: "IntelliHelper/IntelliToolsettings.h" not found. [missingInclude] - -^ -src/Tool/IntelliTool.h:6:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] - -^ -src/Tool/IntelliTool.cpp:2:0: information: Include file: "Layer/PaintingArea.h" not found. [missingInclude] - -^ -src/Tool/IntelliToolCircle.h:5:0: information: Include file: "QColor" not found. [missingInclude] - -^ -src/Tool/IntelliToolCircle.h:6:0: information: Include file: "QPoint" not found. [missingInclude] - -^ -src/Tool/IntelliToolCircle.cpp:2:0: information: Include file: "Layer/PaintingArea.h" not found. [missingInclude] - -^ -src/Tool/IntelliToolCircle.cpp:3:0: information: Include file: "QInputDialog" not found. [missingInclude] - -^ -src/Tool/IntelliToolCircle.cpp:4:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] - -^ -src/Tool/IntelliToolFloodFill.h:5:0: information: Include file: "QColor" not found. [missingInclude] - -^ -src/Tool/IntelliToolFloodFill.cpp:2:0: information: Include file: "Layer/PaintingArea.h" not found. [missingInclude] - -^ -src/Tool/IntelliToolFloodFill.cpp:3:0: information: Include file: "QColorDialog" not found. [missingInclude] - -^ -src/Tool/IntelliToolFloodFill.cpp:4:0: information: Include file: "QInputDialog" not found. [missingInclude] - -^ -src/Tool/IntelliToolFloodFill.cpp:5:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] - -^ -src/Tool/IntelliToolFloodFill.cpp:6:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] - -^ -src/Tool/IntelliToolLine.h:5:0: information: Include file: "QPoint" not found. [missingInclude] - -^ -src/Tool/IntelliToolLine.cpp:2:0: information: Include file: "Layer/PaintingArea.h" not found. [missingInclude] - -^ -src/Tool/IntelliToolLine.cpp:3:0: information: Include file: "QColorDialog" not found. [missingInclude] - -^ -src/Tool/IntelliToolLine.cpp:4:0: information: Include file: "QInputDialog" not found. [missingInclude] - -^ -src/Tool/IntelliToolPen.h:5:0: information: Include file: "QColor" not found. [missingInclude] - -^ -src/Tool/IntelliToolPen.h:6:0: information: Include file: "QPoint" not found. [missingInclude] - -^ -src/Tool/IntelliToolPen.cpp:2:0: information: Include file: "Layer/PaintingArea.h" not found. [missingInclude] - -^ -src/Tool/IntelliToolPen.cpp:3:0: information: Include file: "QDebug" not found. [missingInclude] - -^ -src/Tool/IntelliToolPen.cpp:4:0: information: Include file: "QColorDialog" not found. [missingInclude] - -^ -src/Tool/IntelliToolPen.cpp:5:0: information: Include file: "QInputDialog" not found. [missingInclude] - -^ -src/Tool/IntelliToolPlain.h:5:0: information: Include file: "QColor" not found. [missingInclude] - -^ -src/Tool/IntelliToolPlain.cpp:2:0: information: Include file: "Layer/PaintingArea.h" not found. [missingInclude] - -^ -src/Tool/IntelliToolPlain.cpp:3:0: information: Include file: "QColorDialog" not found. [missingInclude] - -^ -src/Tool/IntelliToolPolygon.h:5:0: information: Include file: "IntelliHelper/IntelliTriangulation.h" not found. [missingInclude] - -^ -src/Tool/IntelliToolPolygon.h:6:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] - -^ -src/Tool/IntelliToolPolygon.h:7:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] - -^ -src/Tool/IntelliToolPolygon.cpp:2:0: information: Include file: "Layer/PaintingArea.h" not found. [missingInclude] - -^ -src/Tool/IntelliToolPolygon.cpp:3:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] - -^ -src/Tool/IntelliToolPolygon.cpp:4:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] - -^ -src/Tool/IntelliToolPolygon.cpp:5:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] - -^ -src/Tool/IntelliToolRectangle.h:6:0: information: Include file: "QColor" not found. [missingInclude] - -^ -src/Tool/IntelliToolRectangle.h:7:0: information: Include file: "QPoint" not found. [missingInclude] - -^ -src/Tool/IntelliToolRectangle.cpp:2:0: information: Include file: "Layer/PaintingArea.h" not found. [missingInclude] - -^ -src/Tool/IntelliToolRectangle.cpp:3:0: information: Include file: "QInputDialog" not found. [missingInclude] - -^ -src/main.cpp:2:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] - -^ -src/main.cpp:3:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] - -^ -src/main.cpp:4:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] - -^ diff --git a/cppcheck_errors.txt b/cppcheck_errors.txt deleted file mode 100644 index bf06cfd..0000000 --- a/cppcheck_errors.txt +++ /dev/null @@ -1,80 +0,0 @@ -src/IntelliHelper/IntelliColorPicker.cpp:4:3: performance: Variable 'firstColor' is assigned in constructor body. Consider performing initialization in initialization list. [useInitializationList] - firstColor = {255,0,0,255}; - ^ -src/IntelliHelper/IntelliColorPicker.cpp:5:3: performance: Variable 'secondColor' is assigned in constructor body. Consider performing initialization in initialization list. [useInitializationList] - secondColor = {0,255,255,255}; - ^ -src/IntelliHelper/IntelliTriangulation.cpp:116:63: style: Parameter 'triangles' can be declared with const [constParameter] -bool IntelliTriangulation::isInPolygon(std::vector &triangles, QPoint &point){ - ^ -src/Layer/PaintingArea.cpp:344:22: style: Redundant condition: If 'activeLayer > 0', the comparison 'activeLayer != -1' is always true. [redundantCondition] - if(activeLayer!=-1 && activeLayer>0) { - ^ -src/Tool/IntelliTool.cpp:4:14: warning: Member variable 'IntelliTool::ActiveType' is not initialized in the constructor. [uninitMemberVar] -IntelliTool::IntelliTool(PaintingArea* Area, IntelliColorPicker* colorPicker, IntelliToolsettings* Toolsettings){ - ^ -src/Tool/IntelliTool.cpp:4:14: warning: Member variable 'IntelliTool::activeLayer' is not initialized in the constructor. [uninitMemberVar] -IntelliTool::IntelliTool(PaintingArea* Area, IntelliColorPicker* colorPicker, IntelliToolsettings* Toolsettings){ - ^ -src/Tool/IntelliTool.cpp:4:14: warning: Member variable 'IntelliTool::Canvas' is not initialized in the constructor. [uninitMemberVar] -IntelliTool::IntelliTool(PaintingArea* Area, IntelliColorPicker* colorPicker, IntelliToolsettings* Toolsettings){ - ^ -src/Tool/IntelliToolCircle.cpp:42:9: style: Local variable 'yMin' shadows outer variable [shadowVariable] - int yMin = static_cast(centerPoint.y() - sqrt(pow(radius,2) - pow(i - centerPoint.x(),2))); - ^ -src/Tool/IntelliToolCircle.cpp:18:7: note: Shadowed declaration - int yMin, yMax, xMin, xMax; - ^ -src/Tool/IntelliToolCircle.cpp:42:9: note: Shadow variable - int yMin = static_cast(centerPoint.y() - sqrt(pow(radius,2) - pow(i - centerPoint.x(),2))); - ^ -src/Tool/IntelliToolCircle.cpp:43:9: style: Local variable 'yMax' shadows outer variable [shadowVariable] - int yMax = static_cast(centerPoint.y() + sqrt(pow(radius,2) - pow(i - centerPoint.x(),2))); - ^ -src/Tool/IntelliToolCircle.cpp:18:13: note: Shadowed declaration - int yMin, yMax, xMin, xMax; - ^ -src/Tool/IntelliToolCircle.cpp:43:9: note: Shadow variable - int yMax = static_cast(centerPoint.y() + sqrt(pow(radius,2) - pow(i - centerPoint.x(),2))); - ^ -src/Tool/IntelliToolPolygon.h:25:6: warning: The class 'IntelliToolPolygon' defines member variable with name 'isDrawing' also defined in its parent class 'IntelliTool'. [duplInheritedMember] -bool isDrawing; - ^ -src/Tool/IntelliTool.h:69:6: note: Parent variable 'IntelliTool::isDrawing' -bool isDrawing = false; - ^ -src/Tool/IntelliToolPolygon.h:25:6: note: Derived variable 'IntelliToolPolygon::isDrawing' -bool isDrawing; - ^ -src/GUI/IntelliPhotoGui.cpp:23:0: style: The function 'closeEvent' is never used. [unusedFunction] - -^ -src/Layer/PaintingArea.cpp:271:0: style: The function 'mouseMoveEvent' is never used. [unusedFunction] - -^ -src/Layer/PaintingArea.cpp:252:0: style: The function 'mousePressEvent' is never used. [unusedFunction] - -^ -src/Layer/PaintingArea.cpp:284:0: style: The function 'mouseReleaseEvent' is never used. [unusedFunction] - -^ -src/Layer/PaintingArea.cpp:314:0: style: The function 'paintEvent' is never used. [unusedFunction] - -^ -src/Layer/PaintingArea.cpp:325:0: style: The function 'resizeEvent' is never used. [unusedFunction] - -^ -src/Layer/PaintingArea.cpp:330:0: style: The function 'resizeLayer' is never used. [unusedFunction] - -^ -src/Layer/PaintingArea.cpp:170:0: style: The function 'slotActivateLayer' is never used. [unusedFunction] - -^ -src/Layer/PaintingArea.cpp:88:0: style: The function 'slotDeleteActiveLayer' is never used. [unusedFunction] - -^ -src/Layer/PaintingArea.cpp:299:0: style: The function 'wheelEvent' is never used. [unusedFunction] - -^ -nofile:0:0: information: Cppcheck cannot find all the include files (use --check-config for details) [missingInclude] - diff --git a/src/IntelliHelper/IntelliColorPicker.cpp b/src/IntelliHelper/IntelliColorPicker.cpp index 9d79722..0c36820 100644 --- a/src/IntelliHelper/IntelliColorPicker.cpp +++ b/src/IntelliHelper/IntelliColorPicker.cpp @@ -12,11 +12,11 @@ void IntelliColorPicker::swapColors(){ std::swap(firstColor, secondColor); } -QColor IntelliColorPicker::getFirstColor(){ +QColor IntelliColorPicker::getFirstColor() const{ return this->firstColor; } -QColor IntelliColorPicker::getSecondColor(){ +QColor IntelliColorPicker::getSecondColor() const{ return this->secondColor; } diff --git a/src/IntelliHelper/IntelliColorPicker.h b/src/IntelliHelper/IntelliColorPicker.h index 1efc591..8c97289 100644 --- a/src/IntelliHelper/IntelliColorPicker.h +++ b/src/IntelliHelper/IntelliColorPicker.h @@ -33,13 +33,13 @@ void swapColors(); * \brief A function to read the primary selected color. * \return Returns the primary color. */ -QColor getFirstColor(); +QColor getFirstColor() const; /*! * \brief A function to read the secondary selected color. * \return Returns the secondary color. */ -QColor getSecondColor(); +QColor getSecondColor() const; /*! * \brief A function to set the primary color. diff --git a/src/IntelliHelper/IntelliRenderSettings.cpp b/src/IntelliHelper/IntelliRenderSettings.cpp index c1f6b19..75ef1de 100644 --- a/src/IntelliHelper/IntelliRenderSettings.cpp +++ b/src/IntelliHelper/IntelliRenderSettings.cpp @@ -9,6 +9,6 @@ void IntelliRenderSettings::setFastRendering(bool Updatedsetting){ this->fastRenderering = Updatedsetting; } -bool IntelliRenderSettings::isFastRenderering(){ +bool IntelliRenderSettings::isFastRenderering() const{ return fastRenderering; } diff --git a/src/IntelliHelper/IntelliRenderSettings.h b/src/IntelliHelper/IntelliRenderSettings.h index 1fef570..e04dcfb 100644 --- a/src/IntelliHelper/IntelliRenderSettings.h +++ b/src/IntelliHelper/IntelliRenderSettings.h @@ -20,7 +20,7 @@ void setFastRendering(bool Updatedsetting); * \brief The getfastRenderer gets the value of the flag for the fastRenderer setting. * \return Returns true if fastRenderer is active else false */ -bool isFastRenderering(); +bool isFastRenderering() const; private: bool fastRenderering = true; diff --git a/src/IntelliHelper/IntelliToolsettings.cpp b/src/IntelliHelper/IntelliToolsettings.cpp index c6a7cfc..33566a6 100644 --- a/src/IntelliHelper/IntelliToolsettings.cpp +++ b/src/IntelliHelper/IntelliToolsettings.cpp @@ -11,7 +11,7 @@ IntelliToolsettings::~IntelliToolsettings(){ } -int IntelliToolsettings::getLineWidth(){ +int IntelliToolsettings::getLineWidth() const{ return lineWidth; } @@ -25,7 +25,7 @@ void IntelliToolsettings::setLineWidth(int LineWidth){ lineWidth = LineWidth; } -int IntelliToolsettings::getInnerAlpha(){ +int IntelliToolsettings::getInnerAlpha() const{ return this->innerAlpha; } diff --git a/src/IntelliHelper/IntelliToolsettings.h b/src/IntelliHelper/IntelliToolsettings.h index 1b0f90c..c2fd2bb 100644 --- a/src/IntelliHelper/IntelliToolsettings.h +++ b/src/IntelliHelper/IntelliToolsettings.h @@ -10,10 +10,10 @@ public: IntelliToolsettings(); virtual ~IntelliToolsettings(); -int getLineWidth(); +int getLineWidth() const; void setLineWidth(int LineWidth); -int getInnerAlpha(); +int getInnerAlpha() const; void setInnerAlpha(int innerAlpha); private: diff --git a/src/Tool/IntelliTool.cpp b/src/Tool/IntelliTool.cpp index 592bb2a..c758eab 100644 --- a/src/Tool/IntelliTool.cpp +++ b/src/Tool/IntelliTool.cpp @@ -96,10 +96,10 @@ void IntelliTool::deleteToolLayer(){ this->Canvas = nullptr; } -IntelliTool::Tooltype IntelliTool::getTooltype(){ +IntelliTool::Tooltype IntelliTool::getTooltype() const{ return ActiveType; } -bool IntelliTool::getIsDrawing(){ +bool IntelliTool::getIsDrawing() const{ return isDrawing; } diff --git a/src/Tool/IntelliTool.h b/src/Tool/IntelliTool.h index a3b2959..75783b6 100644 --- a/src/Tool/IntelliTool.h +++ b/src/Tool/IntelliTool.h @@ -127,9 +127,9 @@ virtual void onWheelScrolled(int value); */ virtual void onMouseMoved(int x, int y); -Tooltype getTooltype(); +Tooltype getTooltype() const; -bool getIsDrawing(); +bool getIsDrawing() const; }; #endif From 0c0917b294772db96925f14486d4d20cc1010ea9 Mon Sep 17 00:00:00 2001 From: Conrad Date: Fri, 17 Jan 2020 09:07:23 +0100 Subject: [PATCH 2/4] Automated Release Preparation --- cppcheck_config.txt | 381 +++++ cppcheck_errors.txt | 299 ++++ .../_intelli_color_picker_8cpp_source.html | 70 +- .../html/_intelli_color_picker_8h_source.html | 26 +- docs/html/_intelli_image_8h_source.html | 2 +- docs/html/_intelli_photo_gui_8cpp_source.html | 1434 +++++++++-------- docs/html/_intelli_photo_gui_8h_source.html | 226 +-- .../html/_intelli_raster_image_8h_source.html | 2 +- .../_intelli_render_settings_8cpp_source.html | 4 +- .../_intelli_render_settings_8h_source.html | 6 +- .../html/_intelli_shaped_image_8h_source.html | 2 +- docs/html/_intelli_tool_8cpp_source.html | 16 +- docs/html/_intelli_tool_8h_source.html | 10 +- .../_intelli_tool_circle_8cpp_source.html | 54 +- docs/html/_intelli_tool_circle_8h_source.html | 2 +- .../_intelli_tool_flood_fill_8cpp_source.html | 4 +- .../_intelli_tool_flood_fill_8h_source.html | 2 +- docs/html/_intelli_tool_line_8cpp_source.html | 10 +- docs/html/_intelli_tool_line_8h_source.html | 2 +- docs/html/_intelli_tool_pen_8cpp_source.html | 10 +- docs/html/_intelli_tool_pen_8h_source.html | 2 +- .../html/_intelli_tool_plain_8cpp_source.html | 4 +- docs/html/_intelli_tool_plain_8h_source.html | 2 +- docs/html/_intelli_tool_polygon_8cpp.html | 1 + .../_intelli_tool_polygon_8cpp_source.html | 315 ++-- .../html/_intelli_tool_polygon_8h_source.html | 18 +- .../_intelli_tool_rectangle_8cpp_source.html | 22 +- .../_intelli_tool_rectangle_8h_source.html | 2 +- .../_intelli_toolsettings_8cpp_source.html | 8 +- .../html/_intelli_toolsettings_8h_source.html | 8 +- docs/html/_painting_area_8cpp_source.html | 38 +- .../class_intelli_color_picker-members.html | 4 +- docs/html/class_intelli_color_picker.html | 36 +- docs/html/class_intelli_color_picker.js | 4 +- docs/html/class_intelli_photo_gui.html | 4 +- ...class_intelli_render_settings-members.html | 2 +- docs/html/class_intelli_render_settings.html | 12 +- docs/html/class_intelli_render_settings.js | 2 +- docs/html/class_intelli_tool-members.html | 4 +- docs/html/class_intelli_tool.html | 20 +- docs/html/class_intelli_tool.js | 4 +- .../class_intelli_tool_circle-members.html | 4 +- docs/html/class_intelli_tool_circle.html | 8 +- ...class_intelli_tool_flood_fill-members.html | 4 +- docs/html/class_intelli_tool_flood_fill.html | 8 +- .../html/class_intelli_tool_line-members.html | 4 +- docs/html/class_intelli_tool_line.html | 8 +- docs/html/class_intelli_tool_pen-members.html | 4 +- docs/html/class_intelli_tool_pen.html | 8 +- ...class_intelli_tool_plain_tool-members.html | 4 +- docs/html/class_intelli_tool_plain_tool.html | 8 +- .../class_intelli_tool_polygon-members.html | 4 +- docs/html/class_intelli_tool_polygon.html | 24 +- .../class_intelli_tool_rectangle-members.html | 4 +- docs/html/class_intelli_tool_rectangle.html | 8 +- .../class_intelli_toolsettings-members.html | 4 +- docs/html/class_intelli_toolsettings.html | 20 +- docs/html/class_intelli_toolsettings.js | 4 +- docs/html/functions.html | 14 +- docs/html/functions_func.html | 14 +- docs/html/main_unit_test_8cpp_source.html | 344 ++-- docs/html/navtreeindex0.js | 14 +- docs/html/search/all_5.js | 12 +- docs/html/search/all_7.js | 2 +- docs/html/search/functions_3.js | 12 +- docs/html/search/functions_4.js | 2 +- docs/html/tst__unittest_8cpp_source.html | 52 +- src/GUI/IntelliPhotoGui.cpp | 94 +- src/Image/IntelliImage.h | 2 +- src/Image/IntelliRasterImage.h | 2 +- src/Image/IntelliShapedImage.h | 2 +- src/IntelliHelper/IntelliColorPicker.cpp | 10 +- src/IntelliHelper/IntelliColorPicker.h | 2 +- src/IntelliHelper/IntelliRenderSettings.cpp | 2 +- src/IntelliHelper/IntelliRenderSettings.h | 2 +- src/IntelliHelper/IntelliToolsettings.cpp | 4 +- src/Layer/PaintingArea.cpp | 6 +- src/Layer/PaintingArea.h | 36 +- src/Tool/IntelliTool.cpp | 12 +- src/Tool/IntelliTool.h | 6 +- src/Tool/IntelliToolCircle.cpp | 34 +- src/Tool/IntelliToolCircle.h | 2 +- src/Tool/IntelliToolFloodFill.h | 2 +- src/Tool/IntelliToolLine.h | 2 +- src/Tool/IntelliToolPen.h | 2 +- src/Tool/IntelliToolPlain.h | 2 +- src/Tool/IntelliToolPolygon.cpp | 12 +- src/Tool/IntelliToolPolygon.h | 2 +- src/Tool/IntelliToolRectangle.h | 2 +- src/mainUnitTest.cpp | 304 ++-- src/tst_unittest.cpp | 118 +- 91 files changed, 2587 insertions(+), 1743 deletions(-) create mode 100644 cppcheck_config.txt create mode 100644 cppcheck_errors.txt diff --git a/cppcheck_config.txt b/cppcheck_config.txt new file mode 100644 index 0000000..ba080ef --- /dev/null +++ b/cppcheck_config.txt @@ -0,0 +1,381 @@ +src/GUI/IntelliInputDialog.h:4:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/GUI/IntelliInputDialog.h:5:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/GUI/IntelliInputDialog.h:6:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/GUI/IntelliInputDialog.h:7:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/GUI/IntelliInputDialog.h:8:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/GUI/IntelliInputDialog.h:9:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/GUI/IntelliInputDialog.h:10:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/GUI/IntelliPhotoGui.h:4:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/GUI/IntelliPhotoGui.h:5:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/GUI/IntelliPhotoGui.h:6:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/GUI/IntelliPhotoGui.h:7:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/GUI/IntelliPhotoGui.h:8:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/GUI/IntelliPhotoGui.h:9:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/GUI/IntelliPhotoGui.h:10:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/GUI/IntelliPhotoGui.h:11:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/GUI/IntelliPhotoGui.h:12:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/GUI/IntelliPhotoGui.h:13:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/GUI/IntelliPhotoGui.h:14:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/GUI/IntelliPhotoGui.h:15:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/GUI/IntelliPhotoGui.h:16:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/GUI/IntelliPhotoGui.cpp:4:0: information: Include file: "Layer/PaintingArea.h" not found. [missingInclude] + +^ +src/Image/IntelliImage.cpp:1:0: information: Include file: "Image/IntelliImage.h" not found. [missingInclude] + +^ +src/Image/IntelliImage.cpp:2:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/Image/IntelliImage.cpp:3:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/Image/IntelliRasterImage.cpp:1:0: information: Include file: "Image/IntelliRasterImage.h" not found. [missingInclude] + +^ +src/Image/IntelliRasterImage.cpp:2:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/Image/IntelliRasterImage.cpp:3:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/Image/IntelliRasterImage.cpp:4:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/Image/IntelliShapedImage.cpp:1:0: information: Include file: "Image/IntelliShapedImage.h" not found. [missingInclude] + +^ +src/Image/IntelliShapedImage.cpp:2:0: information: Include file: "IntelliHelper/IntelliTriangulation.h" not found. [missingInclude] + +^ +src/Image/IntelliShapedImage.cpp:3:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/Image/IntelliShapedImage.cpp:4:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/Image/IntelliShapedImage.cpp:5:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/IntelliHelper/IntelliColorPicker.h:4:0: information: Include file: "QColor" not found. [missingInclude] + +^ +src/IntelliHelper/IntelliColorPicker.h:5:0: information: Include file: "QPoint" not found. [missingInclude] + +^ +src/IntelliHelper/IntelliColorPicker.h:6:0: information: Include file: "QColorDialog" not found. [missingInclude] + +^ +src/IntelliHelper/IntelliToolsettings.cpp:2:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/IntelliHelper/IntelliTriangulation.h:7:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/IntelliHelper/IntelliTriangulation.h:8:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/IntelliHelper/IntelliTriangulation.cpp:2:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/IntelliHelper/IntelliTriangulation.cpp:3:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/IntelliHelper/IntelliTriangulation.cpp:4:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/Layer/PaintingArea.cpp:2:0: information: Include file: "string.h" not found. [missingInclude] + +^ +src/Layer/PaintingArea.cpp:4:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/Layer/PaintingArea.cpp:6:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/Layer/PaintingArea.cpp:7:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/Layer/PaintingArea.cpp:8:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/Layer/PaintingArea.h:5:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/Layer/PaintingArea.h:6:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/Layer/PaintingArea.h:7:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/Layer/PaintingArea.h:8:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/Layer/PaintingArea.h:9:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/Layer/PaintingArea.h:10:0: information: Include file: "GUI/IntelliPhotoGui.h" not found. [missingInclude] + +^ +src/Layer/PaintingArea.h:11:0: information: Include file: "Image/IntelliImage.h" not found. [missingInclude] + +^ +src/Layer/PaintingArea.h:12:0: information: Include file: "Image/IntelliRasterImage.h" not found. [missingInclude] + +^ +src/Layer/PaintingArea.h:13:0: information: Include file: "Image/IntelliShapedImage.h" not found. [missingInclude] + +^ +src/Layer/PaintingArea.h:14:0: information: Include file: "Tool/IntelliTool.h" not found. [missingInclude] + +^ +src/Layer/PaintingArea.h:15:0: information: Include file: "IntelliHelper/IntelliColorPicker.h" not found. [missingInclude] + +^ +src/Layer/PaintingArea.cpp:11:0: information: Include file: "Image/IntelliRasterImage.h" not found. [missingInclude] + +^ +src/Layer/PaintingArea.cpp:12:0: information: Include file: "Image/IntelliShapedImage.h" not found. [missingInclude] + +^ +src/Layer/PaintingArea.cpp:13:0: information: Include file: "Tool/IntelliToolPen.h" not found. [missingInclude] + +^ +src/Layer/PaintingArea.cpp:14:0: information: Include file: "Tool/IntelliToolPlain.h" not found. [missingInclude] + +^ +src/Layer/PaintingArea.cpp:15:0: information: Include file: "Tool/IntelliToolLine.h" not found. [missingInclude] + +^ +src/Layer/PaintingArea.cpp:16:0: information: Include file: "Tool/IntelliToolCircle.h" not found. [missingInclude] + +^ +src/Layer/PaintingArea.cpp:17:0: information: Include file: "Tool/IntelliToolRectangle.h" not found. [missingInclude] + +^ +src/Layer/PaintingArea.cpp:18:0: information: Include file: "Tool/IntelliToolFloodFill.h" not found. [missingInclude] + +^ +src/Layer/PaintingArea.cpp:19:0: information: Include file: "Tool/IntelliToolPolygon.h" not found. [missingInclude] + +^ +src/Tool/IntelliTool.h:4:0: information: Include file: "IntelliHelper/IntelliColorPicker.h" not found. [missingInclude] + +^ +src/Tool/IntelliTool.h:5:0: information: Include file: "IntelliHelper/IntelliToolsettings.h" not found. [missingInclude] + +^ +src/Tool/IntelliTool.h:6:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/Tool/IntelliTool.cpp:2:0: information: Include file: "Layer/PaintingArea.h" not found. [missingInclude] + +^ +src/Tool/IntelliToolCircle.h:5:0: information: Include file: "QColor" not found. [missingInclude] + +^ +src/Tool/IntelliToolCircle.h:6:0: information: Include file: "QPoint" not found. [missingInclude] + +^ +src/Tool/IntelliToolCircle.cpp:2:0: information: Include file: "Layer/PaintingArea.h" not found. [missingInclude] + +^ +src/Tool/IntelliToolCircle.cpp:3:0: information: Include file: "QInputDialog" not found. [missingInclude] + +^ +src/Tool/IntelliToolCircle.cpp:4:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/Tool/IntelliToolFloodFill.h:5:0: information: Include file: "QColor" not found. [missingInclude] + +^ +src/Tool/IntelliToolFloodFill.cpp:2:0: information: Include file: "Layer/PaintingArea.h" not found. [missingInclude] + +^ +src/Tool/IntelliToolFloodFill.cpp:3:0: information: Include file: "QColorDialog" not found. [missingInclude] + +^ +src/Tool/IntelliToolFloodFill.cpp:4:0: information: Include file: "QInputDialog" not found. [missingInclude] + +^ +src/Tool/IntelliToolFloodFill.cpp:5:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/Tool/IntelliToolFloodFill.cpp:6:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/Tool/IntelliToolLine.h:5:0: information: Include file: "QPoint" not found. [missingInclude] + +^ +src/Tool/IntelliToolLine.cpp:2:0: information: Include file: "Layer/PaintingArea.h" not found. [missingInclude] + +^ +src/Tool/IntelliToolLine.cpp:3:0: information: Include file: "QColorDialog" not found. [missingInclude] + +^ +src/Tool/IntelliToolLine.cpp:4:0: information: Include file: "QInputDialog" not found. [missingInclude] + +^ +src/Tool/IntelliToolPen.h:5:0: information: Include file: "QColor" not found. [missingInclude] + +^ +src/Tool/IntelliToolPen.h:6:0: information: Include file: "QPoint" not found. [missingInclude] + +^ +src/Tool/IntelliToolPen.cpp:2:0: information: Include file: "Layer/PaintingArea.h" not found. [missingInclude] + +^ +src/Tool/IntelliToolPen.cpp:3:0: information: Include file: "QDebug" not found. [missingInclude] + +^ +src/Tool/IntelliToolPen.cpp:4:0: information: Include file: "QColorDialog" not found. [missingInclude] + +^ +src/Tool/IntelliToolPen.cpp:5:0: information: Include file: "QInputDialog" not found. [missingInclude] + +^ +src/Tool/IntelliToolPlain.h:5:0: information: Include file: "QColor" not found. [missingInclude] + +^ +src/Tool/IntelliToolPlain.cpp:2:0: information: Include file: "Layer/PaintingArea.h" not found. [missingInclude] + +^ +src/Tool/IntelliToolPlain.cpp:3:0: information: Include file: "QColorDialog" not found. [missingInclude] + +^ +src/Tool/IntelliToolPolygon.h:5:0: information: Include file: "IntelliHelper/IntelliTriangulation.h" not found. [missingInclude] + +^ +src/Tool/IntelliToolPolygon.h:6:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/Tool/IntelliToolPolygon.h:7:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/Tool/IntelliToolPolygon.cpp:2:0: information: Include file: "Layer/PaintingArea.h" not found. [missingInclude] + +^ +src/Tool/IntelliToolPolygon.cpp:3:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/Tool/IntelliToolPolygon.cpp:4:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/Tool/IntelliToolPolygon.cpp:5:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/Tool/IntelliToolPolygon.cpp:6:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/Tool/IntelliToolRectangle.h:6:0: information: Include file: "QColor" not found. [missingInclude] + +^ +src/Tool/IntelliToolRectangle.h:7:0: information: Include file: "QPoint" not found. [missingInclude] + +^ +src/Tool/IntelliToolRectangle.cpp:2:0: information: Include file: "Layer/PaintingArea.h" not found. [missingInclude] + +^ +src/Tool/IntelliToolRectangle.cpp:3:0: information: Include file: "QInputDialog" not found. [missingInclude] + +^ +src/main.cpp:2:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/main.cpp:3:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/main.cpp:4:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/mainUnitTest.cpp:1:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/mainUnitTest.cpp:3:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/mainUnitTest.cpp:252:0: information: Include file: "tst_unittest.moc" not found. [missingInclude] + +^ +src/tst_unittest.cpp:1:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/tst_unittest.cpp:2:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/Image/IntelliImage.h:4:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/Image/IntelliImage.h:5:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/Image/IntelliImage.h:6:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/Image/IntelliImage.h:7:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/Image/IntelliImage.h:8:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/Image/IntelliImage.h:9:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/Image/IntelliImage.h:11:0: information: Include file: "IntelliHelper/IntelliTriangulation.h" not found. [missingInclude] + +^ +src/Image/IntelliImage.h:12:0: information: Include file: "IntelliHelper/IntelliRenderSettings.h" not found. [missingInclude] + +^ +src/Image/IntelliRasterImage.h:4:0: information: Include file: "Image/IntelliImage.h" not found. [missingInclude] + +^ +src/Image/IntelliShapedImage.h:4:0: information: Include file: "Image/IntelliRasterImage.h" not found. [missingInclude] + +^ +src/Image/IntelliShapedImage.h:5:0: information: Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem] + +^ +src/tst_unittest.cpp:1697:0: information: Include file: "tst_unittest.moc" not found. [missingInclude] + +^ diff --git a/cppcheck_errors.txt b/cppcheck_errors.txt new file mode 100644 index 0000000..99be2cd --- /dev/null +++ b/cppcheck_errors.txt @@ -0,0 +1,299 @@ +src/tst_unittest.cpp:1370:0: style: The function 'bench_Circle_fullDraw' is never used. [unusedFunction] + +^ +src/tst_unittest.cpp:1388:0: style: The function 'bench_Circle_interruptedDraw' is never used. [unusedFunction] + +^ +src/tst_unittest.cpp:1409:0: style: The function 'bench_FloodFill_fullDraw' is never used. [unusedFunction] + +^ +src/tst_unittest.cpp:1427:0: style: The function 'bench_FloodFill_interruptedDraw' is never used. [unusedFunction] + +^ +src/tst_unittest.cpp:1448:0: style: The function 'bench_Line_fullDraw' is never used. [unusedFunction] + +^ +src/tst_unittest.cpp:1466:0: style: The function 'bench_Line_interruptedDraw' is never used. [unusedFunction] + +^ +src/tst_unittest.cpp:1487:0: style: The function 'bench_Pen_fullDraw' is never used. [unusedFunction] + +^ +src/tst_unittest.cpp:1505:0: style: The function 'bench_Pen_interruptedDraw' is never used. [unusedFunction] + +^ +src/tst_unittest.cpp:1525:0: style: The function 'bench_Plain_fullDraw' is never used. [unusedFunction] + +^ +src/tst_unittest.cpp:1543:0: style: The function 'bench_Plain_interruptedDraw' is never used. [unusedFunction] + +^ +src/tst_unittest.cpp:1563:0: style: The function 'bench_Polygon_fullDraw' is never used. [unusedFunction] + +^ +src/tst_unittest.cpp:1602:0: style: The function 'bench_Polygon_interruptedDraw' is never used. [unusedFunction] + +^ +src/tst_unittest.cpp:1222:0: style: The function 'bench_RasterImage_drawLine' is never used. [unusedFunction] + +^ +src/tst_unittest.cpp:1210:0: style: The function 'bench_RasterImage_drawPixel' is never used. [unusedFunction] + +^ +src/tst_unittest.cpp:1235:0: style: The function 'bench_RasterImage_drawPoint' is never used. [unusedFunction] + +^ +src/tst_unittest.cpp:1247:0: style: The function 'bench_RasterImage_getDisplayable' is never used. [unusedFunction] + +^ +src/tst_unittest.cpp:1269:0: style: The function 'bench_RasterImage_getImageData' is never used. [unusedFunction] + +^ +src/tst_unittest.cpp:1257:0: style: The function 'bench_RasterImage_getPixelColor' is never used. [unusedFunction] + +^ +src/tst_unittest.cpp:1279:0: style: The function 'bench_RasterImage_setImageData' is never used. [unusedFunction] + +^ +src/tst_unittest.cpp:1626:0: style: The function 'bench_Rectangle_fullDraw' is never used. [unusedFunction] + +^ +src/tst_unittest.cpp:1645:0: style: The function 'bench_Rectangle_interruptedDraw' is never used. [unusedFunction] + +^ +src/tst_unittest.cpp:1302:0: style: The function 'bench_ShapedImage_drawLine' is never used. [unusedFunction] + +^ +src/tst_unittest.cpp:1290:0: style: The function 'bench_ShapedImage_drawPixel' is never used. [unusedFunction] + +^ +src/tst_unittest.cpp:1315:0: style: The function 'bench_ShapedImage_drawPoint' is never used. [unusedFunction] + +^ +src/tst_unittest.cpp:1327:0: style: The function 'bench_ShapedImage_getDisplayable' is never used. [unusedFunction] + +^ +src/tst_unittest.cpp:1349:0: style: The function 'bench_ShapedImage_getImageData' is never used. [unusedFunction] + +^ +src/tst_unittest.cpp:1337:0: style: The function 'bench_ShapedImage_getPixelColor' is never used. [unusedFunction] + +^ +src/tst_unittest.cpp:1359:0: style: The function 'bench_ShapedImage_setImageData' is never used. [unusedFunction] + +^ +src/tst_unittest.cpp:1666:0: style: The function 'bench_Triangulation_Coverage' is never used. [unusedFunction] + +^ +src/tst_unittest.cpp:1079:0: style: The function 'bench_addLayer' is never used. [unusedFunction] + +^ +src/tst_unittest.cpp:1180:0: style: The function 'bench_createTools' is never used. [unusedFunction] + +^ +src/tst_unittest.cpp:1086:0: style: The function 'bench_deleteLayer' is never used. [unusedFunction] + +^ +src/tst_unittest.cpp:1115:0: style: The function 'bench_floodFill' is never used. [unusedFunction] + +^ +src/tst_unittest.cpp:1125:0: style: The function 'bench_moveActive' is never used. [unusedFunction] + +^ +src/tst_unittest.cpp:1093:0: style: The function 'bench_setActive' is never used. [unusedFunction] + +^ +src/tst_unittest.cpp:1105:0: style: The function 'bench_setAlpha' is never used. [unusedFunction] + +^ +src/tst_unittest.cpp:1168:0: style: The function 'bench_setLayerDown' is never used. [unusedFunction] + +^ +src/tst_unittest.cpp:1155:0: style: The function 'bench_setLayerUp' is never used. [unusedFunction] + +^ +src/tst_unittest.cpp:1138:0: style: The function 'bench_setPolygon' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:118:0: style: The function 'cleanupTestCase' is never used. [unusedFunction] + +^ +src/GUI/IntelliPhotoGui.cpp:23:0: style: The function 'closeEvent' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:113:0: style: The function 'initTestCase' is never used. [unusedFunction] + +^ +src/Layer/PaintingArea.cpp:281:0: style: The function 'mouseMoveEvent' is never used. [unusedFunction] + +^ +src/Layer/PaintingArea.cpp:262:0: style: The function 'mousePressEvent' is never used. [unusedFunction] + +^ +src/Layer/PaintingArea.cpp:294:0: style: The function 'mouseReleaseEvent' is never used. [unusedFunction] + +^ +src/Layer/PaintingArea.cpp:324:0: style: The function 'paintEvent' is never used. [unusedFunction] + +^ +src/Layer/PaintingArea.cpp:180:0: style: The function 'slotActivateLayer' is never used. [unusedFunction] + +^ +src/Layer/PaintingArea.cpp:96:0: style: The function 'slotDeleteActiveLayer' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:211:0: style: The function 'test_Circle_fullDraw' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:213:0: style: The function 'test_Circle_interruptedDraw' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:216:0: style: The function 'test_FloodFill_fullDraw' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:218:0: style: The function 'test_FloodFill_interruptedDraw' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:221:0: style: The function 'test_Line_fullDraw' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:223:0: style: The function 'test_Line_interruptedDraw' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:226:0: style: The function 'test_Pen_fullDraw' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:228:0: style: The function 'test_Pen_interruptedDraw' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:231:0: style: The function 'test_Plain_fullDraw' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:233:0: style: The function 'test_Plain_interruptedDraw' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:236:0: style: The function 'test_Polygon_fullDraw' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:238:0: style: The function 'test_Polygon_interruptedDraw' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:157:0: style: The function 'test_RasterImage_drawLine' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:155:0: style: The function 'test_RasterImage_drawPixel' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:159:0: style: The function 'test_RasterImage_drawPoint' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:161:0: style: The function 'test_RasterImage_getDisplayable' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:169:0: style: The function 'test_RasterImage_getImageData' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:167:0: style: The function 'test_RasterImage_getPixelColor' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:165:0: style: The function 'test_RasterImage_loadImage' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:171:0: style: The function 'test_RasterImage_setImageData' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:163:0: style: The function 'test_RasterImage_setPolygon' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:241:0: style: The function 'test_Rectangle_fullDraw' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:243:0: style: The function 'test_Rectangle_interruptedDraw' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:177:0: style: The function 'test_ShapedImage_drawLine' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:175:0: style: The function 'test_ShapedImage_drawPixel' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:179:0: style: The function 'test_ShapedImage_drawPoint' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:181:0: style: The function 'test_ShapedImage_getDisplayable' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:189:0: style: The function 'test_ShapedImage_getImageData' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:187:0: style: The function 'test_ShapedImage_getPixelColor' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:185:0: style: The function 'test_ShapedImage_loadImage' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:191:0: style: The function 'test_ShapedImage_setImageData' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:183:0: style: The function 'test_ShapedImage_setPolygon' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:247:0: style: The function 'test_Triangulation_Coverage' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:132:0: style: The function 'test_addLayer' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:195:0: style: The function 'test_createTool_Circle' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:197:0: style: The function 'test_createTool_FloodFill' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:199:0: style: The function 'test_createTool_Line' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:201:0: style: The function 'test_createTool_Pen' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:203:0: style: The function 'test_createTool_Plain' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:205:0: style: The function 'test_createTool_Polygon' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:207:0: style: The function 'test_createTool_Rectangle' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:151:0: style: The function 'test_createTools' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:134:0: style: The function 'test_deleteLayer' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:140:0: style: The function 'test_floodFill' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:142:0: style: The function 'test_moveActive' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:136:0: style: The function 'test_setActive' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:138:0: style: The function 'test_setAlpha' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:148:0: style: The function 'test_setLayerDown' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:146:0: style: The function 'test_setLayerUp' is never used. [unusedFunction] + +^ +src/mainUnitTest.cpp:144:0: style: The function 'test_setPolygon' is never used. [unusedFunction] + +^ +src/Layer/PaintingArea.cpp:309:0: style: The function 'wheelEvent' is never used. [unusedFunction] + +^ +nofile:0:0: information: Cppcheck cannot find all the include files (use --check-config for details) [missingInclude] + diff --git a/docs/html/_intelli_color_picker_8cpp_source.html b/docs/html/_intelli_color_picker_8cpp_source.html index 7d1ff02..a3562cd 100644 --- a/docs/html/_intelli_color_picker_8cpp_source.html +++ b/docs/html/_intelli_color_picker_8cpp_source.html @@ -89,42 +89,46 @@ $(document).ready(function(){initNavTree('_intelli_color_picker_8cpp_source.html Go to the documentation of this file.
1 #include "IntelliColorPicker.h"
2 
-
4  firstColor = QColor(255,0,0,255);
-
5  secondColor = QColor(0,255,255,255);
-
6 }
-
7 
- -
9 
-
10 }
-
11 
- -
13  std::swap(firstColor, secondColor);
-
14 }
-
15 
- -
17  return this->firstColor;
-
18 }
-
19 
- -
21  return this->secondColor;
-
22 }
-
23 
- -
25  this->firstColor = Color;
-
26 }
-
27 
- -
29  this->secondColor = Color;
-
30 }
+
4  initializeColors();
+
5 }
+
6 
+ +
8 
+
9 }
+
10 
+ +
12  std::swap(firstColor, secondColor);
+
13 }
+
14 
+ +
16  return this->firstColor;
+
17 }
+
18 
+ +
20  return this->secondColor;
+
21 }
+
22 
+ +
24  this->firstColor = Color;
+
25 }
+
26 
+ +
28  this->secondColor = Color;
+
29 }
+
30 
+
31 void IntelliColorPicker::initializeColors(){
+
32  this->firstColor = QColor(255,0,0,255);
+
33  this->secondColor = QColor(0,0,0,255);
+
34 }
-
virtual ~IntelliColorPicker()
IntelliColorPicker destructor clears up his used memory, if there is some.
-
void setSecondColor(QColor Color)
A function to set the secondary color.
-
QColor getSecondColor()
A function to read the secondary selected color.
+
QColor getFirstColor() const
A function to read the primary selected color.
+
virtual ~IntelliColorPicker()
IntelliColorPicker destructor clears up his used memory, if there is some.
+
void setSecondColor(QColor Color)
A function to set the secondary color.
+
QColor getSecondColor() const
A function to read the secondary selected color.
-
void setFirstColor(QColor Color)
A function to set the primary color.
-
QColor getFirstColor()
A function to read the primary selected color.
-
void swapColors()
A function switching primary and secondary color.
+
void setFirstColor(QColor Color)
A function to set the primary color.
+
void swapColors()
A function switching primary and secondary color.
IntelliColorPicker()
IntelliColorPicker constructor, setting 2 preset colors, be careful, theese color may change in produ...
-
virtual ~IntelliColorPicker()
IntelliColorPicker destructor clears up his used memory, if there is some.
-
void setSecondColor(QColor Color)
A function to set the secondary color.
-
QColor getSecondColor()
A function to read the secondary selected color.
-
void setFirstColor(QColor Color)
A function to set the primary color.
-
QColor getFirstColor()
A function to read the primary selected color.
+
QColor getFirstColor() const
A function to read the primary selected color.
+
virtual ~IntelliColorPicker()
IntelliColorPicker destructor clears up his used memory, if there is some.
+
void setSecondColor(QColor Color)
A function to set the secondary color.
+
QColor getSecondColor() const
A function to read the secondary selected color.
+
void setFirstColor(QColor Color)
A function to set the primary color.
The IntelliColorPicker manages the selected colors for one whole project.
-
void swapColors()
A function switching primary and secondary color.
+
void swapColors()
A function switching primary and secondary color.
IntelliColorPicker()
IntelliColorPicker constructor, setting 2 preset colors, be careful, theese color may change in produ...
void createCircleTool()
+
QColor getFirstColor() const
A function to read the primary selected color.
void setRenderSettings(bool isFastRenderingOn)
setRenderSettings updates all Images to the new Rendersetting.
IntelliImage * getImageOfActiveLayer()
void createRectangleTool()
@@ -915,11 +964,11 @@ $(document).ready(function(){initNavTree('_intelli_photo_gui_8cpp_source.html','
void setLayerActive(int idx)
The setLayerToActive method marks a specific layer as active.
void deleteLayer(int idx, bool isTool=false)
The deleteLayer method removes a layer at a given idx.
-
QColor getSecondColor()
A function to read the secondary selected color.
void createPlainTool()
IntelliPhotoGui()
The IntelliPhotoGui method is the constructor and is used to create a new instance of the main progra...
The PaintingArea class manages the methods and stores information about the current painting area,...
Definition: PaintingArea.h:53
void createPenTool()
+
QColor getSecondColor() const
A function to read the secondary selected color.
void createLineTool()
void colorPickerSetSecondColor()
The colorPickerSetSecondColor calls the QTColorPicker to determine the secondary drawing color.
void colorPickerSetFirstColor()
The colorPickerSetFirstColor calls the QTColorPicker to determine the primary drawing color.
@@ -929,16 +978,15 @@ $(document).ready(function(){initNavTree('_intelli_photo_gui_8cpp_source.html','
void closeEvent(QCloseEvent *event) override
The closeEvent function handles closing events.
virtual QImage getImageData()
getImageData returns the data of the current image (Note: It will allways return a ARGB32bit QImage!...
-
void setToolWidth(int value)
+
void setToolWidth(int value)
bool open(const QString &filePath)
The open method is used for loading a picture into the current layer.
void createPolygonTool()
void moveActiveLayer(int idx)
The moveActiveLayer moves the active layer to a specific position in the layer stack.
IntelliColorPicker colorPicker
Definition: PaintingArea.h:202
-
QColor getFirstColor()
A function to read the primary selected color.
void createFloodFillTool()
void setInnerAlpha(int innerAlpha)
- +
IntelliToolsettings Toolsettings
Definition: PaintingArea.h:201
void setPolygon(int idx)
setPolygon is used for setting polygondata, it only works on RASTER images
diff --git a/docs/html/_intelli_photo_gui_8h_source.html b/docs/html/_intelli_photo_gui_8h_source.html index 918ad77..c09ecc4 100644 --- a/docs/html/_intelli_photo_gui_8h_source.html +++ b/docs/html/_intelli_photo_gui_8h_source.html @@ -165,119 +165,127 @@ $(document).ready(function(){initNavTree('_intelli_photo_gui_8h_source.html','')
86 
87 void slotAboutDialog();
88 
-
89 void slotEnterPressed();
+
89 void slotChangeDim();
90 
-
91 void slotSetWidth();
-
92 void slotSetInnerAlpha();
-
93 
-
94 void slotResetTools();
+
91 void slotEnterPressed();
+
92 
+
93 void slotSetWidth();
+
94 void slotSetInnerAlpha();
95 
-
96 private:
-
97 void createActions();
-
98 void createMenus();
-
99 void createGui();
-
100 // Set the style of the GUI
-
101 void setIntelliStyle();
-
102 
-
103 // Will check if changes have occurred since last save
-
104 bool maybeSave();
-
105 // Opens the Save dialog and saves
-
106 bool saveFile(const QByteArray &fileFormat);
-
107 
-
108 void setDefaultToolValue();
+
96 void slotResetTools();
+
97 
+
98 private:
+
99 void createActions();
+
100 void createMenus();
+
101 void createGui();
+
102 // Set the style of the GUI
+
103 void setIntelliStyle();
+
104 
+
105 // Will check if changes have occurred since last save
+
106 bool maybeSave();
+
107 // Opens the Save dialog and saves
+
108 bool saveFile(const QByteArray &fileFormat);
109 
-
110 // What we'll draw on
-
111 PaintingArea* paintingArea;
-
112 
-
113 const QSize Buttonsize = QSize(35,35);
-
114 QPixmap preview;
-
115 QPushButton* CircleButton;
-
116 QPushButton* FloodFillButton;
-
117 QPushButton* LineButton;
-
118 QPushButton* PenButton;
-
119 QPushButton* PlainButton;
-
120 QPushButton* PolygonButton;
-
121 QPushButton* RectangleButton;
-
122 QLabel* WidthLine;
-
123 QLabel* innerAlphaLine;
-
124 QLineEdit* EditLineWidth;
-
125 QLineEdit* EditLineInnerAlpha;
-
126 QIntValidator* ValidatorLineWidth;
-
127 QIntValidator* ValidatorInnerAlpha;
-
128 
-
129 QPushButton* FirstColorButton;
-
130 QPushButton* SecondColorButton;
-
131 QPushButton* SwitchColorButton;
-
132 
-
133 QLabel* ActiveLayerLine;
-
134 QLabel* ActiveLayerImageLabel;
-
135 
-
136 // The menu widgets
-
137 QMenu*saveAsMenu;
-
138 QMenu*fileMenu;
-
139 QMenu*renderMenu;
-
140 QMenu*optionMenu;
-
141 QMenu*layerCreationMenu;
-
142 QMenu*layerMenu;
-
143 QMenu*colorMenu;
-
144 QMenu*toolCreationMenu;
-
145 QMenu*toolSettingsMenu;
-
146 QMenu*toolMenu;
-
147 QMenu*helpMenu;
-
148 
-
149 // All the actions that can occur
-
150 // meta image actions (need further modularisation)
-
151 QAction* actionOpen;
-
152 QAction* actionExit;
+
110 void setDefaultToolValue();
+
111 
+
112 // What we'll draw on
+
113 PaintingArea* paintingArea;
+
114 
+
115 const QSize Buttonsize = QSize(35,35);
+
116 QPixmap preview;
+
117 QPushButton* CircleButton;
+
118 QPushButton* FloodFillButton;
+
119 QPushButton* LineButton;
+
120 QPushButton* PenButton;
+
121 QPushButton* PlainButton;
+
122 QPushButton* PolygonButton;
+
123 QPushButton* RectangleButton;
+
124 QLabel* WidthLine;
+
125 QLabel* innerAlphaLine;
+
126 QLineEdit* EditLineWidth;
+
127 QLineEdit* EditLineInnerAlpha;
+
128 QIntValidator* ValidatorLineWidth;
+
129 QIntValidator* ValidatorInnerAlpha;
+
130 
+
131 QPushButton* FirstColorButton;
+
132 QPushButton* SecondColorButton;
+
133 QPushButton* SwitchColorButton;
+
134 
+
135 QLabel* ActiveLayerLine;
+
136 QLabel* ActiveLayerImageLabel;
+
137 
+
138 QPushButton* dimActive;
+
139 QPushButton* dimCanvas;
+
140 
+
141 // The menu widgets
+
142 QMenu*saveAsMenu;
+
143 QMenu*fileMenu;
+
144 QMenu*renderMenu;
+
145 QMenu*optionMenu;
+
146 QMenu*layerCreationMenu;
+
147 QMenu*layerMenu;
+
148 QMenu*colorMenu;
+
149 QMenu*toolCreationMenu;
+
150 QMenu*toolSettingsMenu;
+
151 QMenu*toolMenu;
+
152 QMenu*helpMenu;
153 
-
154 //Rendersetting actions
-
155 QAction*actionUpdateRenderSettingsOn;
-
156 QAction*actionUpdateRenderSettingsOff;
-
157 
-
158 // color Picker actions
-
159 QAction* actionColorPickerFirstColor;
-
160 QAction* actionColorPickerSecondColor;
-
161 QAction* actionColorSwap;
+
154 // All the actions that can occur
+
155 // meta image actions (need further modularisation)
+
156 QAction* actionOpen;
+
157 QAction* actionExit;
+
158 
+
159 //Rendersetting actions
+
160 QAction*actionUpdateRenderSettingsOn;
+
161 QAction*actionUpdateRenderSettingsOff;
162 
-
163 // tool actions
-
164 QAction* actionCreatePenTool;
-
165 QAction* actionCreatePlainTool;
-
166 QAction* actionCreateLineTool;
-
167 QAction* actionCreateRectangleTool;
-
168 QAction* actionCreateCircleTool;
-
169 QAction* actionCreatePolygonTool;
-
170 QAction* actionCreateFloodFillTool;
-
171 
-
172 // dialog actions
-
173 QAction* actionAboutDialog;
-
174 QAction* actionAboutQtDialog;
-
175 
-
176 // layer change actions
-
177 QAction* actionCreateNewRasterLayer;
-
178 QAction* actionCreateNewShapedLayer;
-
179 QAction* actionDeleteLayer;
-
180 QAction* actionSetActiveLayer;
-
181 QAction* actionSetActiveAlpha;
-
182 QAction* actionSetPolygon;
-
183 QAction* actionMovePositionUp;
-
184 QAction* actionMovePositionDown;
-
185 QAction* actionMovePositionLeft;
-
186 QAction* actionMovePositionRight;
-
187 QAction* actionMoveLayerUp;
-
188 QAction* actionMoveLayerDown;
-
189 
-
190 // Actions tied to specific file formats
-
191 QList<QAction*> actionSaveAs;
-
192 
-
193 QAction* actionSetWidth;
-
194 QAction* actionSetInnerAlpha;
-
195 
-
196 // main GUI elements
-
197 QWidget* centralGuiWidget;
-
198 QGridLayout* mainLayout;
-
199 };
+
163 // color Picker actions
+
164 QAction* actionColorPickerFirstColor;
+
165 QAction* actionColorPickerSecondColor;
+
166 QAction* actionColorSwap;
+
167 
+
168 // tool actions
+
169 QAction* actionCreatePenTool;
+
170 QAction* actionCreatePlainTool;
+
171 QAction* actionCreateLineTool;
+
172 QAction* actionCreateRectangleTool;
+
173 QAction* actionCreateCircleTool;
+
174 QAction* actionCreatePolygonTool;
+
175 QAction* actionCreateFloodFillTool;
+
176 
+
177 // dimension actions
+
178 QAction*actionChangeDim;
+
179 
+
180 // dialog actions
+
181 QAction* actionAboutDialog;
+
182 QAction* actionAboutQtDialog;
+
183 
+
184 // layer change actions
+
185 QAction* actionCreateNewRasterLayer;
+
186 QAction* actionCreateNewShapedLayer;
+
187 QAction* actionDeleteLayer;
+
188 QAction* actionSetActiveLayer;
+
189 QAction* actionSetActiveAlpha;
+
190 QAction* actionSetPolygon;
+
191 QAction* actionMovePositionUp;
+
192 QAction* actionMovePositionDown;
+
193 QAction* actionMovePositionLeft;
+
194 QAction* actionMovePositionRight;
+
195 QAction* actionMoveLayerUp;
+
196 QAction* actionMoveLayerDown;
+
197 
+
198 // Actions tied to specific file formats
+
199 QList<QAction*> actionSaveAs;
200 
-
201 #endif
+
201 QAction* actionSetWidth;
+
202 QAction* actionSetInnerAlpha;
+
203 
+
204 // main GUI elements
+
205 QWidget* centralGuiWidget;
+
206 QGridLayout* mainLayout;
+
207 };
+
208 
+
209 #endif
@@ -286,9 +294,9 @@ $(document).ready(function(){initNavTree('_intelli_photo_gui_8h_source.html','')
The PaintingArea class manages the methods and stores information about the current painting area,...
Definition: PaintingArea.h:53
An abstract class that manages the basic events, like mouse clicks or scrolls events.
Definition: IntelliTool.h:17
void closeEvent(QCloseEvent *event) override
The closeEvent function handles closing events.
-
void setToolWidth(int value)
+
void setToolWidth(int value)
The IntelliColorPicker manages the selected colors for one whole project.
- + +
bool isFastRenderering() const
The getfastRenderer gets the value of the flag for the fastRenderer setting.
-
bool isFastRenderering()
The getfastRenderer gets the value of the flag for the fastRenderer setting.
void setFastRendering(bool Updatedsetting)
setFastRendering sets fastRendering to Updatedsetting.
diff --git a/docs/html/_intelli_render_settings_8h_source.html b/docs/html/_intelli_render_settings_8h_source.html index 1e196ba..e593d78 100644 --- a/docs/html/_intelli_render_settings_8h_source.html +++ b/docs/html/_intelli_render_settings_8h_source.html @@ -95,12 +95,12 @@ $(document).ready(function(){initNavTree('_intelli_render_settings_8h_source.htm
7 
9 {
-
10  friend UnitTest;
+
10 friend UnitTest;
11 public:
13 
18 void setFastRendering(bool Updatedsetting);
-
23 bool isFastRenderering();
+
23 bool isFastRenderering() const;
24 
25 private:
26 bool fastRenderering = true;
@@ -109,8 +109,8 @@ $(document).ready(function(){initNavTree('_intelli_render_settings_8h_source.htm
29 #endif
+
bool isFastRenderering() const
The getfastRenderer gets the value of the flag for the fastRenderer setting.
-
bool isFastRenderering()
The getfastRenderer gets the value of the flag for the fastRenderer setting.
void setFastRendering(bool Updatedsetting)
setFastRendering sets fastRendering to Updatedsetting.
diff --git a/docs/html/_intelli_shaped_image_8h_source.html b/docs/html/_intelli_shaped_image_8h_source.html index 9403334..2edf05e 100644 --- a/docs/html/_intelli_shaped_image_8h_source.html +++ b/docs/html/_intelli_shaped_image_8h_source.html @@ -96,7 +96,7 @@ $(document).ready(function(){initNavTree('_intelli_shaped_image_8h_source.html',
8 class UnitTest;
9 
-
14  friend UnitTest;
+
14 friend UnitTest;
15 friend IntelliTool;
16 private:
20 std::vector<Triangle> triangles;
diff --git a/docs/html/_intelli_tool_8cpp_source.html b/docs/html/_intelli_tool_8cpp_source.html index 1ef3e51..fff083b 100644 --- a/docs/html/_intelli_tool_8cpp_source.html +++ b/docs/html/_intelli_tool_8cpp_source.html @@ -138,7 +138,7 @@ $(document).ready(function(){initNavTree('_intelli_tool_8cpp_source.html',''); i
50 
52  //if needed for future general tasks implement in here
-
53  Area->DummyGui->setToolWidth(value + Toolsettings->getLineWidth());
+
53  Area->DummyGui->setToolWidth(value + Toolsettings->getLineWidth());
54 }
55 
56 bool IntelliTool::createToolLayer(){
@@ -184,21 +184,24 @@ $(document).ready(function(){initNavTree('_intelli_tool_8cpp_source.html',''); i
96  this->Canvas = nullptr;
97 }
98 
- +
100  return ActiveType;
101 }
102 
- +
104  return isDrawing;
105 }
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:18
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:36
+
IntelliColorPicker * colorPicker
A pointer to the IntelliColorPicker of the PaintingArea to interact with, and get the colors.
Definition: IntelliTool.h:57
virtual void onMouseLeftPressed(int x, int y)
A function managing the left click Pressed of a Mouse. Resetting the current draw....
Definition: IntelliTool.cpp:29
+
bool getIsDrawing() const
IntelliToolsettings * Toolsettings
Definition: IntelliTool.h:59
+
Tooltype getTooltype() const
Definition: IntelliTool.cpp:99
void deleteLayer(int idx, bool isTool=false)
The deleteLayer method removes a layer at a given idx.
PaintingArea * Area
A pointer to the general PaintingArea to interact with.
Definition: IntelliTool.h:50
@@ -208,22 +211,19 @@ $(document).ready(function(){initNavTree('_intelli_tool_8cpp_source.html',''); i
virtual std::vector< QPoint > getPolygonData()
A function that returns the Polygondata if existent.
Definition: IntelliImage.h:134
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:25
LayerObject * activeLayer
A pointer to the underlying active Layer, do not work on this. This is used for data grabbing or prev...
Definition: IntelliTool.h:64
-
Tooltype getTooltype()
Definition: IntelliTool.cpp:99
LayerObject * Canvas
A pointer to the drawing canvas of the tool, work on this.
Definition: IntelliTool.h:69
int width
width - Stores the width of a layer in pixels.
Definition: PaintingArea.h:31
virtual QImage getImageData()
getImageData returns the data of the current image (Note: It will allways return a ARGB32bit QImage!...
virtual void setImageData(const QImage &newData)
setImageData overwrites the old imageData the new imageData.
-
void setToolWidth(int value)
-
bool getIsDrawing()
+
void setToolWidth(int value)
int height
height - Stores the height of a layer in pixels.
Definition: PaintingArea.h:35
Tooltype ActiveType
Definition: IntelliTool.h:52
The IntelliColorPicker manages the selected colors for one whole project.
IntelliTool(PaintingArea *Area, IntelliColorPicker *colorPicker, IntelliToolsettings *Toolsettings)
A constructor setting the general Painting Area and colorPicker.
Definition: IntelliTool.cpp:4
- +
QImage imageData
The underlying image data.
Definition: IntelliImage.h:41
IntelliImage * image
image - Stores the imageData of the current LayerObject.
Definition: PaintingArea.h:27
-
virtual void onMouseMoved(int x, int y)
A function managing the mouse moved event. Call this in child classes!
Definition: IntelliTool.cpp:46
virtual void calculateVisiblity()=0
An abstract function that calculates the visiblity of the Image data if needed.
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:51
diff --git a/docs/html/_intelli_tool_8h_source.html b/docs/html/_intelli_tool_8h_source.html index 69b89e3..97b42f8 100644 --- a/docs/html/_intelli_tool_8h_source.html +++ b/docs/html/_intelli_tool_8h_source.html @@ -100,7 +100,7 @@ $(document).ready(function(){initNavTree('_intelli_tool_8h_source.html',''); ini
12 class PaintingArea;
13 
17 class IntelliTool {
-
18  friend UnitTest;
+
18 friend UnitTest;
19 public:
20 enum class Tooltype {
21  CIRCLE,
@@ -150,9 +150,9 @@ $(document).ready(function(){initNavTree('_intelli_tool_8h_source.html',''); ini
122 
128 virtual void onMouseMoved(int x, int y);
129 
- +
130 Tooltype getTooltype() const;
131 
-
132 bool getIsDrawing();
+
132 bool getIsDrawing() const;
133 
134 };
135 #endif
@@ -163,7 +163,9 @@ $(document).ready(function(){initNavTree('_intelli_tool_8h_source.html',''); ini
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:36
IntelliColorPicker * colorPicker
A pointer to the IntelliColorPicker of the PaintingArea to interact with, and get the colors.
Definition: IntelliTool.h:57
virtual void onMouseLeftPressed(int x, int y)
A function managing the left click Pressed of a Mouse. Resetting the current draw....
Definition: IntelliTool.cpp:29
+
bool getIsDrawing() const
IntelliToolsettings * Toolsettings
Definition: IntelliTool.h:59
+
Tooltype getTooltype() const
Definition: IntelliTool.cpp:99
@@ -177,10 +179,8 @@ $(document).ready(function(){initNavTree('_intelli_tool_8h_source.html',''); ini -
Tooltype getTooltype()
Definition: IntelliTool.cpp:99
LayerObject * Canvas
A pointer to the drawing canvas of the tool, work on this.
Definition: IntelliTool.h:69
An abstract class that manages the basic events, like mouse clicks or scrolls events.
Definition: IntelliTool.h:17
-
bool getIsDrawing()
Tooltype ActiveType
Definition: IntelliTool.h:52
The IntelliColorPicker manages the selected colors for one whole project.
IntelliTool(PaintingArea *Area, IntelliColorPicker *colorPicker, IntelliToolsettings *Toolsettings)
A constructor setting the general Painting Area and colorPicker.
Definition: IntelliTool.cpp:4
diff --git a/docs/html/_intelli_tool_circle_8cpp_source.html b/docs/html/_intelli_tool_circle_8cpp_source.html index 0fe40ff..708b1ee 100644 --- a/docs/html/_intelli_tool_circle_8cpp_source.html +++ b/docs/html/_intelli_tool_circle_8cpp_source.html @@ -101,36 +101,36 @@ $(document).ready(function(){initNavTree('_intelli_tool_circle_8cpp_source.html'
13 }
14 
15 void IntelliToolCircle::drawCircle(int radius){
-
16  QColor inner = this->colorPicker->getSecondColor();
-
17  inner.setAlpha(Toolsettings->getInnerAlpha());
-
18  int yMin, yMax, xMin, xMax;
-
19  yMin = centerPoint.y() - radius;
-
20  yMax = centerPoint.y() + radius;
+
16  QColor inner = this->colorPicker->getSecondColor();
+
17  inner.setAlpha(Toolsettings->getInnerAlpha());
+
18  int yMinimum, yMaximum, xMinimum, xMaximum;
+
19  yMinimum = centerPoint.y() - radius;
+
20  yMaximum = centerPoint.y() + radius;
21  // x = x0+-sqrt(r2-(y-y0)2)
-
22  for(int i = yMin; i<=yMax; i++) {
-
23  xMin = static_cast<int>(centerPoint.x() - sqrt(pow(radius,2) - pow(i - centerPoint.y(),2)));
-
24  xMax = static_cast<int>(centerPoint.x() + sqrt(pow(radius,2) - pow(i - centerPoint.y(),2)));
-
25  this->Canvas->image->drawLine(QPoint(xMin,i), QPoint(xMax,i),inner,1);
+
22  for(int i = yMinimum; i<=yMaximum; i++) {
+
23  xMinimum = static_cast<int>(centerPoint.x() - sqrt(pow(radius,2) - pow(i - centerPoint.y(),2)));
+
24  xMaximum = static_cast<int>(centerPoint.x() + sqrt(pow(radius,2) - pow(i - centerPoint.y(),2)));
+
25  this->Canvas->image->drawLine(QPoint(xMinimum,i), QPoint(xMaximum,i),inner,1);
26  }
27 
28  //TODO implement circle drawing algorithm bresenham
-
29  radius = static_cast<int>(radius + (Toolsettings->getLineWidth() / 2.));
-
30  yMin = (centerPoint.y() - radius);
-
31  yMax = (centerPoint.y() + radius);
-
32  for(int i = yMin; i<=yMax; i++) {
-
33  xMin = static_cast<int>(centerPoint.x() - sqrt(pow(radius,2) - pow(i - centerPoint.y(),2)));
-
34  xMax = static_cast<int>(centerPoint.x() + sqrt(pow(radius,2) - pow(i - centerPoint.y(),2)));
- - +
29  radius = static_cast<int>(radius + (Toolsettings->getLineWidth() / 2.));
+
30  yMinimum = (centerPoint.y() - radius);
+
31  yMaximum = (centerPoint.y() + radius);
+
32  for(int i = yMinimum; i<=yMaximum; i++) {
+
33  xMinimum = static_cast<int>(centerPoint.x() - sqrt(pow(radius,2) - pow(i - centerPoint.y(),2)));
+
34  xMaximum = static_cast<int>(centerPoint.x() + sqrt(pow(radius,2) - pow(i - centerPoint.y(),2)));
+
35  this->Canvas->image->drawPoint(QPoint(xMinimum,i), colorPicker->getFirstColor(),Toolsettings->getLineWidth());
+
36  this->Canvas->image->drawPoint(QPoint(xMaximum,i), colorPicker->getFirstColor(),Toolsettings->getLineWidth());
37  }
38 
-
39  xMin = (centerPoint.x() - radius);
-
40  xMax = (centerPoint.x() + radius);
-
41  for(int i = xMin; i<=xMax; i++) {
+
39  xMinimum = (centerPoint.x() - radius);
+
40  xMaximum = (centerPoint.x() + radius);
+
41  for(int i = xMinimum; i<=xMaximum; i++) {
42  int yMin = static_cast<int>(centerPoint.y() - sqrt(pow(radius,2) - pow(i - centerPoint.x(),2)));
43  int yMax = static_cast<int>(centerPoint.y() + sqrt(pow(radius,2) - pow(i - centerPoint.x(),2)));
- - + +
46  }
47 }
48 
@@ -158,7 +158,7 @@ $(document).ready(function(){initNavTree('_intelli_tool_circle_8cpp_source.html'
70 
- +
74 }
75 
@@ -174,17 +174,19 @@ $(document).ready(function(){initNavTree('_intelli_tool_circle_8cpp_source.html'
virtual void onMouseRightPressed(int x, int y) override
A function managing the right click pressed of a mouse. Clearing the canvas layer.
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:18
+
QColor getFirstColor() const
A function to read the primary selected color.
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:36
+
virtual void onMouseRightReleased(int x, int y) override
A function managing the right click released of a mouse.
IntelliColorPicker * colorPicker
A pointer to the IntelliColorPicker of the PaintingArea to interact with, and get the colors.
Definition: IntelliTool.h:57
virtual void drawLine(const QPoint &p1, const QPoint &p2, const QColor &color, const int &penWidth)
A function that draws a line between two given points in a given color.
virtual void onWheelScrolled(int value) override
A function managing the scroll event. Changing the edge Width relative to value.
virtual void onMouseLeftPressed(int x, int y)
A function managing the left click Pressed of a Mouse. Resetting the current draw....
Definition: IntelliTool.cpp:29
IntelliToolsettings * Toolsettings
Definition: IntelliTool.h:59
-
QColor getSecondColor()
A function to read the secondary selected color.
+
The PaintingArea class manages the methods and stores information about the current painting area,...
Definition: PaintingArea.h:53
bool isDrawing
A flag checking if the user is currently drawing or not.
Definition: IntelliTool.h:74
- +
QColor getSecondColor() const
A function to read the secondary selected color.
virtual void drawPoint(const QPoint &p1, const QColor &color, const int &penWidth)
A function that draws a point between on a given point in a given color.
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:25
LayerObject * Canvas
A pointer to the drawing canvas of the tool, work on this.
Definition: IntelliTool.h:69
@@ -192,14 +194,12 @@ $(document).ready(function(){initNavTree('_intelli_tool_circle_8cpp_source.html'
virtual ~IntelliToolCircle() override
A Destructor.
An abstract class that manages the basic events, like mouse clicks or scrolls events.
Definition: IntelliTool.h:17
-
QColor getFirstColor()
A function to read the primary selected color.
Tooltype ActiveType
Definition: IntelliTool.h:52
The IntelliColorPicker manages the selected colors for one whole project.
virtual void onMouseMoved(int x, int y) override
A function managing the mouse moved event. Draws a circle with radius of eulerian norm of mouse posit...
IntelliImage * image
image - Stores the imageData of the current LayerObject.
Definition: PaintingArea.h:27
virtual void onMouseLeftReleased(int x, int y) override
A function managing the left click released of a mouse.
void setLineWidth(int LineWidth)
-
virtual void onMouseMoved(int x, int y)
A function managing the mouse moved event. Call this in child classes!
Definition: IntelliTool.cpp:46
virtual void calculateVisiblity()=0
An abstract function that calculates the visiblity of the Image data if needed.
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:51
diff --git a/docs/html/_intelli_tool_circle_8h_source.html b/docs/html/_intelli_tool_circle_8h_source.html index 2102f4e..d35ed0e 100644 --- a/docs/html/_intelli_tool_circle_8h_source.html +++ b/docs/html/_intelli_tool_circle_8h_source.html @@ -97,7 +97,7 @@ $(document).ready(function(){initNavTree('_intelli_tool_circle_8h_source.html','
9 class UnitTest;
10 
-
15  friend UnitTest;
+
15 friend UnitTest;
20 void drawCircle(int radius);
21 
25 QPoint centerPoint;
diff --git a/docs/html/_intelli_tool_flood_fill_8cpp_source.html b/docs/html/_intelli_tool_flood_fill_8cpp_source.html index 7b84984..171f085 100644 --- a/docs/html/_intelli_tool_flood_fill_8cpp_source.html +++ b/docs/html/_intelli_tool_flood_fill_8cpp_source.html @@ -121,7 +121,7 @@ $(document).ready(function(){initNavTree('_intelli_tool_flood_fill_8cpp_source.h
33  Q.push(start);
34 
35  QColor oldColor = this->activeLayer->image->getPixelColor(start);
-
36  QColor newColor = this->colorPicker->getFirstColor();
+
36  QColor newColor = this->colorPicker->getFirstColor();
37  if(newColor == oldColor) {
38  return;
39  }
@@ -172,6 +172,7 @@ $(document).ready(function(){initNavTree('_intelli_tool_flood_fill_8cpp_source.h
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:18
+
QColor getFirstColor() const
A function to read the primary selected color.
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:36
IntelliColorPicker * colorPicker
A pointer to the IntelliColorPicker of the PaintingArea to interact with, and get the colors.
Definition: IntelliTool.h:57
virtual void onMouseRightReleased(int x, int y) override
A function managing the right click released of a mouse.
@@ -192,7 +193,6 @@ $(document).ready(function(){initNavTree('_intelli_tool_flood_fill_8cpp_source.h
virtual void onMouseMoved(int x, int y) override
A function managing the mouse moved event.
An abstract class that manages the basic events, like mouse clicks or scrolls events.
Definition: IntelliTool.h:17
-
QColor getFirstColor()
A function to read the primary selected color.
virtual QColor getPixelColor(QPoint &point)
A function that returns the pixelcolor at a certain point.
int height
height - Stores the height of a layer in pixels.
Definition: PaintingArea.h:35
Tooltype ActiveType
Definition: IntelliTool.h:52
diff --git a/docs/html/_intelli_tool_flood_fill_8h_source.html b/docs/html/_intelli_tool_flood_fill_8h_source.html index f8f2409..b52a654 100644 --- a/docs/html/_intelli_tool_flood_fill_8h_source.html +++ b/docs/html/_intelli_tool_flood_fill_8h_source.html @@ -97,7 +97,7 @@ $(document).ready(function(){initNavTree('_intelli_tool_flood_fill_8h_source.htm
9 
10 
-
15  friend UnitTest;
+
15 friend UnitTest;
16 public:
23 
diff --git a/docs/html/_intelli_tool_line_8cpp_source.html b/docs/html/_intelli_tool_line_8cpp_source.html index 3f9ffdf..e0a8036 100644 --- a/docs/html/_intelli_tool_line_8cpp_source.html +++ b/docs/html/_intelli_tool_line_8cpp_source.html @@ -111,7 +111,7 @@ $(document).ready(function(){initNavTree('_intelli_tool_line_8cpp_source.html','
25  this->lineStartingPoint = QPoint(x,y);
-
26  this->Canvas->image->drawPoint(lineStartingPoint, colorPicker->getFirstColor(),Toolsettings->getLineWidth());
+
26  this->Canvas->image->drawPoint(lineStartingPoint, colorPicker->getFirstColor(),Toolsettings->getLineWidth());
28 }
29 
@@ -121,21 +121,23 @@ $(document).ready(function(){initNavTree('_intelli_tool_line_8cpp_source.html','
33 
- +
37 }
38 
39 void IntelliToolLine::onMouseMoved(int x, int y){
40  if(this->isDrawing) {
41  this->Canvas->image->drawPlain(Qt::transparent);
42  QPoint next(x,y);
-
43  this->Canvas->image->drawLine(lineStartingPoint,next,colorPicker->getFirstColor(),Toolsettings->getLineWidth());
+
43  this->Canvas->image->drawLine(lineStartingPoint,next,colorPicker->getFirstColor(),Toolsettings->getLineWidth());
44  }
46 }
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:18
+
QColor getFirstColor() const
A function to read the primary selected color.
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:36
+
IntelliColorPicker * colorPicker
A pointer to the IntelliColorPicker of the PaintingArea to interact with, and get the colors.
Definition: IntelliTool.h:57
virtual void drawLine(const QPoint &p1, const QPoint &p2, const QColor &color, const int &penWidth)
A function that draws a line between two given points in a given color.
virtual void onMouseLeftPressed(int x, int y)
A function managing the left click Pressed of a Mouse. Resetting the current draw....
Definition: IntelliTool.cpp:29
@@ -155,14 +157,12 @@ $(document).ready(function(){initNavTree('_intelli_tool_line_8cpp_source.html','
LayerObject * Canvas
A pointer to the drawing canvas of the tool, work on this.
Definition: IntelliTool.h:69
An abstract class that manages the basic events, like mouse clicks or scrolls events.
Definition: IntelliTool.h:17
-
QColor getFirstColor()
A function to read the primary selected color.
Tooltype ActiveType
Definition: IntelliTool.h:52
The IntelliColorPicker manages the selected colors for one whole project.
IntelliImage * image
image - Stores the imageData of the current LayerObject.
Definition: PaintingArea.h:27
virtual void onMouseLeftPressed(int x, int y) override
A function managing the left click pressed of a mouse. Sets the starting point of the line.
void setLineWidth(int LineWidth)
-
virtual void onMouseMoved(int x, int y)
A function managing the mouse moved event. Call this in child classes!
Definition: IntelliTool.cpp:46
virtual void calculateVisiblity()=0
An abstract function that calculates the visiblity of the Image data if needed.
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:51
diff --git a/docs/html/_intelli_tool_line_8h_source.html b/docs/html/_intelli_tool_line_8h_source.html index 8ba791a..b7e23e6 100644 --- a/docs/html/_intelli_tool_line_8h_source.html +++ b/docs/html/_intelli_tool_line_8h_source.html @@ -96,7 +96,7 @@ $(document).ready(function(){initNavTree('_intelli_tool_line_8h_source.html','')
8 class UnitTest;
9 
13 class IntelliToolLine : public IntelliTool {
-
14  friend UnitTest;
+
14 friend UnitTest;
18 QPoint lineStartingPoint;
19 
20 public:
diff --git a/docs/html/_intelli_tool_pen_8cpp_source.html b/docs/html/_intelli_tool_pen_8cpp_source.html index e13c012..d809f2a 100644 --- a/docs/html/_intelli_tool_pen_8cpp_source.html +++ b/docs/html/_intelli_tool_pen_8cpp_source.html @@ -112,7 +112,7 @@ $(document).ready(function(){initNavTree('_intelli_tool_pen_8cpp_source.html',''
26  this->previousPoint = QPoint(x,y);
- +
29 }
30 
@@ -123,7 +123,7 @@ $(document).ready(function(){initNavTree('_intelli_tool_pen_8cpp_source.html',''
35 void IntelliToolPen::onMouseMoved(int x, int y){
36  if(this->isDrawing) {
37  QPoint newPoint(x,y);
-
38  this->Canvas->image->drawLine(this->previousPoint, newPoint, colorPicker->getFirstColor(), Toolsettings->getLineWidth());
+
38  this->Canvas->image->drawLine(this->previousPoint, newPoint, colorPicker->getFirstColor(), Toolsettings->getLineWidth());
39  this->previousPoint = newPoint;
40  }
@@ -131,13 +131,15 @@ $(document).ready(function(){initNavTree('_intelli_tool_pen_8cpp_source.html',''
43 
- +
47 }
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:18
+
QColor getFirstColor() const
A function to read the primary selected color.
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:36
+
IntelliColorPicker * colorPicker
A pointer to the IntelliColorPicker of the PaintingArea to interact with, and get the colors.
Definition: IntelliTool.h:57
virtual void drawLine(const QPoint &p1, const QPoint &p2, const QColor &color, const int &penWidth)
A function that draws a line between two given points in a given color.
virtual void onMouseLeftPressed(int x, int y)
A function managing the left click Pressed of a Mouse. Resetting the current draw....
Definition: IntelliTool.cpp:29
@@ -155,13 +157,11 @@ $(document).ready(function(){initNavTree('_intelli_tool_pen_8cpp_source.html',''
An abstract class that manages the basic events, like mouse clicks or scrolls events.
Definition: IntelliTool.h:17
virtual void onMouseLeftReleased(int x, int y) override
A function managing the left click released of a mouse. Merging the drawing to the active layer.
-
QColor getFirstColor()
A function to read the primary selected color.
IntelliToolPen(PaintingArea *Area, IntelliColorPicker *colorPicker, IntelliToolsettings *Toolsettings)
A constructor setting the general paintingArea and colorPicker. Reading the penWidth.
Tooltype ActiveType
Definition: IntelliTool.h:52
The IntelliColorPicker manages the selected colors for one whole project.
IntelliImage * image
image - Stores the imageData of the current LayerObject.
Definition: PaintingArea.h:27
void setLineWidth(int LineWidth)
-
virtual void onMouseMoved(int x, int y)
A function managing the mouse moved event. Call this in child classes!
Definition: IntelliTool.cpp:46
virtual void onMouseLeftPressed(int x, int y) override
A function managing the left click pressed of a mouse. Starting the drawing procedure.
diff --git a/docs/html/_intelli_tool_pen_8h_source.html b/docs/html/_intelli_tool_pen_8h_source.html index 54baa3d..bb7b2da 100644 --- a/docs/html/_intelli_tool_pen_8h_source.html +++ b/docs/html/_intelli_tool_pen_8h_source.html @@ -97,7 +97,7 @@ $(document).ready(function(){initNavTree('_intelli_tool_pen_8h_source.html','');
9 class UnitTest;
10 
14 class IntelliToolPen : public IntelliTool {
-
15  friend UnitTest;
+
15 friend UnitTest;
19 QPoint previousPoint;
20 public:
diff --git a/docs/html/_intelli_tool_plain_8cpp_source.html b/docs/html/_intelli_tool_plain_8cpp_source.html index cd751eb..6037006 100644 --- a/docs/html/_intelli_tool_plain_8cpp_source.html +++ b/docs/html/_intelli_tool_plain_8cpp_source.html @@ -101,7 +101,7 @@ $(document).ready(function(){initNavTree('_intelli_tool_plain_8cpp_source.html',
13 
- +
18 }
19 
@@ -127,6 +127,7 @@ $(document).ready(function(){initNavTree('_intelli_tool_plain_8cpp_source.html',
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:18
+
QColor getFirstColor() const
A function to read the primary selected color.
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:36
IntelliColorPicker * colorPicker
A pointer to the IntelliColorPicker of the PaintingArea to interact with, and get the colors.
Definition: IntelliTool.h:57
virtual void onMouseLeftPressed(int x, int y)
A function managing the left click Pressed of a Mouse. Resetting the current draw....
Definition: IntelliTool.cpp:29
@@ -141,7 +142,6 @@ $(document).ready(function(){initNavTree('_intelli_tool_plain_8cpp_source.html',
LayerObject * Canvas
A pointer to the drawing canvas of the tool, work on this.
Definition: IntelliTool.h:69
An abstract class that manages the basic events, like mouse clicks or scrolls events.
Definition: IntelliTool.h:17
-
QColor getFirstColor()
A function to read the primary selected color.
Tooltype ActiveType
Definition: IntelliTool.h:52
The IntelliColorPicker manages the selected colors for one whole project.
virtual void onMouseRightPressed(int x, int y) override
A function managing the right click pressed of a mouse. Resetting the current fill.
diff --git a/docs/html/_intelli_tool_plain_8h_source.html b/docs/html/_intelli_tool_plain_8h_source.html index 757984f..26e18ee 100644 --- a/docs/html/_intelli_tool_plain_8h_source.html +++ b/docs/html/_intelli_tool_plain_8h_source.html @@ -96,7 +96,7 @@ $(document).ready(function(){initNavTree('_intelli_tool_plain_8h_source.html',''
8 class UnitTest;
9 
-
14  friend UnitTest;
+
14 friend UnitTest;
15 public:
25 virtual ~IntelliToolPlainTool() override;
diff --git a/docs/html/_intelli_tool_polygon_8cpp.html b/docs/html/_intelli_tool_polygon_8cpp.html index 3190650..c0ae6ea 100644 --- a/docs/html/_intelli_tool_polygon_8cpp.html +++ b/docs/html/_intelli_tool_polygon_8cpp.html @@ -91,6 +91,7 @@ $(document).ready(function(){initNavTree('_intelli_tool_polygon_8cpp.html',''); #include <QCursor>
#include <QInputDialog>
#include <QDebug>
+#include <cmath>

Go to the source code of this file.

diff --git a/docs/html/_intelli_tool_polygon_8cpp_source.html b/docs/html/_intelli_tool_polygon_8cpp_source.html index 5b880b5..e8c7d10 100644 --- a/docs/html/_intelli_tool_polygon_8cpp_source.html +++ b/docs/html/_intelli_tool_polygon_8cpp_source.html @@ -91,155 +91,158 @@ $(document).ready(function(){initNavTree('_intelli_tool_polygon_8cpp_source.html
3 #include <QCursor>
4 #include <QInputDialog>
5 #include <QDebug>
-
6 
-
7 IntelliToolPolygon::IntelliToolPolygon(PaintingArea* Area, IntelliColorPicker* colorPicker, IntelliToolsettings* Toolsettings, bool isSettingPolygon)
-
8  : IntelliTool(Area, colorPicker, Toolsettings){
-
9  isPointNearStart = false;
-
10  drawingOfPolygon = false;
-
11  isInside = false;
-
12  this->isSettingPolygon = isSettingPolygon;
-
13  if(isSettingPolygon) {
- -
15  }
- -
17 }
-
18 
- -
20  if(drawingOfPolygon) {
- -
22  }
-
23 }
-
24 
- -
26  if(!drawingOfPolygon && Area->getTypeOfImageRealLayer() == IntelliImage::ImageType::SHAPEDIMAGE && x > 0 && y > 0 && x<Area->getWidthOfActive() && y<Area->getHeightOfActive()) {
-
27  if(Area->getPolygonDataOfRealLayer().size()>2) {
-
28  std::vector<Triangle> Triangles = IntelliTriangulation::calculateTriangles(Area->getPolygonDataOfRealLayer());
-
29  QPoint Point(x,y);
-
30  isInside = IntelliTriangulation::isInPolygon(Triangles,Point);
-
31  }
-
32  else{
-
33  isInside = true;
-
34  }
-
35  if(isSettingPolygon) {
-
36  isInside = true;
-
37  }
-
38  }
-
39  else if(!drawingOfPolygon && Area->getTypeOfImageRealLayer() == IntelliImage::ImageType::RASTERIMAGE && x >= 0 && y >= 0 && x<Area->getWidthOfActive() && y<Area->getHeightOfActive()) {
-
40  isInside = true;
-
41  }
-
42 
-
43  if(isInside && !drawingOfPolygon) {
- -
45  QPoint drawingPoint = QPoint(x,y);
-
46 
-
47  drawingOfPolygon = true;
-
48  QPointList.push_back(drawingPoint);
-
49 
-
50  this->Canvas->image->drawPoint(QPointList.back(), colorPicker->getFirstColor(), Toolsettings->getLineWidth());
-
51  if(!isSettingPolygon) {
- -
53  }
-
54  }
-
55  else if(drawingOfPolygon && QPointList.size() > 0 && isNearStart(x,y,QPointList.front())) {
-
56  if(QPointList.size() > 2) {
-
57  isPointNearStart = true;
-
58  this->Canvas->image->drawLine(QPointList.back(), QPointList.front(), colorPicker->getFirstColor(), Toolsettings->getLineWidth());
-
59  if(!isSettingPolygon) {
- -
61  }
-
62  }
-
63  else{
-
64  isInside = false;
-
65  drawingOfPolygon = false;
-
66  QPointList.clear();
- - -
69  }
-
70 
-
71  }
-
72  else if(drawingOfPolygon) {
-
73  QPoint drawingPoint(x,y);
-
74  QPointList.push_back(drawingPoint);
-
75  this->Canvas->image->drawLine(QPointList[QPointList.size() - 2], QPointList[QPointList.size() - 1], colorPicker->getFirstColor(), Toolsettings->getLineWidth());
-
76  if(!isSettingPolygon) {
- -
78  }
-
79  }
-
80 }
-
81 
- -
83  drawingOfPolygon = false;
-
84  isInside = false;
-
85  isPointNearStart = false;
-
86  QPointList.clear();
- -
88 }
-
89 
- -
91  if(isPointNearStart) {
-
92  isInside = false;
-
93  isPointNearStart = false;
-
94  drawingOfPolygon = false;
-
95  if(!isSettingPolygon) {
-
96  std::vector<Triangle> Triangles = IntelliTriangulation::calculateTriangles(QPointList);
-
97  QPoint Point;
-
98  QColor colorTwo(colorPicker->getSecondColor());
-
99  colorTwo.setAlpha(Toolsettings->getInnerAlpha());
-
100  for(int i = 0; i < activeLayer->width; i++) {
-
101  for(int j = 0; j < activeLayer->height; j++) {
-
102  Point = QPoint(i,j);
-
103  if(IntelliTriangulation::isInPolygon(Triangles,Point)) {
-
104  this->Canvas->image->drawPixel(Point, colorTwo);
-
105  }
-
106  }
-
107  }
-
108  for(int i = 0; i<static_cast<int>(QPointList.size()); i++) {
-
109  int next = static_cast<int>((i + static_cast<int>(1)) % static_cast<int>(QPointList.size()));
-
110  this->Canvas->image->drawLine(QPointList[static_cast<unsigned long long>(i)], QPointList[static_cast<unsigned long long>(next)], colorPicker->getFirstColor(), Toolsettings->getLineWidth());
-
111  }
-
112 
-
113  }
-
114  else{
-
115  Canvas->image->setPolygon(QPointList);
- -
117  }
- -
119  QPointList.clear();
-
120  }
-
121 }
-
122 
- - -
125 }
-
126 
- -
128  if(!isSettingPolygon) {
- -
130  if(!isDrawing) {
- -
132  }
-
133  }
-
134 }
-
135 
- -
137  if(!isSettingPolygon) {
- -
139  }
-
140 }
-
141 
-
142 bool IntelliToolPolygon::isNearStart(int x, int y, QPoint Startpoint){
-
143  int StartX = Startpoint.x();
-
144  int StartY = Startpoint.y();
-
145  int valueToNear = 5;
-
146 
-
147  float euklid = sqrt(pow(static_cast<float>(StartX-x),2.f)+pow(static_cast<float>(StartY-y),2.f));
-
148 
-
149  return static_cast<int>(euklid)<valueToNear;
-
150 }
+
6 #include <cmath>
+
7 
+
8 IntelliToolPolygon::IntelliToolPolygon(PaintingArea* Area, IntelliColorPicker* colorPicker, IntelliToolsettings* Toolsettings, bool isSettingPolygon)
+
9  : IntelliTool(Area, colorPicker, Toolsettings){
+
10  isPointNearStart = false;
+
11  drawingOfPolygon = false;
+
12  isInside = false;
+
13  this->isSettingPolygon = isSettingPolygon;
+
14  if(isSettingPolygon) {
+ +
16  }
+ +
18 }
+
19 
+ +
21  if(drawingOfPolygon) {
+ +
23  }
+
24 }
+
25 
+ +
27  if(!drawingOfPolygon && Area->getTypeOfImageRealLayer() == IntelliImage::ImageType::SHAPEDIMAGE && x > 0 && y > 0 && x<Area->getWidthOfActive() && y<Area->getHeightOfActive()) {
+
28  if(Area->getPolygonDataOfRealLayer().size()>2) {
+
29  std::vector<Triangle> Triangles = IntelliTriangulation::calculateTriangles(Area->getPolygonDataOfRealLayer());
+
30  QPoint Point(x,y);
+
31  isInside = IntelliTriangulation::isInPolygon(Triangles,Point);
+
32  }
+
33  else{
+
34  isInside = true;
+
35  }
+
36  if(isSettingPolygon) {
+
37  isInside = true;
+
38  }
+
39  }
+
40  else if(!drawingOfPolygon && Area->getTypeOfImageRealLayer() == IntelliImage::ImageType::RASTERIMAGE && x >= 0 && y >= 0 && x<Area->getWidthOfActive() && y<Area->getHeightOfActive()) {
+
41  isInside = true;
+
42  }
+
43 
+
44  if(isInside && !drawingOfPolygon) {
+ +
46  QPoint drawingPoint = QPoint(x,y);
+
47 
+
48  drawingOfPolygon = true;
+
49  QPointList.push_back(drawingPoint);
+
50 
+
51  this->Canvas->image->drawPoint(QPointList.back(), colorPicker->getFirstColor(), Toolsettings->getLineWidth());
+
52  if(!isSettingPolygon) {
+ +
54  }
+
55  }
+
56  else if(drawingOfPolygon && QPointList.size() > 0 && isNearStart(x,y,QPointList.front())) {
+
57  if(QPointList.size() > 2) {
+
58  isPointNearStart = true;
+
59  this->Canvas->image->drawLine(QPointList.back(), QPointList.front(), colorPicker->getFirstColor(), Toolsettings->getLineWidth());
+
60  if(!isSettingPolygon) {
+ +
62  }
+
63  }
+
64  else{
+
65  isInside = false;
+
66  drawingOfPolygon = false;
+
67  QPointList.clear();
+ + +
70  }
+
71 
+
72  }
+
73  else if(drawingOfPolygon) {
+
74  QPoint drawingPoint(x,y);
+
75  QPointList.push_back(drawingPoint);
+
76  this->Canvas->image->drawLine(QPointList[QPointList.size() - 2], QPointList[QPointList.size() - 1], colorPicker->getFirstColor(), Toolsettings->getLineWidth());
+
77  if(!isSettingPolygon) {
+ +
79  }
+
80  }
+
81 }
+
82 
+ +
84  drawingOfPolygon = false;
+
85  isInside = false;
+
86  isPointNearStart = false;
+
87  QPointList.clear();
+ +
89 }
+
90 
+ +
92  if(isPointNearStart) {
+
93  isInside = false;
+
94  isPointNearStart = false;
+
95  drawingOfPolygon = false;
+
96  if(!isSettingPolygon) {
+
97  std::vector<Triangle> Triangles = IntelliTriangulation::calculateTriangles(QPointList);
+
98  QPoint Point;
+
99  QColor colorTwo(colorPicker->getSecondColor());
+
100  colorTwo.setAlpha(Toolsettings->getInnerAlpha());
+
101  for(int i = 0; i < activeLayer->width; i++) {
+
102  for(int j = 0; j < activeLayer->height; j++) {
+
103  Point = QPoint(i,j);
+
104  if(IntelliTriangulation::isInPolygon(Triangles,Point)) {
+
105  this->Canvas->image->drawPixel(Point, colorTwo);
+
106  }
+
107  }
+
108  }
+
109  for(int i = 0; i<static_cast<int>(QPointList.size()); i++) {
+
110  int next = static_cast<int>((i + static_cast<int>(1)) % static_cast<int>(QPointList.size()));
+
111  this->Canvas->image->drawLine(QPointList[static_cast<unsigned long long>(i)], QPointList[static_cast<unsigned long long>(next)], colorPicker->getFirstColor(), Toolsettings->getLineWidth());
+
112  }
+
113 
+
114  }
+
115  else{
+
116  Canvas->image->setPolygon(QPointList);
+ +
118  }
+ +
120  QPointList.clear();
+
121  }
+
122 }
+
123 
+ + +
126 }
+
127 
+ +
129  if(!isSettingPolygon) {
+ +
131  if(!isDrawing) {
+ +
133  }
+
134  }
+
135 }
+
136 
+ +
138  if(!isSettingPolygon) {
+ +
140  }
+
141 }
+
142 
+
143 bool IntelliToolPolygon::isNearStart(int x, int y, QPoint Startpoint){
+
144  int StartX = Startpoint.x();
+
145  int StartY = Startpoint.y();
+
146  int valueToNear = 5;
+
147 
+
148  float euklid = sqrt(pow(static_cast<float>(StartX - x),2.f) + pow(static_cast<float>(StartY - y),2.f));
+
149 
+
150  return static_cast<int>(euklid)<valueToNear;
+
151 }
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:18
+
QColor getFirstColor() const
A function to read the primary selected color.
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:36
+
IntelliColorPicker * colorPicker
A pointer to the IntelliColorPicker of the PaintingArea to interact with, and get the colors.
Definition: IntelliTool.h:57
virtual void drawLine(const QPoint &p1, const QPoint &p2, const QColor &color, const int &penWidth)
A function that draws a line between two given points in a given color.
@@ -247,16 +250,16 @@ $(document).ready(function(){initNavTree('_intelli_tool_polygon_8cpp_source.html
IntelliToolsettings * Toolsettings
Definition: IntelliTool.h:59
virtual void drawPixel(const QPoint &p1, const QColor &color)
A funtcion used to draw a pixel on the Image with the given Color.
std::vector< Triangle > calculateTriangles(std::vector< QPoint > polyPoints)
A function to split a polygon in its spanning traingles by using Meisters Theorem of graph theory by ...
+
PaintingArea * Area
A pointer to the general PaintingArea to interact with.
Definition: IntelliTool.h:50
-
QColor getSecondColor()
A function to read the secondary selected color.
-
virtual void onMouseMoved(int x, int y) override
A function managing the mouse moved event.
+
virtual void onMouseMoved(int x, int y) override
A function managing the mouse moved event.
The PaintingArea class manages the methods and stores information about the current painting area,...
Definition: PaintingArea.h:53
bool isDrawing
A flag checking if the user is currently drawing or not.
Definition: IntelliTool.h:74
- +
QColor getSecondColor() const
A function to read the secondary selected color.
virtual void drawPoint(const QPoint &p1, const QColor &color, const int &penWidth)
A function that draws a point between on a given point in a given color.
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:25
LayerObject * activeLayer
A pointer to the underlying active Layer, do not work on this. This is used for data grabbing or prev...
Definition: IntelliTool.h:64
-
IntelliToolPolygon(PaintingArea *Area, IntelliColorPicker *colorPicker, IntelliToolsettings *Toolsettings, bool isSettingPolygon=false)
A constructor setting the general paintingArea and colorPicker.
+
IntelliToolPolygon(PaintingArea *Area, IntelliColorPicker *colorPicker, IntelliToolsettings *Toolsettings, bool isSettingPolygon=false)
A constructor setting the general paintingArea and colorPicker.
LayerObject * Canvas
A pointer to the drawing canvas of the tool, work on this.
Definition: IntelliTool.h:69
IntelliImage::ImageType getTypeOfImageRealLayer()
@@ -264,28 +267,26 @@ $(document).ready(function(){initNavTree('_intelli_tool_polygon_8cpp_source.html
An abstract class that manages the basic events, like mouse clicks or scrolls events.
Definition: IntelliTool.h:17
virtual void setImageData(const QImage &newData)
setImageData overwrites the old imageData the new imageData.
-
virtual void onMouseRightPressed(int x, int y) override
A function managing the right click pressed of a mouse. Resetting the current fill.
+
virtual void onMouseRightPressed(int x, int y) override
A function managing the right click pressed of a mouse. Resetting the current fill.
-
QColor getFirstColor()
A function to read the primary selected color.
int height
height - Stores the height of a layer in pixels.
Definition: PaintingArea.h:35
QImage getImageDataOfActiveLayer()
getImageDataOfActiveLayer used to get the currents active imageData (if there isn't any active layer ...
Tooltype ActiveType
Definition: IntelliTool.h:52
The IntelliColorPicker manages the selected colors for one whole project.
-
~IntelliToolPolygon() override
A Destructor.
+
~IntelliToolPolygon() override
A Destructor.
IntelliImage * image
image - Stores the imageData of the current LayerObject.
Definition: PaintingArea.h:27
std::vector< QPoint > getPolygonDataOfRealLayer()
void setLineWidth(int LineWidth)
-
virtual void onMouseMoved(int x, int y)
A function managing the mouse moved event. Call this in child classes!
Definition: IntelliTool.cpp:46
-
virtual void onMouseLeftPressed(int x, int y) override
A function managing the left click pressed of a mouse. Setting polygon points.
-
virtual void onMouseRightReleased(int x, int y) override
A function managing the right click released of a mouse.
-
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.
+
virtual void onMouseLeftPressed(int x, int y) override
A function managing the left click pressed of a mouse. Setting polygon points.
+
virtual void onMouseRightReleased(int x, int y) override
A function managing the right click released of a mouse.
+
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.
virtual void calculateVisiblity()=0
An abstract function that calculates the visiblity of the Image data if needed.
bool isInPolygon(const std::vector< Triangle > &triangles, QPoint &point)
A function to check if a point lies in a polygon by checking its spanning triangles.
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:51
-
virtual void onWheelScrolled(int value) override
A function managing the scroll event. CHanging the lineWidth relative to value.
+
virtual void onWheelScrolled(int value) override
A function managing the scroll event. CHanging the lineWidth relative to value.
virtual void setPolygon(const std::vector< QPoint > &polygonData)=0
An abstract function that sets the data of the visible Polygon, if needed.
virtual void onWheelScrolled(int value) override
A function managing the scroll event.Changing edgeWidth relativ to value.
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:18
+
QColor getFirstColor() const
A function to read the primary selected color.
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:36
+
virtual void onMouseRightReleased(int x, int y) override
A function managing the right click released of a mouse.
IntelliColorPicker * colorPicker
A pointer to the IntelliColorPicker of the PaintingArea to interact with, and get the colors.
Definition: IntelliTool.h:57
virtual void drawLine(const QPoint &p1, const QPoint &p2, const QColor &color, const int &penWidth)
A function that draws a line between two given points in a given color.
virtual void onMouseLeftPressed(int x, int y)
A function managing the left click Pressed of a Mouse. Resetting the current draw....
Definition: IntelliTool.cpp:29
IntelliToolsettings * Toolsettings
Definition: IntelliTool.h:59
virtual ~IntelliToolRectangle() override
A Destructor.
+
virtual void onMouseLeftPressed(int x, int y) override
A function managing the left click pressed of a mouse. Setting the originCorner and draws a rectangle...
-
QColor getSecondColor()
A function to read the secondary selected color.
virtual void onMouseRightPressed(int x, int y) override
A function managing the right click pressed of a mouse.Resetting the current draw.
The PaintingArea class manages the methods and stores information about the current painting area,...
Definition: PaintingArea.h:53
bool isDrawing
A flag checking if the user is currently drawing or not.
Definition: IntelliTool.h:74
- +
QColor getSecondColor() const
A function to read the secondary selected color.
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:25
LayerObject * Canvas
A pointer to the drawing canvas of the tool, work on this.
Definition: IntelliTool.h:69
An abstract class that manages the basic events, like mouse clicks or scrolls events.
Definition: IntelliTool.h:17
-
QColor getFirstColor()
A function to read the primary selected color.
Tooltype ActiveType
Definition: IntelliTool.h:52
virtual void onMouseMoved(int x, int y) override
A function managing the mouse moved event.Drawing a rectangle to currrent mouse position.
The IntelliColorPicker manages the selected colors for one whole project.
IntelliImage * image
image - Stores the imageData of the current LayerObject.
Definition: PaintingArea.h:27
void setLineWidth(int LineWidth)
-
virtual void onMouseMoved(int x, int y)
A function managing the mouse moved event. Call this in child classes!
Definition: IntelliTool.cpp:46
virtual void calculateVisiblity()=0
An abstract function that calculates the visiblity of the Image data if needed.
virtual void onMouseLeftReleased(int x, int y) override
A function managing the left click released of a mouse. Merging the draw to the active layer.
diff --git a/docs/html/_intelli_tool_rectangle_8h_source.html b/docs/html/_intelli_tool_rectangle_8h_source.html index 74655e4..678fb8e 100644 --- a/docs/html/_intelli_tool_rectangle_8h_source.html +++ b/docs/html/_intelli_tool_rectangle_8h_source.html @@ -98,7 +98,7 @@ $(document).ready(function(){initNavTree('_intelli_tool_rectangle_8h_source.html
10 class UnitTest;
11 
-
16  friend UnitTest;
+
16 friend UnitTest;
21 void drawRectangle(QPoint otherCorner);
22 
26 QPoint originCorner;
diff --git a/docs/html/_intelli_toolsettings_8cpp_source.html b/docs/html/_intelli_toolsettings_8cpp_source.html index 19a91f4..34839c5 100644 --- a/docs/html/_intelli_toolsettings_8cpp_source.html +++ b/docs/html/_intelli_toolsettings_8cpp_source.html @@ -99,7 +99,7 @@ $(document).ready(function(){initNavTree('_intelli_toolsettings_8cpp_source.html
11 
12 }
13 
- +
15  return lineWidth;
16 }
17 
@@ -113,7 +113,7 @@ $(document).ready(function(){initNavTree('_intelli_toolsettings_8cpp_source.html
25  lineWidth = LineWidth;
26 }
27 
- +
29  return this->innerAlpha;
30 }
31 
@@ -128,12 +128,12 @@ $(document).ready(function(){initNavTree('_intelli_toolsettings_8cpp_source.html
40 }
+ + -
void setInnerAlpha(int innerAlpha)
void setLineWidth(int LineWidth)
- + + -
void setInnerAlpha(int innerAlpha)
void setLineWidth(int LineWidth)
- diff --git a/docs/html/_painting_area_8cpp_source.html b/docs/html/_painting_area_8cpp_source.html index 5077941..ffdc0b8 100644 --- a/docs/html/_painting_area_8cpp_source.html +++ b/docs/html/_painting_area_8cpp_source.html @@ -123,12 +123,12 @@ $(document).ready(function(){initNavTree('_painting_area_8cpp_source.html','');
35  bool ToolIsActive;
36 
37  if(Tool!=nullptr) {
-
38  ToolIsActive = Tool->getIsDrawing();
+
38  ToolIsActive = Tool->getIsDrawing();
39  }
40  else{
41  ToolIsActive = false;
42  }
-
43  if(isFastRenderingOn != renderSettings.isFastRenderering() && !ToolIsActive) {
+
43  if(isFastRenderingOn != renderSettings.isFastRenderering() && !ToolIsActive) {
44  renderSettings.setFastRendering(isFastRenderingOn);
45  for(auto& layer : layerBundle) {
46  layer.image->updateRendererSetting(isFastRenderingOn);
@@ -155,9 +155,9 @@ $(document).ready(function(){initNavTree('_painting_area_8cpp_source.html','');
67  newLayer.widthOffset = widthOffset;
68  newLayer.heightOffset = heightOffset;
-
70  newLayer.image = new IntelliRasterImage(width,height,renderSettings.isFastRenderering());
+
70  newLayer.image = new IntelliRasterImage(width,height,renderSettings.isFastRenderering());
71  }else if(type==IntelliImage::ImageType::SHAPEDIMAGE) {
-
72  newLayer.image = new IntelliShapedImage(width, height, renderSettings.isFastRenderering());
+
72  newLayer.image = new IntelliShapedImage(width, height, renderSettings.isFastRenderering());
73  }
74  newLayer.alpha = 255;
75  this->layerBundle.push_back(newLayer);
@@ -273,12 +273,12 @@ $(document).ready(function(){initNavTree('_painting_area_8cpp_source.html','');
185 }
186 
-
188  QColor clr = QColorDialog::getColor(colorPicker.getFirstColor(), nullptr, "Main Color", QColorDialog::DontUseNativeDialog);
+
188  QColor clr = QColorDialog::getColor(colorPicker.getFirstColor(), nullptr, "Main Color", QColorDialog::DontUseNativeDialog);
189  this->colorPicker.setFirstColor(clr);
190 }
191 
-
193  QColor clr = QColorDialog::getColor(colorPicker.getSecondColor(), nullptr, "Secondary Color", QColorDialog::DontUseNativeDialog);
+
193  QColor clr = QColorDialog::getColor(colorPicker.getSecondColor(), nullptr, "Secondary Color", QColorDialog::DontUseNativeDialog);
194  this->colorPicker.setSecondColor(clr);
195 }
196 
@@ -485,7 +485,7 @@ $(document).ready(function(){initNavTree('_painting_area_8cpp_source.html','');
397 }
398 
399 IntelliTool* PaintingArea::copyActiveTool(){
-
400  switch(Tool->getTooltype()) {
+
400  switch(Tool->getTooltype()) {
@@ -516,7 +516,7 @@ $(document).ready(function(){initNavTree('_painting_area_8cpp_source.html','');
428  }
429  else{
430  returnImage = layerBundle[static_cast<size_t>(activeLayer)].image->getImageData();
-
431  if(renderSettings.isFastRenderering()) {
+
431  if(renderSettings.isFastRenderering()) {
432  returnImage = returnImage.convertToFormat(QImage::Format_ARGB32);
433  }
434  }
@@ -525,7 +525,7 @@ $(document).ready(function(){initNavTree('_painting_area_8cpp_source.html','');
437 
438 void PaintingArea::updateTools(){
439  if(Tool!=nullptr) {
-
440  if(Tool->getIsDrawing()) {
+
440  if(Tool->getIsDrawing()) {
441  IntelliTool* temp = copyActiveTool();
442  delete this->Tool;
443  this->Tool = temp;
@@ -543,6 +543,7 @@ $(document).ready(function(){initNavTree('_painting_area_8cpp_source.html','');
void createCircleTool()
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:18
+
QColor getFirstColor() const
A function to read the primary selected color.
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:36
void setRenderSettings(bool isFastRenderingOn)
setRenderSettings updates all Images to the new Rendersetting.
IntelliImage * getImageOfActiveLayer()
@@ -550,9 +551,12 @@ $(document).ready(function(){initNavTree('_painting_area_8cpp_source.html','');
void createRectangleTool()
virtual void onMouseLeftPressed(int x, int y)
A function managing the left click Pressed of a Mouse. Resetting the current draw....
Definition: IntelliTool.cpp:29
+
bool getIsDrawing() const
+
bool isFastRenderering() const
The getfastRenderer gets the value of the flag for the fastRenderer setting.
bool save(const QString &filePath, const char *fileFormat)
The save method is used for exporting the current project as one picture.
+
Tooltype getTooltype() const
Definition: IntelliTool.cpp:99
void setLayerAlpha(int idx, int alpha)
The setAlphaOfLayer method sets the alpha value of a specific layer.
void setLayerActive(int idx)
The setLayerToActive method marks a specific layer as active.
@@ -560,9 +564,8 @@ $(document).ready(function(){initNavTree('_painting_area_8cpp_source.html','');
void deleteLayer(int idx, bool isTool=false)
The deleteLayer method removes a layer at a given idx.
The IntelliToolPlainTool class represents a tool to fill the whole canvas with one color.
-
void setSecondColor(QColor Color)
A function to set the secondary color.
+
void setSecondColor(QColor Color)
A function to set the secondary color.
The IntelliShapedImage manages a Shapedimage.
-
QColor getSecondColor()
A function to read the secondary selected color.
int heightOffset
heightOffset - Stores the number of pixles from the top of the painting area.
Definition: PaintingArea.h:43
int getHeightOfActive()
The getHeightOfActive gets the vertical dimensions of the active layer.
@@ -575,6 +578,7 @@ $(document).ready(function(){initNavTree('_painting_area_8cpp_source.html','');
void mousePressEvent(QMouseEvent *event) override
int alpha
alpha - Stores the alpha value of the layer (default=255).
Definition: PaintingArea.h:47
+
QColor getSecondColor() const
A function to read the secondary selected color.
The IntelliToolRectangle class represents a tool to draw a rectangle.
void createLineTool()
@@ -584,34 +588,30 @@ $(document).ready(function(){initNavTree('_painting_area_8cpp_source.html','');
void colorPickerSetFirstColor()
The colorPickerSetFirstColor calls the QTColorPicker to determine the primary drawing color.
-
Tooltype getTooltype()
Definition: IntelliTool.cpp:99
IntelliImage::ImageType getTypeOfImageRealLayer()
int width
width - Stores the width of a layer in pixels.
Definition: PaintingArea.h:31
-
bool isFastRenderering()
The getfastRenderer gets the value of the flag for the fastRenderer setting.
~PaintingArea() override
This deconstructor is used to clear up the memory and remove the currently active window.
void mouseMoveEvent(QMouseEvent *event) override
int getNumberOfActiveLayer()
-
void setFirstColor(QColor Color)
A function to set the primary color.
+
void setFirstColor(QColor Color)
A function to set the primary color.
An abstract class that manages the basic events, like mouse clicks or scrolls events.
Definition: IntelliTool.h:17
void slotDeleteActiveLayer()
The slotDeleteActiveLayer method handles the deletion of the active layer.
-
void setToolWidth(int value)
+
void setToolWidth(int value)
bool open(const QString &filePath)
The open method is used for loading a picture into the current layer.
void createPolygonTool()
void moveActiveLayer(int idx)
The moveActiveLayer moves the active layer to a specific position in the layer stack.
IntelliColorPicker colorPicker
Definition: PaintingArea.h:202
PaintingArea(int maxWidth=600, int maxHeight=600, QWidget *parent=nullptr)
PaintingArea is the constructor of the PaintingArea class, which initiates the working environment.
-
bool getIsDrawing()
-
QColor getFirstColor()
A function to read the primary selected color.
int height
height - Stores the height of a layer in pixels.
Definition: PaintingArea.h:35
QImage getImageDataOfActiveLayer()
getImageDataOfActiveLayer used to get the currents active imageData (if there isn't any active layer ...
void createFloodFillTool()
void slotActivateLayer(int a)
The slotActivateLayer method handles the event of selecting one layer as active.
void paintEvent(QPaintEvent *event) override
void setFastRendering(bool Updatedsetting)
setFastRendering sets fastRendering to Updatedsetting.
- +
IntelliImage * image
image - Stores the imageData of the current LayerObject.
Definition: PaintingArea.h:27
@@ -620,7 +620,7 @@ $(document).ready(function(){initNavTree('_painting_area_8cpp_source.html','');
IntelliToolsettings Toolsettings
Definition: PaintingArea.h:201
void setPolygon(int idx)
setPolygon is used for setting polygondata, it only works on RASTER images
-
void swapColors()
A function switching primary and secondary color.
+
void swapColors()
A function switching primary and secondary color.
The IntelliToolFloodFill class represents a tool to flood FIll a certian area.
void colorPickerSwapColors()
The colorPickerSwitchColor swaps the primary color with the secondary drawing color.
diff --git a/docs/html/class_intelli_color_picker-members.html b/docs/html/class_intelli_color_picker-members.html index b709abb..29ec214 100644 --- a/docs/html/class_intelli_color_picker-members.html +++ b/docs/html/class_intelli_color_picker-members.html @@ -89,8 +89,8 @@ $(document).ready(function(){initNavTree('class_intelli_color_picker.html','');

This is the complete list of members for IntelliColorPicker, including all inherited members.

- - + + diff --git a/docs/html/class_intelli_color_picker.html b/docs/html/class_intelli_color_picker.html index 9eac72c..0bf22c0 100644 --- a/docs/html/class_intelli_color_picker.html +++ b/docs/html/class_intelli_color_picker.html @@ -106,12 +106,12 @@ Public Member Functions - - - - - - + + + + + + @@ -170,13 +170,13 @@ Public Member Functions

IntelliColorPicker destructor clears up his used memory, if there is some.

-

Definition at line 8 of file IntelliColorPicker.cpp.

+

Definition at line 7 of file IntelliColorPicker.cpp.

Member Function Documentation

- -

◆ getFirstColor()

+ +

◆ getFirstColor()

@@ -185,7 +185,7 @@ Public Member Functions
- +
getFirstColor()IntelliColorPicker
getSecondColor()IntelliColorPicker
getFirstColor() constIntelliColorPicker
getSecondColor() constIntelliColorPicker
IntelliColorPicker()IntelliColorPicker
setFirstColor(QColor Color)IntelliColorPicker
setSecondColor(QColor Color)IntelliColorPicker
void swapColors ()
 A function switching primary and secondary color. More...
 
QColor getFirstColor ()
 A function to read the primary selected color. More...
 
QColor getSecondColor ()
 A function to read the secondary selected color. More...
 
QColor getFirstColor () const
 A function to read the primary selected color. More...
 
QColor getSecondColor () const
 A function to read the secondary selected color. More...
 
void setFirstColor (QColor Color)
 A function to set the primary color. More...
 
QColor IntelliColorPicker::getFirstColor ( ) const
@@ -193,12 +193,12 @@ Public Member Functions

A function to read the primary selected color.

Returns
Returns the primary color.
-

Definition at line 16 of file IntelliColorPicker.cpp.

+

Definition at line 15 of file IntelliColorPicker.cpp.

- -

◆ getSecondColor()

+ +

◆ getSecondColor()

@@ -207,7 +207,7 @@ Public Member Functions QColor IntelliColorPicker::getSecondColor ( ) - + const
@@ -215,7 +215,7 @@ Public Member Functions

A function to read the secondary selected color.

Returns
Returns the secondary color.
-

Definition at line 20 of file IntelliColorPicker.cpp.

+

Definition at line 19 of file IntelliColorPicker.cpp.

@@ -243,7 +243,7 @@ Public Member Functions -

Definition at line 24 of file IntelliColorPicker.cpp.

+

Definition at line 23 of file IntelliColorPicker.cpp.

@@ -271,7 +271,7 @@ Public Member Functions -

Definition at line 28 of file IntelliColorPicker.cpp.

+

Definition at line 27 of file IntelliColorPicker.cpp.

@@ -292,7 +292,7 @@ Public Member Functions

A function switching primary and secondary color.

-

Definition at line 12 of file IntelliColorPicker.cpp.

+

Definition at line 11 of file IntelliColorPicker.cpp.

diff --git a/docs/html/class_intelli_color_picker.js b/docs/html/class_intelli_color_picker.js index 4d29d13..f02759d 100644 --- a/docs/html/class_intelli_color_picker.js +++ b/docs/html/class_intelli_color_picker.js @@ -2,8 +2,8 @@ var class_intelli_color_picker = [ [ "IntelliColorPicker", "class_intelli_color_picker.html#a0d1247bdd87add1396ea5d9acaad79ae", null ], [ "~IntelliColorPicker", "class_intelli_color_picker.html#a40b975268a1f05249e8a49dde9a862ff", null ], - [ "getFirstColor", "class_intelli_color_picker.html#aae2eb27b928fe9388b9398b0556303b7", null ], - [ "getSecondColor", "class_intelli_color_picker.html#a55568fbf5dc783f06284b7031ffe9415", null ], + [ "getFirstColor", "class_intelli_color_picker.html#aeb08029a0c946ed0402c9c11a91965b1", null ], + [ "getSecondColor", "class_intelli_color_picker.html#ab41abe8fb7e184db2c33e792f09792e0", null ], [ "setFirstColor", "class_intelli_color_picker.html#a7e2ddbbbfbed383f06b24e5bf6b27ae8", null ], [ "setSecondColor", "class_intelli_color_picker.html#a86bf4a940e4a0e465e30cbdf28748931", null ], [ "swapColors", "class_intelli_color_picker.html#aec499265ae28ce1b54be88222e74292e", null ] diff --git a/docs/html/class_intelli_photo_gui.html b/docs/html/class_intelli_photo_gui.html index 3a16fe9..5399f88 100644 --- a/docs/html/class_intelli_photo_gui.html +++ b/docs/html/class_intelli_photo_gui.html @@ -191,7 +191,7 @@ Protected Member Functions
-

Definition at line 790 of file IntelliPhotoGui.cpp.

+

Definition at line 827 of file IntelliPhotoGui.cpp.

@@ -210,7 +210,7 @@ Protected Member Functions
-

Definition at line 799 of file IntelliPhotoGui.cpp.

+

Definition at line 836 of file IntelliPhotoGui.cpp.

diff --git a/docs/html/class_intelli_render_settings-members.html b/docs/html/class_intelli_render_settings-members.html index a94ad39..a221e5d 100644 --- a/docs/html/class_intelli_render_settings-members.html +++ b/docs/html/class_intelli_render_settings-members.html @@ -90,7 +90,7 @@ $(document).ready(function(){initNavTree('class_intelli_render_settings.html',''

This is the complete list of members for IntelliRenderSettings, including all inherited members.

- +
IntelliRenderSettings()IntelliRenderSettings
isFastRenderering()IntelliRenderSettings
isFastRenderering() constIntelliRenderSettings
setFastRendering(bool Updatedsetting)IntelliRenderSettings
diff --git a/docs/html/class_intelli_render_settings.html b/docs/html/class_intelli_render_settings.html index d0d1d39..bacb3d1 100644 --- a/docs/html/class_intelli_render_settings.html +++ b/docs/html/class_intelli_render_settings.html @@ -99,9 +99,9 @@ Public Member Functions void setFastRendering (bool Updatedsetting)  setFastRendering sets fastRendering to Updatedsetting. More...
  -bool isFastRenderering () - The getfastRenderer gets the value of the flag for the fastRenderer setting. More...
-  +bool isFastRenderering () const + The getfastRenderer gets the value of the flag for the fastRenderer setting. More...

Detailed Description

@@ -127,8 +127,8 @@ Public Member Functions

Member Function Documentation

- -

◆ isFastRenderering()

+ +

◆ isFastRenderering()

@@ -137,7 +137,7 @@ Public Member Functions bool IntelliRenderSettings::isFastRenderering ( ) - + const
diff --git a/docs/html/class_intelli_render_settings.js b/docs/html/class_intelli_render_settings.js index e0dfe86..73ef9f6 100644 --- a/docs/html/class_intelli_render_settings.js +++ b/docs/html/class_intelli_render_settings.js @@ -1,6 +1,6 @@ var class_intelli_render_settings = [ [ "IntelliRenderSettings", "class_intelli_render_settings.html#a4a01de6e5e8e516a7eae51d6f1f66529", null ], - [ "isFastRenderering", "class_intelli_render_settings.html#a5d0eb9a5a3bf788dd87509386dea8dcd", null ], + [ "isFastRenderering", "class_intelli_render_settings.html#a38fd592c4948d2e47b95bb6fabc34073", null ], [ "setFastRendering", "class_intelli_render_settings.html#a5ffb878b77e5d448ffe4eb03a8397ac2", null ] ]; \ No newline at end of file diff --git a/docs/html/class_intelli_tool-members.html b/docs/html/class_intelli_tool-members.html index 2d03123..4742eb5 100644 --- a/docs/html/class_intelli_tool-members.html +++ b/docs/html/class_intelli_tool-members.html @@ -94,8 +94,8 @@ $(document).ready(function(){initNavTree('class_intelli_tool.html',''); initResi AreaIntelliToolprotected CanvasIntelliToolprotected colorPickerIntelliToolprotected - getIsDrawing()IntelliTool - getTooltype()IntelliTool + getIsDrawing() constIntelliTool + getTooltype() constIntelliTool IntelliTool(PaintingArea *Area, IntelliColorPicker *colorPicker, IntelliToolsettings *Toolsettings)IntelliTool isDrawingIntelliToolprotected onMouseLeftPressed(int x, int y)IntelliToolvirtual diff --git a/docs/html/class_intelli_tool.html b/docs/html/class_intelli_tool.html index 3620d05..38a9d6b 100644 --- a/docs/html/class_intelli_tool.html +++ b/docs/html/class_intelli_tool.html @@ -154,10 +154,10 @@ Public Member Functions virtual void onMouseMoved (int x, int y)  A function managing the mouse moved event. Call this in child classes! More...
  -Tooltype getTooltype () -  -bool getIsDrawing () -  +Tooltype getTooltype () const +  +bool getIsDrawing () const +  @@ -296,8 +296,8 @@ Protected Attributes

Member Function Documentation

- -

◆ getIsDrawing()

+ +

◆ getIsDrawing()

@@ -306,7 +306,7 @@ Protected Attributes
- +

Protected Attributes

bool IntelliTool::getIsDrawing ( ) const
@@ -315,8 +315,8 @@ Protected Attributes
- -

◆ getTooltype()

+ +

◆ getTooltype()

@@ -325,7 +325,7 @@ Protected Attributes IntelliTool::Tooltype IntelliTool::getTooltype ( ) - + const
diff --git a/docs/html/class_intelli_tool.js b/docs/html/class_intelli_tool.js index 34404b0..662a2c5 100644 --- a/docs/html/class_intelli_tool.js +++ b/docs/html/class_intelli_tool.js @@ -12,8 +12,8 @@ var class_intelli_tool = ] ], [ "IntelliTool", "class_intelli_tool.html#a08ef094271ce6248b42f888472463526", null ], [ "~IntelliTool", "class_intelli_tool.html#a57fb1b27d364c9e3696eb928b75fa9f2", null ], - [ "getIsDrawing", "class_intelli_tool.html#a0020fad2e26315d5c4d96dbc95d1dceb", null ], - [ "getTooltype", "class_intelli_tool.html#aae2a11c5bae4973ed827c60e0c1352b1", null ], + [ "getIsDrawing", "class_intelli_tool.html#af90f0965efbc5c25126691e998f39ca3", null ], + [ "getTooltype", "class_intelli_tool.html#adf5c06ad2b2c0d745fb68cf80e7e5694", null ], [ "onMouseLeftPressed", "class_intelli_tool.html#a34b7ef1dde96b94a0ce450a25ae1778c", null ], [ "onMouseLeftReleased", "class_intelli_tool.html#a906a2575c16c8a33cb2a5197f8d8cc5b", null ], [ "onMouseMoved", "class_intelli_tool.html#ac10e20414cd8855a2f9b103fb6408639", null ], diff --git a/docs/html/class_intelli_tool_circle-members.html b/docs/html/class_intelli_tool_circle-members.html index aa31c7f..b1af741 100644 --- a/docs/html/class_intelli_tool_circle-members.html +++ b/docs/html/class_intelli_tool_circle-members.html @@ -94,8 +94,8 @@ $(document).ready(function(){initNavTree('class_intelli_tool_circle.html',''); i AreaIntelliToolprotected CanvasIntelliToolprotected colorPickerIntelliToolprotected - getIsDrawing()IntelliTool - getTooltype()IntelliTool + getIsDrawing() constIntelliTool + getTooltype() constIntelliTool IntelliTool(PaintingArea *Area, IntelliColorPicker *colorPicker, IntelliToolsettings *Toolsettings)IntelliTool IntelliToolCircle(PaintingArea *Area, IntelliColorPicker *colorPicker, IntelliToolsettings *Toolsettings)IntelliToolCircle isDrawingIntelliToolprotected diff --git a/docs/html/class_intelli_tool_circle.html b/docs/html/class_intelli_tool_circle.html index 85c59e4..d6b9fb3 100644 --- a/docs/html/class_intelli_tool_circle.html +++ b/docs/html/class_intelli_tool_circle.html @@ -137,10 +137,10 @@ Public Member Functions virtual ~IntelliTool ()=0  An abstract Destructor. More...
  -Tooltype getTooltype () -  -bool getIsDrawing () -  +Tooltype getTooltype () const +  +bool getIsDrawing () const +  diff --git a/docs/html/class_intelli_tool_flood_fill-members.html b/docs/html/class_intelli_tool_flood_fill-members.html index 4c892dd..562e478 100644 --- a/docs/html/class_intelli_tool_flood_fill-members.html +++ b/docs/html/class_intelli_tool_flood_fill-members.html @@ -94,8 +94,8 @@ $(document).ready(function(){initNavTree('class_intelli_tool_flood_fill.html','' - - + + diff --git a/docs/html/class_intelli_tool_flood_fill.html b/docs/html/class_intelli_tool_flood_fill.html index 813458f..0214463 100644 --- a/docs/html/class_intelli_tool_flood_fill.html +++ b/docs/html/class_intelli_tool_flood_fill.html @@ -137,10 +137,10 @@ Public Member Functions - - - - + + + +

Additional Inherited Members

AreaIntelliToolprotected
CanvasIntelliToolprotected
colorPickerIntelliToolprotected
getIsDrawing()IntelliTool
getTooltype()IntelliTool
getIsDrawing() constIntelliTool
getTooltype() constIntelliTool
IntelliTool(PaintingArea *Area, IntelliColorPicker *colorPicker, IntelliToolsettings *Toolsettings)IntelliTool
IntelliToolFloodFill(PaintingArea *Area, IntelliColorPicker *colorPicker, IntelliToolsettings *Toolsettings)IntelliToolFloodFill
isDrawingIntelliToolprotected
virtual ~IntelliTool ()=0
 An abstract Destructor. More...
 
Tooltype getTooltype ()
 
bool getIsDrawing ()
 
Tooltype getTooltype () const
 
bool getIsDrawing () const
 
diff --git a/docs/html/class_intelli_tool_line-members.html b/docs/html/class_intelli_tool_line-members.html index b9461de..cc32456 100644 --- a/docs/html/class_intelli_tool_line-members.html +++ b/docs/html/class_intelli_tool_line-members.html @@ -94,8 +94,8 @@ $(document).ready(function(){initNavTree('class_intelli_tool_line.html',''); ini - - + + diff --git a/docs/html/class_intelli_tool_line.html b/docs/html/class_intelli_tool_line.html index c782844..aa71636 100644 --- a/docs/html/class_intelli_tool_line.html +++ b/docs/html/class_intelli_tool_line.html @@ -137,10 +137,10 @@ Public Member Functions - - - - + + + +

Additional Inherited Members

AreaIntelliToolprotected
CanvasIntelliToolprotected
colorPickerIntelliToolprotected
getIsDrawing()IntelliTool
getTooltype()IntelliTool
getIsDrawing() constIntelliTool
getTooltype() constIntelliTool
IntelliTool(PaintingArea *Area, IntelliColorPicker *colorPicker, IntelliToolsettings *Toolsettings)IntelliTool
IntelliToolLine(PaintingArea *Area, IntelliColorPicker *colorPicker, IntelliToolsettings *Toolsettings)IntelliToolLine
isDrawingIntelliToolprotected
virtual ~IntelliTool ()=0
 An abstract Destructor. More...
 
Tooltype getTooltype ()
 
bool getIsDrawing ()
 
Tooltype getTooltype () const
 
bool getIsDrawing () const
 
diff --git a/docs/html/class_intelli_tool_pen-members.html b/docs/html/class_intelli_tool_pen-members.html index b76db58..b52180b 100644 --- a/docs/html/class_intelli_tool_pen-members.html +++ b/docs/html/class_intelli_tool_pen-members.html @@ -94,8 +94,8 @@ $(document).ready(function(){initNavTree('class_intelli_tool_pen.html',''); init - - + + diff --git a/docs/html/class_intelli_tool_pen.html b/docs/html/class_intelli_tool_pen.html index 5340bba..fdece61 100644 --- a/docs/html/class_intelli_tool_pen.html +++ b/docs/html/class_intelli_tool_pen.html @@ -137,10 +137,10 @@ Public Member Functions - - - - + + + +

Additional Inherited Members

AreaIntelliToolprotected
CanvasIntelliToolprotected
colorPickerIntelliToolprotected
getIsDrawing()IntelliTool
getTooltype()IntelliTool
getIsDrawing() constIntelliTool
getTooltype() constIntelliTool
IntelliTool(PaintingArea *Area, IntelliColorPicker *colorPicker, IntelliToolsettings *Toolsettings)IntelliTool
IntelliToolPen(PaintingArea *Area, IntelliColorPicker *colorPicker, IntelliToolsettings *Toolsettings)IntelliToolPen
isDrawingIntelliToolprotected
virtual ~IntelliTool ()=0
 An abstract Destructor. More...
 
Tooltype getTooltype ()
 
bool getIsDrawing ()
 
Tooltype getTooltype () const
 
bool getIsDrawing () const
 
diff --git a/docs/html/class_intelli_tool_plain_tool-members.html b/docs/html/class_intelli_tool_plain_tool-members.html index 894e44f..19fdcfa 100644 --- a/docs/html/class_intelli_tool_plain_tool-members.html +++ b/docs/html/class_intelli_tool_plain_tool-members.html @@ -94,8 +94,8 @@ $(document).ready(function(){initNavTree('class_intelli_tool_plain_tool.html','' - - + + diff --git a/docs/html/class_intelli_tool_plain_tool.html b/docs/html/class_intelli_tool_plain_tool.html index 264868f..6def11d 100644 --- a/docs/html/class_intelli_tool_plain_tool.html +++ b/docs/html/class_intelli_tool_plain_tool.html @@ -137,10 +137,10 @@ Public Member Functions - - - - + + + +

Additional Inherited Members

AreaIntelliToolprotected
CanvasIntelliToolprotected
colorPickerIntelliToolprotected
getIsDrawing()IntelliTool
getTooltype()IntelliTool
getIsDrawing() constIntelliTool
getTooltype() constIntelliTool
IntelliTool(PaintingArea *Area, IntelliColorPicker *colorPicker, IntelliToolsettings *Toolsettings)IntelliTool
IntelliToolPlainTool(PaintingArea *Area, IntelliColorPicker *colorPicker, IntelliToolsettings *Toolsettings)IntelliToolPlainTool
isDrawingIntelliToolprotected
virtual ~IntelliTool ()=0
 An abstract Destructor. More...
 
Tooltype getTooltype ()
 
bool getIsDrawing ()
 
Tooltype getTooltype () const
 
bool getIsDrawing () const
 
diff --git a/docs/html/class_intelli_tool_polygon-members.html b/docs/html/class_intelli_tool_polygon-members.html index 9741c30..d071acf 100644 --- a/docs/html/class_intelli_tool_polygon-members.html +++ b/docs/html/class_intelli_tool_polygon-members.html @@ -94,8 +94,8 @@ $(document).ready(function(){initNavTree('class_intelli_tool_polygon.html',''); - - + + diff --git a/docs/html/class_intelli_tool_polygon.html b/docs/html/class_intelli_tool_polygon.html index db07444..97d1b8f 100644 --- a/docs/html/class_intelli_tool_polygon.html +++ b/docs/html/class_intelli_tool_polygon.html @@ -137,10 +137,10 @@ Public Member Functions - - - - + + + +

Additional Inherited Members

AreaIntelliToolprotected
CanvasIntelliToolprotected
colorPickerIntelliToolprotected
getIsDrawing()IntelliTool
getTooltype()IntelliTool
getIsDrawing() constIntelliTool
getTooltype() constIntelliTool
IntelliTool(PaintingArea *Area, IntelliColorPicker *colorPicker, IntelliToolsettings *Toolsettings)IntelliTool
IntelliToolPolygon(PaintingArea *Area, IntelliColorPicker *colorPicker, IntelliToolsettings *Toolsettings, bool isSettingPolygon=false)IntelliToolPolygon
isDrawingIntelliToolprotected
virtual ~IntelliTool ()=0
 An abstract Destructor. More...
 
Tooltype getTooltype ()
 
bool getIsDrawing ()
 
Tooltype getTooltype () const
 
bool getIsDrawing () const
 
@@ -232,7 +232,7 @@ Additional Inherited Members -

Definition at line 7 of file IntelliToolPolygon.cpp.

+

Definition at line 8 of file IntelliToolPolygon.cpp.

@@ -261,7 +261,7 @@ Additional Inherited Members

A Destructor.

-

Definition at line 19 of file IntelliToolPolygon.cpp.

+

Definition at line 20 of file IntelliToolPolygon.cpp.

@@ -311,7 +311,7 @@ Additional Inherited Members

Reimplemented from IntelliTool.

-

Definition at line 25 of file IntelliToolPolygon.cpp.

+

Definition at line 26 of file IntelliToolPolygon.cpp.

@@ -360,7 +360,7 @@ Additional Inherited Members

Reimplemented from IntelliTool.

-

Definition at line 90 of file IntelliToolPolygon.cpp.

+

Definition at line 91 of file IntelliToolPolygon.cpp.

@@ -409,7 +409,7 @@ Additional Inherited Members

Reimplemented from IntelliTool.

-

Definition at line 136 of file IntelliToolPolygon.cpp.

+

Definition at line 137 of file IntelliToolPolygon.cpp.

@@ -458,7 +458,7 @@ Additional Inherited Members

Reimplemented from IntelliTool.

-

Definition at line 82 of file IntelliToolPolygon.cpp.

+

Definition at line 83 of file IntelliToolPolygon.cpp.

@@ -507,7 +507,7 @@ Additional Inherited Members

Reimplemented from IntelliTool.

-

Definition at line 123 of file IntelliToolPolygon.cpp.

+

Definition at line 124 of file IntelliToolPolygon.cpp.

@@ -545,7 +545,7 @@ Additional Inherited Members

Reimplemented from IntelliTool.

-

Definition at line 127 of file IntelliToolPolygon.cpp.

+

Definition at line 128 of file IntelliToolPolygon.cpp.

diff --git a/docs/html/class_intelli_tool_rectangle-members.html b/docs/html/class_intelli_tool_rectangle-members.html index 6e55605..b9ef104 100644 --- a/docs/html/class_intelli_tool_rectangle-members.html +++ b/docs/html/class_intelli_tool_rectangle-members.html @@ -94,8 +94,8 @@ $(document).ready(function(){initNavTree('class_intelli_tool_rectangle.html','') - - + + diff --git a/docs/html/class_intelli_tool_rectangle.html b/docs/html/class_intelli_tool_rectangle.html index 6053b31..ff466dc 100644 --- a/docs/html/class_intelli_tool_rectangle.html +++ b/docs/html/class_intelli_tool_rectangle.html @@ -137,10 +137,10 @@ Public Member Functions - - - - + + + +

Additional Inherited Members

AreaIntelliToolprotected
CanvasIntelliToolprotected
colorPickerIntelliToolprotected
getIsDrawing()IntelliTool
getTooltype()IntelliTool
getIsDrawing() constIntelliTool
getTooltype() constIntelliTool
IntelliTool(PaintingArea *Area, IntelliColorPicker *colorPicker, IntelliToolsettings *Toolsettings)IntelliTool
IntelliToolRectangle(PaintingArea *Area, IntelliColorPicker *colorPicker, IntelliToolsettings *Toolsettings)IntelliToolRectangle
isDrawingIntelliToolprotected
virtual ~IntelliTool ()=0
 An abstract Destructor. More...
 
Tooltype getTooltype ()
 
bool getIsDrawing ()
 
Tooltype getTooltype () const
 
bool getIsDrawing () const
 
diff --git a/docs/html/class_intelli_toolsettings-members.html b/docs/html/class_intelli_toolsettings-members.html index 4cf73fc..b280b1b 100644 --- a/docs/html/class_intelli_toolsettings-members.html +++ b/docs/html/class_intelli_toolsettings-members.html @@ -89,8 +89,8 @@ $(document).ready(function(){initNavTree('class_intelli_toolsettings.html','');

This is the complete list of members for IntelliToolsettings, including all inherited members.

Additional Inherited Members

- - + + diff --git a/docs/html/class_intelli_toolsettings.html b/docs/html/class_intelli_toolsettings.html index 2dd77e8..027ccb6 100644 --- a/docs/html/class_intelli_toolsettings.html +++ b/docs/html/class_intelli_toolsettings.html @@ -98,12 +98,12 @@ Public Member Functions - - + + - - + +
getInnerAlpha()IntelliToolsettings
getLineWidth()IntelliToolsettings
getInnerAlpha() constIntelliToolsettings
getLineWidth() constIntelliToolsettings
IntelliToolsettings()IntelliToolsettings
setInnerAlpha(int innerAlpha)IntelliToolsettings
setLineWidth(int LineWidth)IntelliToolsettings
 
virtual ~IntelliToolsettings ()
 
int getLineWidth ()
 
int getLineWidth () const
 
void setLineWidth (int LineWidth)
 
int getInnerAlpha ()
 
int getInnerAlpha () const
 
void setInnerAlpha (int innerAlpha)
 
@@ -158,8 +158,8 @@ Public Member Functions

Member Function Documentation

- -

◆ getInnerAlpha()

+ +

◆ getInnerAlpha()

@@ -168,7 +168,7 @@ Public Member Functions int IntelliToolsettings::getInnerAlpha ( ) - + const
@@ -177,8 +177,8 @@ Public Member Functions
- -

◆ getLineWidth()

+ +

◆ getLineWidth()

@@ -187,7 +187,7 @@ Public Member Functions int IntelliToolsettings::getLineWidth ( ) - + const
diff --git a/docs/html/class_intelli_toolsettings.js b/docs/html/class_intelli_toolsettings.js index 4cb8f44..628d2d8 100644 --- a/docs/html/class_intelli_toolsettings.js +++ b/docs/html/class_intelli_toolsettings.js @@ -2,8 +2,8 @@ var class_intelli_toolsettings = [ [ "IntelliToolsettings", "class_intelli_toolsettings.html#a5560602964ab95380967d63ab7ec6e69", null ], [ "~IntelliToolsettings", "class_intelli_toolsettings.html#a927e50594a459c952d06acd34c0eff56", null ], - [ "getInnerAlpha", "class_intelli_toolsettings.html#a7d6ce2054ec4bcba7629dc2b514b6b5c", null ], - [ "getLineWidth", "class_intelli_toolsettings.html#a68528dd3bad8f39ba19fa6b12a4e415a", null ], + [ "getInnerAlpha", "class_intelli_toolsettings.html#a96d267baa782a32784dbeb1b7cd68cc4", null ], + [ "getLineWidth", "class_intelli_toolsettings.html#abb3ee5a9c8a379167060799d275e65c3", null ], [ "setInnerAlpha", "class_intelli_toolsettings.html#a9a61f3de61efeba2287f8b32941f4271", null ], [ "setLineWidth", "class_intelli_toolsettings.html#a73fa94c85c6c2fdc1a33975a33304a6f", null ] ]; \ No newline at end of file diff --git a/docs/html/functions.html b/docs/html/functions.html index 9b6d083..c879779 100644 --- a/docs/html/functions.html +++ b/docs/html/functions.html @@ -205,7 +205,7 @@ $(document).ready(function(){initNavTree('functions.html',''); initResizable(); , IntelliShapedImage
  • getFirstColor() -: IntelliColorPicker +: IntelliColorPicker
  • getHeightOfActive() : PaintingArea @@ -220,16 +220,16 @@ $(document).ready(function(){initNavTree('functions.html',''); initResizable(); : PaintingArea
  • getInnerAlpha() -: IntelliToolsettings +: IntelliToolsettings
  • getInt() : IntelliInputDialog
  • getIsDrawing() -: IntelliTool +: IntelliTool
  • getLineWidth() -: IntelliToolsettings +: IntelliToolsettings
  • getMaxHeight() : PaintingArea @@ -251,10 +251,10 @@ $(document).ready(function(){initNavTree('functions.html',''); initResizable(); : PaintingArea
  • getSecondColor() -: IntelliColorPicker +: IntelliColorPicker
  • getTooltype() -: IntelliTool +: IntelliTool
  • getTypeOfImage() : IntelliImage @@ -340,7 +340,7 @@ $(document).ready(function(){initNavTree('functions.html',''); initResizable(); : IntelliTool
  • isFastRenderering() -: IntelliRenderSettings +: IntelliRenderSettings
  • diff --git a/docs/html/functions_func.html b/docs/html/functions_func.html index 9ed0c7c..0efe9e7 100644 --- a/docs/html/functions_func.html +++ b/docs/html/functions_func.html @@ -166,7 +166,7 @@ $(document).ready(function(){initNavTree('functions_func.html',''); initResizabl , IntelliShapedImage
  • getFirstColor() -: IntelliColorPicker +: IntelliColorPicker
  • getHeightOfActive() : PaintingArea @@ -181,16 +181,16 @@ $(document).ready(function(){initNavTree('functions_func.html',''); initResizabl : PaintingArea
  • getInnerAlpha() -: IntelliToolsettings +: IntelliToolsettings
  • getInt() : IntelliInputDialog
  • getIsDrawing() -: IntelliTool +: IntelliTool
  • getLineWidth() -: IntelliToolsettings +: IntelliToolsettings
  • getMaxHeight() : PaintingArea @@ -212,10 +212,10 @@ $(document).ready(function(){initNavTree('functions_func.html',''); initResizabl : PaintingArea
  • getSecondColor() -: IntelliColorPicker +: IntelliColorPicker
  • getTooltype() -: IntelliTool +: IntelliTool
  • getTypeOfImage() : IntelliImage @@ -279,7 +279,7 @@ $(document).ready(function(){initNavTree('functions_func.html',''); initResizabl : IntelliToolsettings
  • isFastRenderering() -: IntelliRenderSettings +: IntelliRenderSettings
  • diff --git a/docs/html/main_unit_test_8cpp_source.html b/docs/html/main_unit_test_8cpp_source.html index c21eb0f..8b5a315 100644 --- a/docs/html/main_unit_test_8cpp_source.html +++ b/docs/html/main_unit_test_8cpp_source.html @@ -86,111 +86,111 @@ $(document).ready(function(){initNavTree('main_unit_test_8cpp_source.html','');
    mainUnitTest.cpp
    -Go to the documentation of this file.
    1 #include <QtTest>
    +Go to the documentation of this file.
    1 #include <QtTest>
    2 // add necessary includes here
    -
    3 #include<string>
    +
    3 #include <string>
    4 
    5 #include "GUI/IntelliPhotoGui.h"
    6 
    7 
    8 class UnitTest : public QObject
    9 {
    -
    10  Q_OBJECT
    +
    10 Q_OBJECT
    11 private:
    -
    12  IntelliPhotoGui* gui;
    -
    13  PaintingArea* area;
    -
    14  QApplication* app;
    +
    12 IntelliPhotoGui* gui;
    +
    13 PaintingArea* area;
    +
    14 QApplication* app;
    15 
    16 public:
    -
    17  UnitTest();
    -
    18  ~UnitTest();
    +
    17 UnitTest();
    +
    18 ~UnitTest();
    19 
    20 private slots:
    -
    21  void initTestCase();
    -
    22  void cleanupTestCase();
    -
    23  //void test_case1();
    +
    21 void initTestCase();
    +
    22 void cleanupTestCase();
    +
    23 //void test_case1();
    24 
    -
    25  //test painting area
    -
    26  void test_addLayer();
    -
    27  void test_deleteLayer();
    -
    28  void test_setActive();
    -
    29  void test_setAlpha();
    -
    30  void test_floodFill();
    -
    31  void test_moveActive();
    -
    32  void test_setPolygon();
    -
    33  void test_setLayerUp();
    -
    34  void test_setLayerDown();
    +
    25 //test painting area
    +
    26 void test_addLayer();
    +
    27 void test_deleteLayer();
    +
    28 void test_setActive();
    +
    29 void test_setAlpha();
    +
    30 void test_floodFill();
    +
    31 void test_moveActive();
    +
    32 void test_setPolygon();
    +
    33 void test_setLayerUp();
    +
    34 void test_setLayerDown();
    35 
    -
    36  void test_createTools();
    +
    36 void test_createTools();
    37 
    -
    38  //test Raster-Image operations
    -
    39  void test_RasterImage_drawPixel();
    -
    40  void test_RasterImage_drawLine();
    -
    41  void test_RasterImage_drawPoint();
    -
    42  void test_RasterImage_getDisplayable();
    -
    43  void test_RasterImage_setPolygon();
    -
    44  void test_RasterImage_loadImage();
    -
    45  void test_RasterImage_getPixelColor();
    -
    46  void test_RasterImage_getImageData();
    -
    47  void test_RasterImage_setImageData();
    +
    38 //test Raster-Image operations
    +
    39 void test_RasterImage_drawPixel();
    +
    40 void test_RasterImage_drawLine();
    +
    41 void test_RasterImage_drawPoint();
    +
    42 void test_RasterImage_getDisplayable();
    +
    43 void test_RasterImage_setPolygon();
    +
    44 void test_RasterImage_loadImage();
    +
    45 void test_RasterImage_getPixelColor();
    +
    46 void test_RasterImage_getImageData();
    +
    47 void test_RasterImage_setImageData();
    48 
    -
    49  //test Shaped-Image operations
    -
    50  void test_ShapedImage_drawPixel();
    -
    51  void test_ShapedImage_drawLine();
    -
    52  void test_ShapedImage_drawPoint();
    -
    53  void test_ShapedImage_getDisplayable();
    -
    54  void test_ShapedImage_setPolygon();
    -
    55  void test_ShapedImage_loadImage();
    -
    56  void test_ShapedImage_getPixelColor();
    -
    57  void test_ShapedImage_getImageData();
    -
    58  void test_ShapedImage_setImageData();
    +
    49 //test Shaped-Image operations
    +
    50 void test_ShapedImage_drawPixel();
    +
    51 void test_ShapedImage_drawLine();
    +
    52 void test_ShapedImage_drawPoint();
    +
    53 void test_ShapedImage_getDisplayable();
    +
    54 void test_ShapedImage_setPolygon();
    +
    55 void test_ShapedImage_loadImage();
    +
    56 void test_ShapedImage_getPixelColor();
    +
    57 void test_ShapedImage_getImageData();
    +
    58 void test_ShapedImage_setImageData();
    59 
    -
    60  //test painting-area tools
    -
    61  void test_createTool_Circle();
    -
    62  void test_createTool_FloodFill();
    -
    63  void test_createTool_Line();
    -
    64  void test_createTool_Pen();
    -
    65  void test_createTool_Plain();
    -
    66  void test_createTool_Polygon();
    -
    67  void test_createTool_Rectangle();
    +
    60 //test painting-area tools
    +
    61 void test_createTool_Circle();
    +
    62 void test_createTool_FloodFill();
    +
    63 void test_createTool_Line();
    +
    64 void test_createTool_Pen();
    +
    65 void test_createTool_Plain();
    +
    66 void test_createTool_Polygon();
    +
    67 void test_createTool_Rectangle();
    68 
    -
    69  //test tools
    -
    70  void test_Circle_fullDraw();
    -
    71  void test_Circle_interruptedDraw();
    +
    69 //test tools
    +
    70 void test_Circle_fullDraw();
    +
    71 void test_Circle_interruptedDraw();
    72 
    -
    73  void test_FloodFill_fullDraw();
    -
    74  void test_FloodFill_interruptedDraw();
    +
    73 void test_FloodFill_fullDraw();
    +
    74 void test_FloodFill_interruptedDraw();
    75 
    -
    76  void test_Line_fullDraw();
    -
    77  void test_Line_interruptedDraw();
    +
    76 void test_Line_fullDraw();
    +
    77 void test_Line_interruptedDraw();
    78 
    -
    79  void test_Pen_fullDraw();
    -
    80  void test_Pen_interruptedDraw();
    +
    79 void test_Pen_fullDraw();
    +
    80 void test_Pen_interruptedDraw();
    81 
    -
    82  void test_Plain_fullDraw();
    -
    83  void test_Plain_interruptedDraw();
    +
    82 void test_Plain_fullDraw();
    +
    83 void test_Plain_interruptedDraw();
    84 
    -
    85  void test_Polygon_fullDraw();
    -
    86  void test_Polygon_interruptedDraw();
    +
    85 void test_Polygon_fullDraw();
    +
    86 void test_Polygon_interruptedDraw();
    87 
    -
    88  void test_Rectangle_fullDraw();
    -
    89  void test_Rectangle_interruptedDraw();
    +
    88 void test_Rectangle_fullDraw();
    +
    89 void test_Rectangle_interruptedDraw();
    90 
    -
    91  //test Triangulation
    -
    92  void test_Triangulation_Coverage();
    +
    91 //test Triangulation
    +
    92 void test_Triangulation_Coverage();
    93 };
    94 
    96 {
    -
    97  char arg0[] = "programName";
    -
    98  char arg1[] = "arg1";
    -
    99  char arg2[] = "arg2";
    -
    100  char *argv[] = {arg0, arg1, arg2, nullptr};
    -
    101  int argc = sizeof(argv) / sizeof(char*) - 1;
    +
    97  char arg0[] = "programName";
    +
    98  char arg1[] = "arg1";
    +
    99  char arg2[] = "arg2";
    +
    100  char*argv[] = {arg0, arg1, arg2, nullptr};
    +
    101  int argc = sizeof(argv) / sizeof(char*) - 1;
    102 
    -
    103  app = new QApplication(argc,argv);
    -
    104  gui = new IntelliPhotoGui();
    -
    105  area = gui->paintingArea;
    +
    103  app = new QApplication(argc,argv);
    +
    104  gui = new IntelliPhotoGui();
    +
    105  area = gui->paintingArea;
    106 }
    107 
    @@ -205,8 +205,8 @@ $(document).ready(function(){initNavTree('main_unit_test_8cpp_source.html','');
    117 
    118 void UnitTest::cleanupTestCase()
    119 {
    -
    120  delete gui;
    -
    121  delete app;
    +
    120  delete gui;
    +
    121  delete app;
    122 }
    123 
    124 //void UnitTest::test_case1()
    @@ -217,77 +217,127 @@ $(document).ready(function(){initNavTree('main_unit_test_8cpp_source.html','');
    129 //}
    130 
    131 //test painting area
    -
    132 void UnitTest::test_addLayer(){}
    -
    133 void UnitTest::test_deleteLayer(){}
    -
    134 void UnitTest::test_setActive(){}
    -
    135 void UnitTest::test_setAlpha(){}
    -
    136 void UnitTest::test_floodFill(){}
    -
    137 void UnitTest::test_moveActive(){}
    -
    138 void UnitTest::test_setPolygon(){}
    -
    139 void UnitTest::test_setLayerUp(){}
    -
    140 void UnitTest::test_setLayerDown(){}
    -
    141 
    -
    142 void UnitTest::test_createTools(){}
    -
    143 
    -
    144 //test Raster-Image operations
    -
    145 void UnitTest::test_RasterImage_drawPixel(){}
    -
    146 void UnitTest::test_RasterImage_drawLine(){}
    -
    147 void UnitTest::test_RasterImage_drawPoint(){}
    -
    148 void UnitTest::test_RasterImage_getDisplayable(){}
    -
    149 void UnitTest::test_RasterImage_setPolygon(){}
    -
    150 void UnitTest::test_RasterImage_loadImage(){}
    -
    151 void UnitTest::test_RasterImage_getPixelColor(){}
    -
    152 void UnitTest::test_RasterImage_getImageData(){}
    -
    153 void UnitTest::test_RasterImage_setImageData(){}
    -
    154 
    -
    155 //test Shaped-Image operations
    -
    156 void UnitTest::test_ShapedImage_drawPixel(){}
    -
    157 void UnitTest::test_ShapedImage_drawLine(){}
    -
    158 void UnitTest::test_ShapedImage_drawPoint(){}
    -
    159 void UnitTest::test_ShapedImage_getDisplayable(){}
    -
    160 void UnitTest::test_ShapedImage_setPolygon(){}
    -
    161 void UnitTest::test_ShapedImage_loadImage(){}
    -
    162 void UnitTest::test_ShapedImage_getPixelColor(){}
    -
    163 void UnitTest::test_ShapedImage_getImageData(){}
    -
    164 void UnitTest::test_ShapedImage_setImageData(){}
    -
    165 
    -
    166 //test painting-area tools
    -
    167 void UnitTest::test_createTool_Circle(){}
    -
    168 void UnitTest::test_createTool_FloodFill(){}
    -
    169 void UnitTest::test_createTool_Line(){}
    -
    170 void UnitTest::test_createTool_Pen(){}
    -
    171 void UnitTest::test_createTool_Plain(){}
    -
    172 void UnitTest::test_createTool_Polygon(){}
    -
    173 void UnitTest::test_createTool_Rectangle(){}
    -
    174 
    -
    175 //test tools
    -
    176 void UnitTest::test_Circle_fullDraw(){}
    -
    177 void UnitTest::test_Circle_interruptedDraw(){}
    -
    178 
    -
    179 void UnitTest::test_FloodFill_fullDraw(){}
    -
    180 void UnitTest::test_FloodFill_interruptedDraw(){}
    -
    181 
    -
    182 void UnitTest::test_Line_fullDraw(){}
    -
    183 void UnitTest::test_Line_interruptedDraw(){}
    -
    184 
    -
    185 void UnitTest::test_Pen_fullDraw(){}
    -
    186 void UnitTest::test_Pen_interruptedDraw(){}
    -
    187 
    -
    188 void UnitTest::test_Plain_fullDraw(){}
    -
    189 void UnitTest::test_Plain_interruptedDraw(){}
    -
    190 
    -
    191 void UnitTest::test_Polygon_fullDraw(){}
    -
    192 void UnitTest::test_Polygon_interruptedDraw(){}
    +
    132 void UnitTest::test_addLayer(){
    +
    133 }
    +
    134 void UnitTest::test_deleteLayer(){
    +
    135 }
    +
    136 void UnitTest::test_setActive(){
    +
    137 }
    +
    138 void UnitTest::test_setAlpha(){
    +
    139 }
    +
    140 void UnitTest::test_floodFill(){
    +
    141 }
    +
    142 void UnitTest::test_moveActive(){
    +
    143 }
    +
    144 void UnitTest::test_setPolygon(){
    +
    145 }
    +
    146 void UnitTest::test_setLayerUp(){
    +
    147 }
    +
    148 void UnitTest::test_setLayerDown(){
    +
    149 }
    +
    150 
    +
    151 void UnitTest::test_createTools(){
    +
    152 }
    +
    153 
    +
    154 //test Raster-Image operations
    +
    155 void UnitTest::test_RasterImage_drawPixel(){
    +
    156 }
    +
    157 void UnitTest::test_RasterImage_drawLine(){
    +
    158 }
    +
    159 void UnitTest::test_RasterImage_drawPoint(){
    +
    160 }
    +
    161 void UnitTest::test_RasterImage_getDisplayable(){
    +
    162 }
    +
    163 void UnitTest::test_RasterImage_setPolygon(){
    +
    164 }
    +
    165 void UnitTest::test_RasterImage_loadImage(){
    +
    166 }
    +
    167 void UnitTest::test_RasterImage_getPixelColor(){
    +
    168 }
    +
    169 void UnitTest::test_RasterImage_getImageData(){
    +
    170 }
    +
    171 void UnitTest::test_RasterImage_setImageData(){
    +
    172 }
    +
    173 
    +
    174 //test Shaped-Image operations
    +
    175 void UnitTest::test_ShapedImage_drawPixel(){
    +
    176 }
    +
    177 void UnitTest::test_ShapedImage_drawLine(){
    +
    178 }
    +
    179 void UnitTest::test_ShapedImage_drawPoint(){
    +
    180 }
    +
    181 void UnitTest::test_ShapedImage_getDisplayable(){
    +
    182 }
    +
    183 void UnitTest::test_ShapedImage_setPolygon(){
    +
    184 }
    +
    185 void UnitTest::test_ShapedImage_loadImage(){
    +
    186 }
    +
    187 void UnitTest::test_ShapedImage_getPixelColor(){
    +
    188 }
    +
    189 void UnitTest::test_ShapedImage_getImageData(){
    +
    190 }
    +
    191 void UnitTest::test_ShapedImage_setImageData(){
    +
    192 }
    193 
    -
    194 void UnitTest::test_Rectangle_fullDraw(){}
    -
    195 void UnitTest::test_Rectangle_interruptedDraw(){}
    -
    196 
    -
    197 //test Triangulation
    -
    198 void UnitTest::test_Triangulation_Coverage(){}
    -
    199 
    -
    200 QTEST_APPLESS_MAIN(UnitTest)
    -
    201 
    -
    202 #include "tst_unittest.moc"
    +
    194 //test painting-area tools
    +
    195 void UnitTest::test_createTool_Circle(){
    +
    196 }
    +
    197 void UnitTest::test_createTool_FloodFill(){
    +
    198 }
    +
    199 void UnitTest::test_createTool_Line(){
    +
    200 }
    +
    201 void UnitTest::test_createTool_Pen(){
    +
    202 }
    +
    203 void UnitTest::test_createTool_Plain(){
    +
    204 }
    +
    205 void UnitTest::test_createTool_Polygon(){
    +
    206 }
    +
    207 void UnitTest::test_createTool_Rectangle(){
    +
    208 }
    +
    209 
    +
    210 //test tools
    +
    211 void UnitTest::test_Circle_fullDraw(){
    +
    212 }
    +
    213 void UnitTest::test_Circle_interruptedDraw(){
    +
    214 }
    +
    215 
    +
    216 void UnitTest::test_FloodFill_fullDraw(){
    +
    217 }
    +
    218 void UnitTest::test_FloodFill_interruptedDraw(){
    +
    219 }
    +
    220 
    +
    221 void UnitTest::test_Line_fullDraw(){
    +
    222 }
    +
    223 void UnitTest::test_Line_interruptedDraw(){
    +
    224 }
    +
    225 
    +
    226 void UnitTest::test_Pen_fullDraw(){
    +
    227 }
    +
    228 void UnitTest::test_Pen_interruptedDraw(){
    +
    229 }
    +
    230 
    +
    231 void UnitTest::test_Plain_fullDraw(){
    +
    232 }
    +
    233 void UnitTest::test_Plain_interruptedDraw(){
    +
    234 }
    +
    235 
    +
    236 void UnitTest::test_Polygon_fullDraw(){
    +
    237 }
    +
    238 void UnitTest::test_Polygon_interruptedDraw(){
    +
    239 }
    +
    240 
    +
    241 void UnitTest::test_Rectangle_fullDraw(){
    +
    242 }
    +
    243 void UnitTest::test_Rectangle_interruptedDraw(){
    +
    244 }
    +
    245 
    +
    246 //test Triangulation
    +
    247 void UnitTest::test_Triangulation_Coverage(){
    +
    248 }
    +
    249 
    +
    250 QTEST_APPLESS_MAIN(UnitTest)
    +
    251 
    +
    252 #include "tst_unittest.moc"
    diff --git a/docs/html/navtreeindex0.js b/docs/html/navtreeindex0.js index 133c659..52578ef 100644 --- a/docs/html/navtreeindex0.js +++ b/docs/html/navtreeindex0.js @@ -81,10 +81,10 @@ var NAVTREEINDEX0 = "class_intelli_color_picker.html":[1,0,0], "class_intelli_color_picker.html#a0d1247bdd87add1396ea5d9acaad79ae":[1,0,0,0], "class_intelli_color_picker.html#a40b975268a1f05249e8a49dde9a862ff":[1,0,0,1], -"class_intelli_color_picker.html#a55568fbf5dc783f06284b7031ffe9415":[1,0,0,3], "class_intelli_color_picker.html#a7e2ddbbbfbed383f06b24e5bf6b27ae8":[1,0,0,4], "class_intelli_color_picker.html#a86bf4a940e4a0e465e30cbdf28748931":[1,0,0,5], -"class_intelli_color_picker.html#aae2eb27b928fe9388b9398b0556303b7":[1,0,0,2], +"class_intelli_color_picker.html#ab41abe8fb7e184db2c33e792f09792e0":[1,0,0,3], +"class_intelli_color_picker.html#aeb08029a0c946ed0402c9c11a91965b1":[1,0,0,2], "class_intelli_color_picker.html#aec499265ae28ce1b54be88222e74292e":[1,0,0,6], "class_intelli_image.html":[1,0,1], "class_intelli_image.html#a177403ab9585d4ba31984a644c54d310":[1,0,1,16], @@ -130,8 +130,8 @@ var NAVTREEINDEX0 = "class_intelli_raster_image.html#ae43393397b0141a8033fe34d3a1b1884":[1,0,4,4], "class_intelli_raster_image.html#ae779b571372296f1922af818ba003413":[1,0,4,0], "class_intelli_render_settings.html":[1,0,5], +"class_intelli_render_settings.html#a38fd592c4948d2e47b95bb6fabc34073":[1,0,5,1], "class_intelli_render_settings.html#a4a01de6e5e8e516a7eae51d6f1f66529":[1,0,5,0], -"class_intelli_render_settings.html#a5d0eb9a5a3bf788dd87509386dea8dcd":[1,0,5,1], "class_intelli_render_settings.html#a5ffb878b77e5d448ffe4eb03a8397ac2":[1,0,5,2], "class_intelli_shaped_image.html":[1,0,6], "class_intelli_shaped_image.html#a43d63d8a814852d377ee2030658fbab9":[1,0,6,1], @@ -143,7 +143,6 @@ var NAVTREEINDEX0 = "class_intelli_shaped_image.html#ae4518c7f5a105cc4f33fabb60c794a93":[1,0,6,5], "class_intelli_shaped_image.html#aed0b31e0fa771104399d1f5ff39a0337":[1,0,6,2], "class_intelli_tool.html":[1,0,7], -"class_intelli_tool.html#a0020fad2e26315d5c4d96dbc95d1dceb":[1,0,7,3], "class_intelli_tool.html#a08ef094271ce6248b42f888472463526":[1,0,7,1], "class_intelli_tool.html#a144d469cc03584f501194529a1b53c77":[1,0,7,14], "class_intelli_tool.html#a16189b00307c6d7e89f28198f54404b0":[1,0,7,9], @@ -164,11 +163,12 @@ var NAVTREEINDEX0 = "class_intelli_tool.html#a57fb1b27d364c9e3696eb928b75fa9f2":[1,0,7,2], "class_intelli_tool.html#a631388999f36013628e13b9de87a6f7b":[1,0,7,12], "class_intelli_tool.html#a906a2575c16c8a33cb2a5197f8d8cc5b":[1,0,7,6], -"class_intelli_tool.html#aae2a11c5bae4973ed827c60e0c1352b1":[1,0,7,4], "class_intelli_tool.html#ab4c2698a0f9f25fb6639ec760d2d0289":[1,0,7,13], "class_intelli_tool.html#ac10e20414cd8855a2f9b103fb6408639":[1,0,7,7], +"class_intelli_tool.html#adf5c06ad2b2c0d745fb68cf80e7e5694":[1,0,7,4], "class_intelli_tool.html#ae2e0ac394611a361ab4ef2fe55c03fef":[1,0,7,15], "class_intelli_tool.html#aedccdad01b2bc6ec84fad3582251ff5d":[1,0,7,11], +"class_intelli_tool.html#af90f0965efbc5c25126691e998f39ca3":[1,0,7,3], "class_intelli_tool_circle.html":[1,0,8], "class_intelli_tool_circle.html#a29d7b9ed4960e6fe1f31ff620363e429":[1,0,8,5], "class_intelli_tool_circle.html#a7a03b65b95d7b5d72e6a92c95f068954":[1,0,8,1], @@ -234,11 +234,11 @@ var NAVTREEINDEX0 = "class_intelli_tool_rectangle.html#ae03c307ccf66cbe3fd59e3657712368d":[1,0,14,2], "class_intelli_toolsettings.html":[1,0,15], "class_intelli_toolsettings.html#a5560602964ab95380967d63ab7ec6e69":[1,0,15,0], -"class_intelli_toolsettings.html#a68528dd3bad8f39ba19fa6b12a4e415a":[1,0,15,3], "class_intelli_toolsettings.html#a73fa94c85c6c2fdc1a33975a33304a6f":[1,0,15,5], -"class_intelli_toolsettings.html#a7d6ce2054ec4bcba7629dc2b514b6b5c":[1,0,15,2], "class_intelli_toolsettings.html#a927e50594a459c952d06acd34c0eff56":[1,0,15,1], +"class_intelli_toolsettings.html#a96d267baa782a32784dbeb1b7cd68cc4":[1,0,15,2], "class_intelli_toolsettings.html#a9a61f3de61efeba2287f8b32941f4271":[1,0,15,4], +"class_intelli_toolsettings.html#abb3ee5a9c8a379167060799d275e65c3":[1,0,15,3], "class_painting_area.html":[1,0,17], "class_painting_area.html#a0b22e18069b524f3e75857d203baf256":[1,0,17,8], "class_painting_area.html#a132535c4e16052c1472cf1b9f3e096ed":[1,0,17,39], diff --git a/docs/html/search/all_5.js b/docs/html/search/all_5.js index 1ba5d99..d8db878 100644 --- a/docs/html/search/all_5.js +++ b/docs/html/search/all_5.js @@ -2,23 +2,23 @@ var searchData= [ ['getdeepcopy_32',['getDeepCopy',['../class_intelli_image.html#af6381067bdf565669f856bb589008ae9',1,'IntelliImage::getDeepCopy()'],['../class_intelli_raster_image.html#a8f901301b106504de3c27308ade897dc',1,'IntelliRasterImage::getDeepCopy()'],['../class_intelli_shaped_image.html#aed0b31e0fa771104399d1f5ff39a0337',1,'IntelliShapedImage::getDeepCopy()']]], ['getdisplayable_33',['getDisplayable',['../class_intelli_image.html#a21c7e65b59a26db45aac3880133ef21d',1,'IntelliImage::getDisplayable(const QSize &displaySize, int alpha)=0'],['../class_intelli_image.html#a9d4daf3c48c64695105689f61c21bae0',1,'IntelliImage::getDisplayable(int alpha=255)=0'],['../class_intelli_raster_image.html#ae43393397b0141a8033fe34d3a1b1884',1,'IntelliRasterImage::getDisplayable(const QSize &displaySize, int alpha) override'],['../class_intelli_raster_image.html#a612d79124f0e2c158a4f0abbe4b5f97f',1,'IntelliRasterImage::getDisplayable(int alpha=255) override'],['../class_intelli_shaped_image.html#a68cf374247c16f07fd84d50e4cd05630',1,'IntelliShapedImage::getDisplayable(const QSize &displaySize, int alpha=255) override'],['../class_intelli_shaped_image.html#ac6a99e1a96134073bceea252b37636cc',1,'IntelliShapedImage::getDisplayable(int alpha=255) override']]], - ['getfirstcolor_34',['getFirstColor',['../class_intelli_color_picker.html#aae2eb27b928fe9388b9398b0556303b7',1,'IntelliColorPicker']]], + ['getfirstcolor_34',['getFirstColor',['../class_intelli_color_picker.html#aeb08029a0c946ed0402c9c11a91965b1',1,'IntelliColorPicker']]], ['getheightofactive_35',['getHeightOfActive',['../class_painting_area.html#ac576f58aad03b4dcd47611b6a4b9abb4',1,'PaintingArea']]], ['getimagedata_36',['getImageData',['../class_intelli_image.html#ad66fbe380ffe0e073a8cd760f8285fe3',1,'IntelliImage']]], ['getimagedataofactivelayer_37',['getImageDataOfActiveLayer',['../class_painting_area.html#a4f484ff3ca7ae202ab57a00f52551423',1,'PaintingArea']]], ['getimageofactivelayer_38',['getImageOfActiveLayer',['../class_painting_area.html#acab11ad35d07e9081203d8217d2c0855',1,'PaintingArea']]], - ['getinneralpha_39',['getInnerAlpha',['../class_intelli_toolsettings.html#a7d6ce2054ec4bcba7629dc2b514b6b5c',1,'IntelliToolsettings']]], + ['getinneralpha_39',['getInnerAlpha',['../class_intelli_toolsettings.html#a96d267baa782a32784dbeb1b7cd68cc4',1,'IntelliToolsettings']]], ['getint_40',['getInt',['../class_intelli_input_dialog.html#a480ac2f5b8f7b9bc1cd7b30df84c2a62',1,'IntelliInputDialog']]], - ['getisdrawing_41',['getIsDrawing',['../class_intelli_tool.html#a0020fad2e26315d5c4d96dbc95d1dceb',1,'IntelliTool']]], - ['getlinewidth_42',['getLineWidth',['../class_intelli_toolsettings.html#a68528dd3bad8f39ba19fa6b12a4e415a',1,'IntelliToolsettings']]], + ['getisdrawing_41',['getIsDrawing',['../class_intelli_tool.html#af90f0965efbc5c25126691e998f39ca3',1,'IntelliTool']]], + ['getlinewidth_42',['getLineWidth',['../class_intelli_toolsettings.html#abb3ee5a9c8a379167060799d275e65c3',1,'IntelliToolsettings']]], ['getmaxheight_43',['getMaxHeight',['../class_painting_area.html#aa811d142df9239ae248679bd70ad6da7',1,'PaintingArea']]], ['getmaxwidth_44',['getMaxWidth',['../class_painting_area.html#aeb082c1cda3edb6b68d8ee45cf4822f8',1,'PaintingArea']]], ['getnumberofactivelayer_45',['getNumberOfActiveLayer',['../class_painting_area.html#a24280454ebb80db7feba2fd621513353',1,'PaintingArea']]], ['getpixelcolor_46',['getPixelColor',['../class_intelli_image.html#a4576ebb6d863321c816293d7b7f9fd3f',1,'IntelliImage']]], ['getpolygondata_47',['getPolygonData',['../class_intelli_image.html#aaf9f3e8db8666850024bee9aad9966ba',1,'IntelliImage::getPolygonData()'],['../class_intelli_shaped_image.html#ae4518c7f5a105cc4f33fabb60c794a93',1,'IntelliShapedImage::getPolygonData()']]], ['getpolygondataofreallayer_48',['getPolygonDataOfRealLayer',['../class_painting_area.html#a7ae21fd031ee1c04f92e042e86be0a90',1,'PaintingArea']]], - ['getsecondcolor_49',['getSecondColor',['../class_intelli_color_picker.html#a55568fbf5dc783f06284b7031ffe9415',1,'IntelliColorPicker']]], - ['gettooltype_50',['getTooltype',['../class_intelli_tool.html#aae2a11c5bae4973ed827c60e0c1352b1',1,'IntelliTool']]], + ['getsecondcolor_49',['getSecondColor',['../class_intelli_color_picker.html#ab41abe8fb7e184db2c33e792f09792e0',1,'IntelliColorPicker']]], + ['gettooltype_50',['getTooltype',['../class_intelli_tool.html#adf5c06ad2b2c0d745fb68cf80e7e5694',1,'IntelliTool']]], ['gettypeofimage_51',['getTypeOfImage',['../class_intelli_image.html#af6b09c8d1d6b54a7e8a4e7286f3e503f',1,'IntelliImage']]], ['gettypeofimagereallayer_52',['getTypeOfImageRealLayer',['../class_painting_area.html#ae92b27dfd09573c224d2ae1958d3bead',1,'PaintingArea']]], ['getwidthofactive_53',['getWidthOfActive',['../class_painting_area.html#a675ee91b26b1c58be6d833f279d81597',1,'PaintingArea']]] diff --git a/docs/html/search/all_7.js b/docs/html/search/all_7.js index 29d4e96..42865e3 100644 --- a/docs/html/search/all_7.js +++ b/docs/html/search/all_7.js @@ -55,7 +55,7 @@ var searchData= ['intellitriangulation_2ecpp_108',['IntelliTriangulation.cpp',['../_intelli_triangulation_8cpp.html',1,'']]], ['intellitriangulation_2eh_109',['IntelliTriangulation.h',['../_intelli_triangulation_8h.html',1,'']]], ['isdrawing_110',['isDrawing',['../class_intelli_tool.html#a555aa8a74992327f740dd69b3bb0ccca',1,'IntelliTool']]], - ['isfastrenderering_111',['isFastRenderering',['../class_intelli_render_settings.html#a5d0eb9a5a3bf788dd87509386dea8dcd',1,'IntelliRenderSettings']]], + ['isfastrenderering_111',['isFastRenderering',['../class_intelli_render_settings.html#a38fd592c4948d2e47b95bb6fabc34073',1,'IntelliRenderSettings']]], ['isinpolygon_112',['isInPolygon',['../namespace_intelli_triangulation.html#ac276696f29d141ed34614c1c3b1c040f',1,'IntelliTriangulation']]], ['isintriangle_113',['isInTriangle',['../namespace_intelli_triangulation.html#ac150fee67fd41a451bd2592f10e00197',1,'IntelliTriangulation']]] ]; diff --git a/docs/html/search/functions_3.js b/docs/html/search/functions_3.js index 46edeb3..b82be64 100644 --- a/docs/html/search/functions_3.js +++ b/docs/html/search/functions_3.js @@ -2,23 +2,23 @@ var searchData= [ ['getdeepcopy_270',['getDeepCopy',['../class_intelli_image.html#af6381067bdf565669f856bb589008ae9',1,'IntelliImage::getDeepCopy()'],['../class_intelli_raster_image.html#a8f901301b106504de3c27308ade897dc',1,'IntelliRasterImage::getDeepCopy()'],['../class_intelli_shaped_image.html#aed0b31e0fa771104399d1f5ff39a0337',1,'IntelliShapedImage::getDeepCopy()']]], ['getdisplayable_271',['getDisplayable',['../class_intelli_image.html#a21c7e65b59a26db45aac3880133ef21d',1,'IntelliImage::getDisplayable(const QSize &displaySize, int alpha)=0'],['../class_intelli_image.html#a9d4daf3c48c64695105689f61c21bae0',1,'IntelliImage::getDisplayable(int alpha=255)=0'],['../class_intelli_raster_image.html#ae43393397b0141a8033fe34d3a1b1884',1,'IntelliRasterImage::getDisplayable(const QSize &displaySize, int alpha) override'],['../class_intelli_raster_image.html#a612d79124f0e2c158a4f0abbe4b5f97f',1,'IntelliRasterImage::getDisplayable(int alpha=255) override'],['../class_intelli_shaped_image.html#a68cf374247c16f07fd84d50e4cd05630',1,'IntelliShapedImage::getDisplayable(const QSize &displaySize, int alpha=255) override'],['../class_intelli_shaped_image.html#ac6a99e1a96134073bceea252b37636cc',1,'IntelliShapedImage::getDisplayable(int alpha=255) override']]], - ['getfirstcolor_272',['getFirstColor',['../class_intelli_color_picker.html#aae2eb27b928fe9388b9398b0556303b7',1,'IntelliColorPicker']]], + ['getfirstcolor_272',['getFirstColor',['../class_intelli_color_picker.html#aeb08029a0c946ed0402c9c11a91965b1',1,'IntelliColorPicker']]], ['getheightofactive_273',['getHeightOfActive',['../class_painting_area.html#ac576f58aad03b4dcd47611b6a4b9abb4',1,'PaintingArea']]], ['getimagedata_274',['getImageData',['../class_intelli_image.html#ad66fbe380ffe0e073a8cd760f8285fe3',1,'IntelliImage']]], ['getimagedataofactivelayer_275',['getImageDataOfActiveLayer',['../class_painting_area.html#a4f484ff3ca7ae202ab57a00f52551423',1,'PaintingArea']]], ['getimageofactivelayer_276',['getImageOfActiveLayer',['../class_painting_area.html#acab11ad35d07e9081203d8217d2c0855',1,'PaintingArea']]], - ['getinneralpha_277',['getInnerAlpha',['../class_intelli_toolsettings.html#a7d6ce2054ec4bcba7629dc2b514b6b5c',1,'IntelliToolsettings']]], + ['getinneralpha_277',['getInnerAlpha',['../class_intelli_toolsettings.html#a96d267baa782a32784dbeb1b7cd68cc4',1,'IntelliToolsettings']]], ['getint_278',['getInt',['../class_intelli_input_dialog.html#a480ac2f5b8f7b9bc1cd7b30df84c2a62',1,'IntelliInputDialog']]], - ['getisdrawing_279',['getIsDrawing',['../class_intelli_tool.html#a0020fad2e26315d5c4d96dbc95d1dceb',1,'IntelliTool']]], - ['getlinewidth_280',['getLineWidth',['../class_intelli_toolsettings.html#a68528dd3bad8f39ba19fa6b12a4e415a',1,'IntelliToolsettings']]], + ['getisdrawing_279',['getIsDrawing',['../class_intelli_tool.html#af90f0965efbc5c25126691e998f39ca3',1,'IntelliTool']]], + ['getlinewidth_280',['getLineWidth',['../class_intelli_toolsettings.html#abb3ee5a9c8a379167060799d275e65c3',1,'IntelliToolsettings']]], ['getmaxheight_281',['getMaxHeight',['../class_painting_area.html#aa811d142df9239ae248679bd70ad6da7',1,'PaintingArea']]], ['getmaxwidth_282',['getMaxWidth',['../class_painting_area.html#aeb082c1cda3edb6b68d8ee45cf4822f8',1,'PaintingArea']]], ['getnumberofactivelayer_283',['getNumberOfActiveLayer',['../class_painting_area.html#a24280454ebb80db7feba2fd621513353',1,'PaintingArea']]], ['getpixelcolor_284',['getPixelColor',['../class_intelli_image.html#a4576ebb6d863321c816293d7b7f9fd3f',1,'IntelliImage']]], ['getpolygondata_285',['getPolygonData',['../class_intelli_image.html#aaf9f3e8db8666850024bee9aad9966ba',1,'IntelliImage::getPolygonData()'],['../class_intelli_shaped_image.html#ae4518c7f5a105cc4f33fabb60c794a93',1,'IntelliShapedImage::getPolygonData()']]], ['getpolygondataofreallayer_286',['getPolygonDataOfRealLayer',['../class_painting_area.html#a7ae21fd031ee1c04f92e042e86be0a90',1,'PaintingArea']]], - ['getsecondcolor_287',['getSecondColor',['../class_intelli_color_picker.html#a55568fbf5dc783f06284b7031ffe9415',1,'IntelliColorPicker']]], - ['gettooltype_288',['getTooltype',['../class_intelli_tool.html#aae2a11c5bae4973ed827c60e0c1352b1',1,'IntelliTool']]], + ['getsecondcolor_287',['getSecondColor',['../class_intelli_color_picker.html#ab41abe8fb7e184db2c33e792f09792e0',1,'IntelliColorPicker']]], + ['gettooltype_288',['getTooltype',['../class_intelli_tool.html#adf5c06ad2b2c0d745fb68cf80e7e5694',1,'IntelliTool']]], ['gettypeofimage_289',['getTypeOfImage',['../class_intelli_image.html#af6b09c8d1d6b54a7e8a4e7286f3e503f',1,'IntelliImage']]], ['gettypeofimagereallayer_290',['getTypeOfImageRealLayer',['../class_painting_area.html#ae92b27dfd09573c224d2ae1958d3bead',1,'PaintingArea']]], ['getwidthofactive_291',['getWidthOfActive',['../class_painting_area.html#a675ee91b26b1c58be6d833f279d81597',1,'PaintingArea']]] diff --git a/docs/html/search/functions_4.js b/docs/html/search/functions_4.js index ea9b7cc..085a772 100644 --- a/docs/html/search/functions_4.js +++ b/docs/html/search/functions_4.js @@ -16,7 +16,7 @@ var searchData= ['intellitoolpolygon_305',['IntelliToolPolygon',['../class_intelli_tool_polygon.html#a63b8c7514a87d4608533fbb557ee0db5',1,'IntelliToolPolygon']]], ['intellitoolrectangle_306',['IntelliToolRectangle',['../class_intelli_tool_rectangle.html#ada06457247d5b173888a9a520b31ec5c',1,'IntelliToolRectangle']]], ['intellitoolsettings_307',['IntelliToolsettings',['../class_intelli_toolsettings.html#a5560602964ab95380967d63ab7ec6e69',1,'IntelliToolsettings']]], - ['isfastrenderering_308',['isFastRenderering',['../class_intelli_render_settings.html#a5d0eb9a5a3bf788dd87509386dea8dcd',1,'IntelliRenderSettings']]], + ['isfastrenderering_308',['isFastRenderering',['../class_intelli_render_settings.html#a38fd592c4948d2e47b95bb6fabc34073',1,'IntelliRenderSettings']]], ['isinpolygon_309',['isInPolygon',['../namespace_intelli_triangulation.html#ac276696f29d141ed34614c1c3b1c040f',1,'IntelliTriangulation']]], ['isintriangle_310',['isInTriangle',['../namespace_intelli_triangulation.html#ac150fee67fd41a451bd2592f10e00197',1,'IntelliTriangulation']]] ]; diff --git a/docs/html/tst__unittest_8cpp_source.html b/docs/html/tst__unittest_8cpp_source.html index 6e615ba..a62ab0f 100644 --- a/docs/html/tst__unittest_8cpp_source.html +++ b/docs/html/tst__unittest_8cpp_source.html @@ -535,9 +535,9 @@ $(document).ready(function(){initNavTree('tst__unittest_8cpp_source.html',''); i
    449  area->layerBundle[0].image->drawPlain(QColor(255, 255, 255, 255));
    450  QImage img = area->layerBundle[0].image->getDisplayable(QSize(200,200),255);
    451  QPoint point;
    -
    452  for(size_t i=0; i<200; i++) {
    +
    452  for(size_t i = 0; i<200; i++) {
    453  point.setX(static_cast<int>(i));
    -
    454  for(size_t j=0; j<200; j++) {
    +
    454  for(size_t j = 0; j<200; j++) {
    455  point.setY(static_cast<int>(j));
    456  QVERIFY(img.pixelColor(point) == QColor(255,255,255,255));
    457  }
    @@ -773,8 +773,8 @@ $(document).ready(function(){initNavTree('tst__unittest_8cpp_source.html',''); i
    687  area->Tool->onMouseLeftReleased(point2.x(), point2.y());
    688 
    689 
    -
    690  QVERIFY(area->layerBundle[0].image->getPixelColor(point1)==area->colorPicker.getSecondColor());
    -
    691  QVERIFY(area->layerBundle[0].image->getPixelColor(point2)==area->colorPicker.getFirstColor());
    +
    690  QVERIFY(area->layerBundle[0].image->getPixelColor(point1)==area->colorPicker.getSecondColor());
    +
    691  QVERIFY(area->layerBundle[0].image->getPixelColor(point2)==area->colorPicker.getFirstColor());
    692 
    693  area->deleteLayer(0);
    694 }
    @@ -817,8 +817,8 @@ $(document).ready(function(){initNavTree('tst__unittest_8cpp_source.html',''); i
    731  area->Tool->onMouseLeftReleased(point2.x(), point2.y());
    732 
    733 
    -
    734  QVERIFY(area->layerBundle[0].image->getPixelColor(point1)==area->colorPicker.getFirstColor());
    -
    735  QVERIFY(area->layerBundle[0].image->getPixelColor(point2)==area->colorPicker.getFirstColor());
    +
    734  QVERIFY(area->layerBundle[0].image->getPixelColor(point1)==area->colorPicker.getFirstColor());
    +
    735  QVERIFY(area->layerBundle[0].image->getPixelColor(point2)==area->colorPicker.getFirstColor());
    736 
    737  area->deleteLayer(0);
    738 }
    @@ -860,8 +860,8 @@ $(document).ready(function(){initNavTree('tst__unittest_8cpp_source.html',''); i
    774  area->Tool->onMouseLeftReleased(point2.x(), point2.y());
    775 
    776 
    -
    777  QVERIFY(area->layerBundle[0].image->getPixelColor(point1)==area->colorPicker.getFirstColor());
    -
    778  QVERIFY(area->layerBundle[0].image->getPixelColor(point2)==area->colorPicker.getFirstColor());
    +
    777  QVERIFY(area->layerBundle[0].image->getPixelColor(point1)==area->colorPicker.getFirstColor());
    +
    778  QVERIFY(area->layerBundle[0].image->getPixelColor(point2)==area->colorPicker.getFirstColor());
    779 
    780  area->deleteLayer(0);
    781 }
    @@ -902,8 +902,8 @@ $(document).ready(function(){initNavTree('tst__unittest_8cpp_source.html',''); i
    816  area->Tool->onMouseLeftReleased(point2.x(), point2.y());
    817 
    818 
    -
    819  QVERIFY(area->layerBundle[0].image->getPixelColor(point1)==area->colorPicker.getFirstColor());
    -
    820  QVERIFY(area->layerBundle[0].image->getPixelColor(point2)==area->colorPicker.getFirstColor());
    +
    819  QVERIFY(area->layerBundle[0].image->getPixelColor(point1)==area->colorPicker.getFirstColor());
    +
    820  QVERIFY(area->layerBundle[0].image->getPixelColor(point2)==area->colorPicker.getFirstColor());
    821 
    822  area->deleteLayer(0);
    823 }
    @@ -944,8 +944,8 @@ $(document).ready(function(){initNavTree('tst__unittest_8cpp_source.html',''); i
    858  area->Tool->onMouseLeftReleased(point2.x(), point2.y());
    859 
    860 
    -
    861  QVERIFY(area->layerBundle[0].image->getPixelColor(point1)==area->colorPicker.getFirstColor());
    -
    862  QVERIFY(area->layerBundle[0].image->getPixelColor(point2)==area->colorPicker.getFirstColor());
    +
    861  QVERIFY(area->layerBundle[0].image->getPixelColor(point1)==area->colorPicker.getFirstColor());
    +
    862  QVERIFY(area->layerBundle[0].image->getPixelColor(point2)==area->colorPicker.getFirstColor());
    863 
    864  area->deleteLayer(0);
    865 }
    @@ -1013,13 +1013,13 @@ $(document).ready(function(){initNavTree('tst__unittest_8cpp_source.html',''); i
    927  area->Tool->onMouseLeftPressed(points[0].x(), points[0].y());
    928  area->Tool->onMouseLeftReleased(points[0].x(), points[0].y());
    929 
    -
    930  QVERIFY(area->layerBundle[0].image->getPixelColor(points[0])==area->colorPicker.getFirstColor());
    -
    931  QVERIFY(area->layerBundle[0].image->getPixelColor(points[1])==area->colorPicker.getFirstColor());
    -
    932  QVERIFY(area->layerBundle[0].image->getPixelColor(points[2])==area->colorPicker.getFirstColor());
    -
    933  QVERIFY(area->layerBundle[0].image->getPixelColor(points[3])==area->colorPicker.getFirstColor());
    +
    930  QVERIFY(area->layerBundle[0].image->getPixelColor(points[0])==area->colorPicker.getFirstColor());
    +
    931  QVERIFY(area->layerBundle[0].image->getPixelColor(points[1])==area->colorPicker.getFirstColor());
    +
    932  QVERIFY(area->layerBundle[0].image->getPixelColor(points[2])==area->colorPicker.getFirstColor());
    +
    933  QVERIFY(area->layerBundle[0].image->getPixelColor(points[3])==area->colorPicker.getFirstColor());
    934 
    935 
    -
    936  QVERIFY(area->layerBundle[0].image->getPixelColor(test[4])==area->colorPicker.getSecondColor());
    +
    936  QVERIFY(area->layerBundle[0].image->getPixelColor(test[4])==area->colorPicker.getSecondColor());
    937  QVERIFY(area->layerBundle[0].image->getPixelColor(test[0])==QColor(255,0,0,255));
    938  QVERIFY(area->layerBundle[0].image->getPixelColor(test[1])==QColor(255,0,0,255));
    939  QVERIFY(area->layerBundle[0].image->getPixelColor(test[2])==QColor(255,0,0,255));
    @@ -1100,9 +1100,9 @@ $(document).ready(function(){initNavTree('tst__unittest_8cpp_source.html',''); i
    1014  area->Tool->onMouseLeftReleased(point2.x(), point2.y());
    1015 
    1016 
    -
    1017  QVERIFY(area->layerBundle[0].image->getPixelColor(point1)==area->colorPicker.getFirstColor());
    -
    1018  QVERIFY(area->layerBundle[0].image->getPixelColor(point2)==area->colorPicker.getFirstColor());
    -
    1019  QVERIFY(area->layerBundle[0].image->getPixelColor(point3)==area->colorPicker.getSecondColor());
    +
    1017  QVERIFY(area->layerBundle[0].image->getPixelColor(point1)==area->colorPicker.getFirstColor());
    +
    1018  QVERIFY(area->layerBundle[0].image->getPixelColor(point2)==area->colorPicker.getFirstColor());
    +
    1019  QVERIFY(area->layerBundle[0].image->getPixelColor(point3)==area->colorPicker.getSecondColor());
    1020 
    1021  area->deleteLayer(0);
    1022 }
    @@ -1766,9 +1766,9 @@ $(document).ready(function(){initNavTree('tst__unittest_8cpp_source.html',''); i
    1681  QBENCHMARK{
    1682  std::vector<Triangle> tria = IntelliTriangulation::calculateTriangles(points);
    1683  QPoint point;
    -
    1684  for(int i=0; i<200; i++) {
    +
    1684  for(int i = 0; i<200; i++) {
    1685  point.setX(i);
    -
    1686  for(int j=0; j<200; j++) {
    +
    1686  for(int j = 0; j<200; j++) {
    1687  point.setY(j);
    1688  IntelliTriangulation::isInPolygon(tria, point);
    1689  }
    @@ -1784,6 +1784,7 @@ $(document).ready(function(){initNavTree('tst__unittest_8cpp_source.html',''); i
    void createCircleTool()
    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:18
    +
    QColor getFirstColor() const
    A function to read the primary selected color.
    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:36
    void createRectangleTool()
    @@ -1799,10 +1800,9 @@ $(document).ready(function(){initNavTree('tst__unittest_8cpp_source.html',''); i
    void deleteLayer(int idx, bool isTool=false)
    The deleteLayer method removes a layer at a given idx.
    The IntelliPhotoGui base class handles the graphical user interface and events for the intelliPhoto p...
    -
    void setSecondColor(QColor Color)
    A function to set the secondary color.
    +
    void setSecondColor(QColor Color)
    A function to set the secondary color.
    The IntelliToolPlainTool class represents a tool to fill the whole canvas with one color.
    The IntelliShapedImage manages a Shapedimage.
    -
    QColor getSecondColor()
    A function to read the secondary selected color.
    void createPlainTool()
    @@ -1810,6 +1810,7 @@ $(document).ready(function(){initNavTree('tst__unittest_8cpp_source.html',''); i
    void createPenTool()
    +
    QColor getSecondColor() const
    A function to read the secondary selected color.
    The IntelliToolRectangle class represents a tool to draw a rectangle.
    void createLineTool()
    @@ -1818,13 +1819,12 @@ $(document).ready(function(){initNavTree('tst__unittest_8cpp_source.html',''); i -
    void setFirstColor(QColor Color)
    A function to set the primary color.
    +
    void setFirstColor(QColor Color)
    A function to set the primary color.
    void createPolygonTool()
    void moveActiveLayer(int idx)
    The moveActiveLayer moves the active layer to a specific position in the layer stack.
    IntelliColorPicker colorPicker
    Definition: PaintingArea.h:202
    -
    QColor getFirstColor()
    A function to read the primary selected color.
    void createFloodFillTool()
    diff --git a/src/GUI/IntelliPhotoGui.cpp b/src/GUI/IntelliPhotoGui.cpp index 3af696b..5237ee0 100644 --- a/src/GUI/IntelliPhotoGui.cpp +++ b/src/GUI/IntelliPhotoGui.cpp @@ -14,8 +14,8 @@ IntelliPhotoGui::IntelliPhotoGui(){ // set style of the gui setIntelliStyle(); // Size the app - resize(600,600); - showMaximized(); + resize(600,600); + showMaximized(); setDefaultToolValue(); } @@ -73,9 +73,9 @@ void IntelliPhotoGui::slotCreateNewRasterLayer(){ // "New Layer" is the title of the window // the next tr is the text to display // Define the standard Value, min, max, step and ok button - int width = IntelliInputDialog::getInt("New Raster Layer", "Width:", 200, 1, paintingArea->getMaxWidth(), 1, &ok1); + int width = IntelliInputDialog::getInt("New Raster Layer", "Width:", 200, 1, paintingArea->getMaxWidth(), 1, &ok1); - int height = IntelliInputDialog::getInt("New Raster Layer", "Height:", 200, 1, paintingArea->getMaxHeight(), 1, &ok2); + int height = IntelliInputDialog::getInt("New Raster Layer", "Height:", 200, 1, paintingArea->getMaxHeight(), 1, &ok2); // Create New Layer if (ok1&&ok2) { @@ -92,9 +92,9 @@ void IntelliPhotoGui::slotCreateNewShapedLayer(){ // "New Layer" is the title of the window // the next tr is the text to display // Define the standard Value, min, max, step and ok button - int width = IntelliInputDialog::getInt("New Shaped Layer", "Width:", 200, 1, paintingArea->getMaxWidth(), 1, &ok1); + int width = IntelliInputDialog::getInt("New Shaped Layer", "Width:", 200, 1, paintingArea->getMaxWidth(), 1, &ok1); - int height = IntelliInputDialog::getInt("New Shaped Layer", "Height:", 200, 1, paintingArea->getMaxHeight(), 1, &ok2); + int height = IntelliInputDialog::getInt("New Shaped Layer", "Height:", 200, 1, paintingArea->getMaxHeight(), 1, &ok2); // Create New Layer if (ok1&&ok2) { @@ -105,21 +105,21 @@ void IntelliPhotoGui::slotCreateNewShapedLayer(){ // Opens a dialog that allows the user to change Dimension void IntelliPhotoGui::slotChangeDim(){ - // Stores button value - bool ok1, ok2; + // Stores button value + bool ok1, ok2; - // "change Dimension" is the title of the window - // the next tr is the text to display - // Define the standard Value, min, step and ok button - int width = IntelliInputDialog::getInt("New Canvas Size", "Width:", 600, 1, 50000 , 1, &ok1); + // "change Dimension" is the title of the window + // the next tr is the text to display + // Define the standard Value, min, step and ok button + int width = IntelliInputDialog::getInt("New Canvas Size", "Width:", 600, 1, 50000, 1, &ok1); - int height = IntelliInputDialog::getInt("New Canvas Size", "Height:", 600, 1, 50000, 1, &ok2); + int height = IntelliInputDialog::getInt("New Canvas Size", "Height:", 600, 1, 50000, 1, &ok2); - // Change dimension - if (ok1&&ok2) { - paintingArea->setLayerDimensions(width,height); - UpdateGui(); - } + // Change dimension + if (ok1&&ok2) { + paintingArea->setLayerDimensions(width,height); + UpdateGui(); + } } // Opens a dialog that allows the user to delete a Layer @@ -317,7 +317,7 @@ void IntelliPhotoGui::slotSetWidth(){ void IntelliPhotoGui::slotSetInnerAlpha(){ bool ok1; - int temp = IntelliInputDialog::getInt("Toolsettings", "Alpha:", 5, 1, 50, 1, &ok1); + int temp = IntelliInputDialog::getInt("Toolsettings", "Alpha:", 5, 1, 50, 1, &ok1); if(ok1) { paintingArea->Toolsettings.setInnerAlpha(temp); EditLineInnerAlpha->setText(QString("%1").arg(temp)); @@ -378,10 +378,10 @@ void IntelliPhotoGui::createActions(){ actionDeleteLayer->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_D)); connect(actionDeleteLayer, SIGNAL(triggered()), this, SLOT(slotDeleteLayer())); - actionChangeDim = new QAction(tr("&Change Dimension"), this); - actionChangeDim->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_X)); - connect(actionChangeDim, SIGNAL(triggered()), this, SLOT(slotChangeDim())); - connect(dimCanvas, SIGNAL(clicked()), this, SLOT(slotChangeDim())); + actionChangeDim = new QAction(tr("&Change Dimension"), this); + actionChangeDim->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_X)); + connect(actionChangeDim, SIGNAL(triggered()), this, SLOT(slotChangeDim())); + connect(dimCanvas, SIGNAL(clicked()), this, SLOT(slotChangeDim())); actionSetActiveLayer = new QAction(tr("&set Active"), this); actionSetActiveLayer->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_A)); @@ -539,9 +539,9 @@ void IntelliPhotoGui::createMenus(){ fileMenu->addAction(actionExit); //Attach all actions to Render Settings - renderMenu = new QMenu(tr("&Fast Renderer"), this); - renderMenu->addAction(actionUpdateRenderSettingsOn); - renderMenu->addAction(actionUpdateRenderSettingsOff); + renderMenu = new QMenu(tr("&Fast Renderer"), this); + renderMenu->addAction(actionUpdateRenderSettingsOn); + renderMenu->addAction(actionUpdateRenderSettingsOff); //Attach all Layer Creations to Menu layerCreationMenu = new QMenu(tr("&Create new Layer"), this); @@ -598,7 +598,7 @@ void IntelliPhotoGui::createMenus(){ optionMenu->addMenu(toolMenu); optionMenu->addSeparator(); optionMenu->addMenu(renderMenu); - optionMenu->addAction(actionChangeDim); + optionMenu->addAction(actionChangeDim); // Attach all actions to Help helpMenu = new QMenu(tr("&Help"), this); @@ -621,8 +621,8 @@ void IntelliPhotoGui::createGui(){ centralGuiWidget->setLayout(mainLayout); // create Gui elements - // get and set max width and height - paintingArea = new PaintingArea(1280, 720); + // get and set max width and height + paintingArea = new PaintingArea(1280, 720); paintingArea->DummyGui = this; preview = QPixmap(":/Icons/Buttons/icons/circle-tool.svg"); @@ -728,14 +728,14 @@ void IntelliPhotoGui::createGui(){ ActiveLayerImageLabel->setFixedSize(Buttonsize * 2); ActiveLayerImageLabel->setPixmap(preview.scaled(Buttonsize * 2)); - dimActive = new QPushButton(); - dimActive->setFixedSize(Buttonsize.width()*2,Buttonsize.height()/2); - dimActive->setText("0x0"); + dimActive = new QPushButton(); + dimActive->setFixedSize(Buttonsize.width() * 2,Buttonsize.height() / 2); + dimActive->setText("0x0"); - dimCanvas = new QPushButton(); - dimCanvas->setFixedSize(Buttonsize.width()*2,Buttonsize.height()/2); - QString String = QString("%1x%2").arg(paintingArea->Canvas->width()).arg(paintingArea->Canvas->height()); - dimCanvas->setText(String); + dimCanvas = new QPushButton(); + dimCanvas->setFixedSize(Buttonsize.width() * 2,Buttonsize.height() / 2); + QString String = QString("%1x%2").arg(paintingArea->Canvas->width()).arg(paintingArea->Canvas->height()); + dimCanvas->setText(String); // set gui elements mainLayout->addWidget(paintingArea,1,1,20,1); @@ -755,8 +755,8 @@ void IntelliPhotoGui::createGui(){ mainLayout->addWidget(SwitchColorButton,10,2,1,2); mainLayout->addWidget(ActiveLayerLine,11,2,1,2); mainLayout->addWidget(ActiveLayerImageLabel,12,2,1,2); - mainLayout->addWidget(dimActive,13,2,1,2); - mainLayout->addWidget(dimCanvas,14,2,1,2); + mainLayout->addWidget(dimActive,13,2,1,2); + mainLayout->addWidget(dimCanvas,14,2,1,2); mainLayout->setHorizontalSpacing(0); } @@ -852,14 +852,14 @@ void IntelliPhotoGui::UpdateGui(){ string = QString("background-color: %1").arg(paintingArea->colorPicker.getSecondColor().name()); SecondColorButton->setStyleSheet(string); - string = QString("%1x%2").arg(paintingArea->Canvas->width()).arg(paintingArea->Canvas->height()); - dimCanvas->setText(string); + string = QString("%1x%2").arg(paintingArea->Canvas->width()).arg(paintingArea->Canvas->height()); + dimCanvas->setText(string); - if(paintingArea->layerBundle.size() != 0){ - string = QString("%1x%2").arg(paintingArea->layerBundle[static_cast(paintingArea->getNumberOfActiveLayer())].width).arg(paintingArea->layerBundle[static_cast(paintingArea->getNumberOfActiveLayer())].height); - dimActive->setText(string); - } - else{ - dimActive->setText("0x0"); - } + if(paintingArea->layerBundle.size() != 0) { + string = QString("%1x%2").arg(paintingArea->layerBundle[static_cast(paintingArea->getNumberOfActiveLayer())].width).arg(paintingArea->layerBundle[static_cast(paintingArea->getNumberOfActiveLayer())].height); + dimActive->setText(string); + } + else{ + dimActive->setText("0x0"); + } } diff --git a/src/Image/IntelliImage.h b/src/Image/IntelliImage.h index 46f9d9b..5c19186 100644 --- a/src/Image/IntelliImage.h +++ b/src/Image/IntelliImage.h @@ -20,7 +20,7 @@ class IntelliTool; * \brief An abstract class which manages the basic IntelliImage operations. */ class IntelliImage { - friend UnitTest; +friend UnitTest; friend IntelliTool; public: diff --git a/src/Image/IntelliRasterImage.h b/src/Image/IntelliRasterImage.h index eecc67c..a67472a 100644 --- a/src/Image/IntelliRasterImage.h +++ b/src/Image/IntelliRasterImage.h @@ -10,7 +10,7 @@ class UnitTest; * \brief The IntelliRasterImage manages a RASTERIMAGE. */ class IntelliRasterImage : public IntelliImage { - friend UnitTest; +friend UnitTest; friend IntelliTool; protected: /*! diff --git a/src/Image/IntelliShapedImage.h b/src/Image/IntelliShapedImage.h index 001ce02..32c4c9f 100644 --- a/src/Image/IntelliShapedImage.h +++ b/src/Image/IntelliShapedImage.h @@ -11,7 +11,7 @@ class UnitTest; * \brief The IntelliShapedImage manages a Shapedimage. */ class IntelliShapedImage : public IntelliRasterImage { - friend UnitTest; +friend UnitTest; friend IntelliTool; private: /*! diff --git a/src/IntelliHelper/IntelliColorPicker.cpp b/src/IntelliHelper/IntelliColorPicker.cpp index 0c36820..3cf60db 100644 --- a/src/IntelliHelper/IntelliColorPicker.cpp +++ b/src/IntelliHelper/IntelliColorPicker.cpp @@ -1,7 +1,7 @@ #include "IntelliColorPicker.h" IntelliColorPicker::IntelliColorPicker(){ - initializeColors(); + initializeColors(); } IntelliColorPicker::~IntelliColorPicker(){ @@ -12,11 +12,11 @@ void IntelliColorPicker::swapColors(){ std::swap(firstColor, secondColor); } -QColor IntelliColorPicker::getFirstColor() const{ +QColor IntelliColorPicker::getFirstColor() const { return this->firstColor; } -QColor IntelliColorPicker::getSecondColor() const{ +QColor IntelliColorPicker::getSecondColor() const { return this->secondColor; } @@ -29,6 +29,6 @@ void IntelliColorPicker::setSecondColor(QColor Color){ } void IntelliColorPicker::initializeColors(){ - this->firstColor = QColor(255,0,0,255); - this->secondColor = QColor(0,0,0,255); + this->firstColor = QColor(255,0,0,255); + this->secondColor = QColor(0,0,0,255); } diff --git a/src/IntelliHelper/IntelliColorPicker.h b/src/IntelliHelper/IntelliColorPicker.h index 8c97289..06bd89f 100644 --- a/src/IntelliHelper/IntelliColorPicker.h +++ b/src/IntelliHelper/IntelliColorPicker.h @@ -12,7 +12,7 @@ class UnitTest; * \brief The IntelliColorPicker manages the selected colors for one whole project. */ class IntelliColorPicker { - friend UnitTest; +friend UnitTest; public: /*! * \brief IntelliColorPicker constructor, setting 2 preset colors, be careful, theese color may change in production. diff --git a/src/IntelliHelper/IntelliRenderSettings.cpp b/src/IntelliHelper/IntelliRenderSettings.cpp index 75ef1de..88c3163 100644 --- a/src/IntelliHelper/IntelliRenderSettings.cpp +++ b/src/IntelliHelper/IntelliRenderSettings.cpp @@ -9,6 +9,6 @@ void IntelliRenderSettings::setFastRendering(bool Updatedsetting){ this->fastRenderering = Updatedsetting; } -bool IntelliRenderSettings::isFastRenderering() const{ +bool IntelliRenderSettings::isFastRenderering() const { return fastRenderering; } diff --git a/src/IntelliHelper/IntelliRenderSettings.h b/src/IntelliHelper/IntelliRenderSettings.h index e04dcfb..296c186 100644 --- a/src/IntelliHelper/IntelliRenderSettings.h +++ b/src/IntelliHelper/IntelliRenderSettings.h @@ -7,7 +7,7 @@ class UnitTest; class IntelliRenderSettings { - friend UnitTest; +friend UnitTest; public: IntelliRenderSettings(); diff --git a/src/IntelliHelper/IntelliToolsettings.cpp b/src/IntelliHelper/IntelliToolsettings.cpp index 33566a6..528e3e0 100644 --- a/src/IntelliHelper/IntelliToolsettings.cpp +++ b/src/IntelliHelper/IntelliToolsettings.cpp @@ -11,7 +11,7 @@ IntelliToolsettings::~IntelliToolsettings(){ } -int IntelliToolsettings::getLineWidth() const{ +int IntelliToolsettings::getLineWidth() const { return lineWidth; } @@ -25,7 +25,7 @@ void IntelliToolsettings::setLineWidth(int LineWidth){ lineWidth = LineWidth; } -int IntelliToolsettings::getInnerAlpha() const{ +int IntelliToolsettings::getInnerAlpha() const { return this->innerAlpha; } diff --git a/src/Layer/PaintingArea.cpp b/src/Layer/PaintingArea.cpp index 3dfb526..0bf6a0e 100644 --- a/src/Layer/PaintingArea.cpp +++ b/src/Layer/PaintingArea.cpp @@ -332,15 +332,15 @@ void PaintingArea::paintEvent(QPaintEvent*event){ void PaintingArea::selectLayerUp(){ updateTools(); - if(activeLayer != -1 && static_cast(activeLayer)(activeLayer)], layerBundle[static_cast(activeLayer + 1)]); + if(activeLayer != -1 && static_cast(activeLayer)(activeLayer)], layerBundle[static_cast(activeLayer + 1)]); activeLayer++; } } void PaintingArea::selectLayerDown(){ updateTools(); - if(activeLayer>0) { + if(activeLayer>0) { std::swap(layerBundle[static_cast(activeLayer)], layerBundle[static_cast(activeLayer - 1)]); activeLayer--; } diff --git a/src/Layer/PaintingArea.h b/src/Layer/PaintingArea.h index 3b04198..58eb411 100644 --- a/src/Layer/PaintingArea.h +++ b/src/Layer/PaintingArea.h @@ -21,29 +21,29 @@ class UnitTest; * \brief The LayerObject struct holds all the information needed to construct a layer */ struct LayerObject { - /*! - * \brief image - Stores the imageData of the current LayerObject. - */ + /*! + * \brief image - Stores the imageData of the current LayerObject. + */ IntelliImage* image; - /*! - * \brief width - Stores the width of a layer in pixels. - */ + /*! + * \brief width - Stores the width of a layer in pixels. + */ int width; - /*! - * \brief height - Stores the height of a layer in pixels. - */ + /*! + * \brief height - Stores the height of a layer in pixels. + */ int height; - /*! - * \brief widthOffset - Stores the number of pixles from the left side of the painting area. - */ + /*! + * \brief widthOffset - Stores the number of pixles from the left side of the painting area. + */ int widthOffset; - /*! - * \brief heightOffset - Stores the number of pixles from the top of the painting area. - */ + /*! + * \brief heightOffset - Stores the number of pixles from the top of the painting area. + */ int heightOffset; - /*! - * \brief alpha - Stores the alpha value of the layer (default=255). - */ + /*! + * \brief alpha - Stores the alpha value of the layer (default=255). + */ int alpha = 255; }; diff --git a/src/Tool/IntelliTool.cpp b/src/Tool/IntelliTool.cpp index c758eab..11ed60b 100644 --- a/src/Tool/IntelliTool.cpp +++ b/src/Tool/IntelliTool.cpp @@ -6,9 +6,9 @@ IntelliTool::IntelliTool(PaintingArea* Area, IntelliColorPicker* colorPicker, In this->colorPicker = colorPicker; this->Toolsettings = Toolsettings; this->isDrawing = false; - this->ActiveType = Tooltype::NONE; - this->activeLayer = nullptr; - this->Canvas = nullptr; + this->ActiveType = Tooltype::NONE; + this->activeLayer = nullptr; + this->Canvas = nullptr; } IntelliTool::~IntelliTool(){ @@ -17,7 +17,7 @@ IntelliTool::~IntelliTool(){ void IntelliTool::onMouseRightPressed(int x, int y){ if(isDrawing) { - isDrawing = false; + isDrawing = false; this->deleteToolLayer(); } } @@ -96,10 +96,10 @@ void IntelliTool::deleteToolLayer(){ this->Canvas = nullptr; } -IntelliTool::Tooltype IntelliTool::getTooltype() const{ +IntelliTool::Tooltype IntelliTool::getTooltype() const { return ActiveType; } -bool IntelliTool::getIsDrawing() const{ +bool IntelliTool::getIsDrawing() const { return isDrawing; } diff --git a/src/Tool/IntelliTool.h b/src/Tool/IntelliTool.h index 75783b6..40901f0 100644 --- a/src/Tool/IntelliTool.h +++ b/src/Tool/IntelliTool.h @@ -15,7 +15,7 @@ class PaintingArea; * \brief An abstract class that manages the basic events, like mouse clicks or scrolls events. */ class IntelliTool { - friend UnitTest; +friend UnitTest; public: enum class Tooltype { CIRCLE, @@ -24,8 +24,8 @@ enum class Tooltype { PEN, PLAIN, POLYGON, - RECTANGLE, - NONE + RECTANGLE, + NONE }; private: /*! diff --git a/src/Tool/IntelliToolCircle.cpp b/src/Tool/IntelliToolCircle.cpp index 5bf2ef9..17131bf 100644 --- a/src/Tool/IntelliToolCircle.cpp +++ b/src/Tool/IntelliToolCircle.cpp @@ -15,30 +15,30 @@ IntelliToolCircle::~IntelliToolCircle(){ void IntelliToolCircle::drawCircle(int radius){ QColor inner = this->colorPicker->getSecondColor(); inner.setAlpha(Toolsettings->getInnerAlpha()); - int yMinimum, yMaximum, xMinimum, xMaximum; - yMinimum = centerPoint.y() - radius; - yMaximum = centerPoint.y() + radius; + int yMinimum, yMaximum, xMinimum, xMaximum; + yMinimum = centerPoint.y() - radius; + yMaximum = centerPoint.y() + radius; // x = x0+-sqrt(r2-(y-y0)2) - for(int i = yMinimum; i<=yMaximum; i++) { - xMinimum = static_cast(centerPoint.x() - sqrt(pow(radius,2) - pow(i - centerPoint.y(),2))); - xMaximum = static_cast(centerPoint.x() + sqrt(pow(radius,2) - pow(i - centerPoint.y(),2))); - this->Canvas->image->drawLine(QPoint(xMinimum,i), QPoint(xMaximum,i),inner,1); + for(int i = yMinimum; i<=yMaximum; i++) { + xMinimum = static_cast(centerPoint.x() - sqrt(pow(radius,2) - pow(i - centerPoint.y(),2))); + xMaximum = static_cast(centerPoint.x() + sqrt(pow(radius,2) - pow(i - centerPoint.y(),2))); + this->Canvas->image->drawLine(QPoint(xMinimum,i), QPoint(xMaximum,i),inner,1); } //TODO implement circle drawing algorithm bresenham radius = static_cast(radius + (Toolsettings->getLineWidth() / 2.)); - yMinimum = (centerPoint.y() - radius); - yMaximum = (centerPoint.y() + radius); - for(int i = yMinimum; i<=yMaximum; i++) { - xMinimum = static_cast(centerPoint.x() - sqrt(pow(radius,2) - pow(i - centerPoint.y(),2))); - xMaximum = static_cast(centerPoint.x() + sqrt(pow(radius,2) - pow(i - centerPoint.y(),2))); - this->Canvas->image->drawPoint(QPoint(xMinimum,i), colorPicker->getFirstColor(),Toolsettings->getLineWidth()); - this->Canvas->image->drawPoint(QPoint(xMaximum,i), colorPicker->getFirstColor(),Toolsettings->getLineWidth()); + yMinimum = (centerPoint.y() - radius); + yMaximum = (centerPoint.y() + radius); + for(int i = yMinimum; i<=yMaximum; i++) { + xMinimum = static_cast(centerPoint.x() - sqrt(pow(radius,2) - pow(i - centerPoint.y(),2))); + xMaximum = static_cast(centerPoint.x() + sqrt(pow(radius,2) - pow(i - centerPoint.y(),2))); + this->Canvas->image->drawPoint(QPoint(xMinimum,i), colorPicker->getFirstColor(),Toolsettings->getLineWidth()); + this->Canvas->image->drawPoint(QPoint(xMaximum,i), colorPicker->getFirstColor(),Toolsettings->getLineWidth()); } - xMinimum = (centerPoint.x() - radius); - xMaximum = (centerPoint.x() + radius); - for(int i = xMinimum; i<=xMaximum; i++) { + xMinimum = (centerPoint.x() - radius); + xMaximum = (centerPoint.x() + radius); + for(int i = xMinimum; i<=xMaximum; i++) { int yMin = static_cast(centerPoint.y() - sqrt(pow(radius,2) - pow(i - centerPoint.x(),2))); int yMax = static_cast(centerPoint.y() + sqrt(pow(radius,2) - pow(i - centerPoint.x(),2))); this->Canvas->image->drawPoint(QPoint(i, yMin), colorPicker->getFirstColor(),Toolsettings->getLineWidth()); diff --git a/src/Tool/IntelliToolCircle.h b/src/Tool/IntelliToolCircle.h index e33ac45..d9c0b82 100644 --- a/src/Tool/IntelliToolCircle.h +++ b/src/Tool/IntelliToolCircle.h @@ -12,7 +12,7 @@ class UnitTest; * \brief The IntelliToolCircle class represents a tool to draw a circle. */ class IntelliToolCircle : public IntelliTool { - friend UnitTest; +friend UnitTest; /*! * \brief A function that implements a circle drawing algorithm. * \param radius - The radius of the circle. diff --git a/src/Tool/IntelliToolFloodFill.h b/src/Tool/IntelliToolFloodFill.h index b1d29f6..0c4ae1d 100644 --- a/src/Tool/IntelliToolFloodFill.h +++ b/src/Tool/IntelliToolFloodFill.h @@ -12,7 +12,7 @@ class UnitTest; * \brief The IntelliToolFloodFill class represents a tool to flood FIll a certian area. */ class IntelliToolFloodFill : public IntelliTool { - friend UnitTest; +friend UnitTest; public: /*! * \brief A constructor setting the general paintingArea and colorPicker. diff --git a/src/Tool/IntelliToolLine.h b/src/Tool/IntelliToolLine.h index 1a4c8aa..a644192 100644 --- a/src/Tool/IntelliToolLine.h +++ b/src/Tool/IntelliToolLine.h @@ -11,7 +11,7 @@ class UnitTest; * \brief The IntelliToolFloodFill class represents a tool to draw a line. */ class IntelliToolLine : public IntelliTool { - friend UnitTest; +friend UnitTest; /*! * \brief The starting point of the line. */ diff --git a/src/Tool/IntelliToolPen.h b/src/Tool/IntelliToolPen.h index 851ec74..e7ee043 100644 --- a/src/Tool/IntelliToolPen.h +++ b/src/Tool/IntelliToolPen.h @@ -12,7 +12,7 @@ class UnitTest; * \brief The IntelliToolPen class represents a tool to draw a line. */ class IntelliToolPen : public IntelliTool { - friend UnitTest; +friend UnitTest; /*! * \brief point - Represents the previous point to help drawing a line. */ diff --git a/src/Tool/IntelliToolPlain.h b/src/Tool/IntelliToolPlain.h index 0c97c15..99a3258 100644 --- a/src/Tool/IntelliToolPlain.h +++ b/src/Tool/IntelliToolPlain.h @@ -11,7 +11,7 @@ class UnitTest; * \brief The IntelliToolPlainTool class represents a tool to fill the whole canvas with one color. */ class IntelliToolPlainTool : public IntelliTool { - friend UnitTest; +friend UnitTest; public: /*! * \brief A constructor setting the general paintingArea and colorPicker. diff --git a/src/Tool/IntelliToolPolygon.cpp b/src/Tool/IntelliToolPolygon.cpp index c866424..507ffb7 100644 --- a/src/Tool/IntelliToolPolygon.cpp +++ b/src/Tool/IntelliToolPolygon.cpp @@ -24,7 +24,7 @@ IntelliToolPolygon::~IntelliToolPolygon(){ } void IntelliToolPolygon::onMouseLeftPressed(int x, int y){ - if(!drawingOfPolygon && Area->getTypeOfImageRealLayer() == IntelliImage::ImageType::SHAPEDIMAGE && x > 0 && y > 0 && xgetWidthOfActive() && ygetHeightOfActive()) { + if(!drawingOfPolygon && Area->getTypeOfImageRealLayer() == IntelliImage::ImageType::SHAPEDIMAGE && x > 0 && y > 0 && xgetWidthOfActive() && ygetHeightOfActive()) { if(Area->getPolygonDataOfRealLayer().size()>2) { std::vector Triangles = IntelliTriangulation::calculateTriangles(Area->getPolygonDataOfRealLayer()); QPoint Point(x,y); @@ -53,7 +53,7 @@ void IntelliToolPolygon::onMouseLeftPressed(int x, int y){ this->Canvas->image->calculateVisiblity(); } } - else if(drawingOfPolygon && QPointList.size() > 0 && isNearStart(x,y,QPointList.front())) { + else if(drawingOfPolygon && QPointList.size() > 0 && isNearStart(x,y,QPointList.front())) { if(QPointList.size() > 2) { isPointNearStart = true; this->Canvas->image->drawLine(QPointList.back(), QPointList.front(), colorPicker->getFirstColor(), Toolsettings->getLineWidth()); @@ -81,7 +81,7 @@ void IntelliToolPolygon::onMouseLeftPressed(int x, int y){ } void IntelliToolPolygon::onMouseRightPressed(int x, int y){ - drawingOfPolygon = false; + drawingOfPolygon = false; isInside = false; isPointNearStart = false; QPointList.clear(); @@ -92,7 +92,7 @@ void IntelliToolPolygon::onMouseLeftReleased(int x, int y){ if(isPointNearStart) { isInside = false; isPointNearStart = false; - drawingOfPolygon = false; + drawingOfPolygon = false; if(!isSettingPolygon) { std::vector Triangles = IntelliTriangulation::calculateTriangles(QPointList); QPoint Point; @@ -145,7 +145,7 @@ bool IntelliToolPolygon::isNearStart(int x, int y, QPoint Startpoint){ int StartY = Startpoint.y(); int valueToNear = 5; - float euklid = sqrt(pow(static_cast(StartX-x),2.f)+pow(static_cast(StartY-y),2.f)); + float euklid = sqrt(pow(static_cast(StartX - x),2.f) + pow(static_cast(StartY - y),2.f)); - return static_cast(euklid)(euklid) +#include // add necessary includes here -#include +#include #include "GUI/IntelliPhotoGui.h" class UnitTest : public QObject { - Q_OBJECT +Q_OBJECT private: - IntelliPhotoGui* gui; - PaintingArea* area; - QApplication* app; +IntelliPhotoGui* gui; +PaintingArea* area; +QApplication* app; public: - UnitTest(); - ~UnitTest(); +UnitTest(); +~UnitTest(); private slots: - void initTestCase(); - void cleanupTestCase(); - //void test_case1(); +void initTestCase(); +void cleanupTestCase(); +//void test_case1(); - //test painting area - void test_addLayer(); - void test_deleteLayer(); - void test_setActive(); - void test_setAlpha(); - void test_floodFill(); - void test_moveActive(); - void test_setPolygon(); - void test_setLayerUp(); - void test_setLayerDown(); +//test painting area +void test_addLayer(); +void test_deleteLayer(); +void test_setActive(); +void test_setAlpha(); +void test_floodFill(); +void test_moveActive(); +void test_setPolygon(); +void test_setLayerUp(); +void test_setLayerDown(); - void test_createTools(); +void test_createTools(); - //test Raster-Image operations - void test_RasterImage_drawPixel(); - void test_RasterImage_drawLine(); - void test_RasterImage_drawPoint(); - void test_RasterImage_getDisplayable(); - void test_RasterImage_setPolygon(); - void test_RasterImage_loadImage(); - void test_RasterImage_getPixelColor(); - void test_RasterImage_getImageData(); - void test_RasterImage_setImageData(); +//test Raster-Image operations +void test_RasterImage_drawPixel(); +void test_RasterImage_drawLine(); +void test_RasterImage_drawPoint(); +void test_RasterImage_getDisplayable(); +void test_RasterImage_setPolygon(); +void test_RasterImage_loadImage(); +void test_RasterImage_getPixelColor(); +void test_RasterImage_getImageData(); +void test_RasterImage_setImageData(); - //test Shaped-Image operations - void test_ShapedImage_drawPixel(); - void test_ShapedImage_drawLine(); - void test_ShapedImage_drawPoint(); - void test_ShapedImage_getDisplayable(); - void test_ShapedImage_setPolygon(); - void test_ShapedImage_loadImage(); - void test_ShapedImage_getPixelColor(); - void test_ShapedImage_getImageData(); - void test_ShapedImage_setImageData(); +//test Shaped-Image operations +void test_ShapedImage_drawPixel(); +void test_ShapedImage_drawLine(); +void test_ShapedImage_drawPoint(); +void test_ShapedImage_getDisplayable(); +void test_ShapedImage_setPolygon(); +void test_ShapedImage_loadImage(); +void test_ShapedImage_getPixelColor(); +void test_ShapedImage_getImageData(); +void test_ShapedImage_setImageData(); - //test painting-area tools - void test_createTool_Circle(); - void test_createTool_FloodFill(); - void test_createTool_Line(); - void test_createTool_Pen(); - void test_createTool_Plain(); - void test_createTool_Polygon(); - void test_createTool_Rectangle(); +//test painting-area tools +void test_createTool_Circle(); +void test_createTool_FloodFill(); +void test_createTool_Line(); +void test_createTool_Pen(); +void test_createTool_Plain(); +void test_createTool_Polygon(); +void test_createTool_Rectangle(); - //test tools - void test_Circle_fullDraw(); - void test_Circle_interruptedDraw(); +//test tools +void test_Circle_fullDraw(); +void test_Circle_interruptedDraw(); - void test_FloodFill_fullDraw(); - void test_FloodFill_interruptedDraw(); +void test_FloodFill_fullDraw(); +void test_FloodFill_interruptedDraw(); - void test_Line_fullDraw(); - void test_Line_interruptedDraw(); +void test_Line_fullDraw(); +void test_Line_interruptedDraw(); - void test_Pen_fullDraw(); - void test_Pen_interruptedDraw(); +void test_Pen_fullDraw(); +void test_Pen_interruptedDraw(); - void test_Plain_fullDraw(); - void test_Plain_interruptedDraw(); +void test_Plain_fullDraw(); +void test_Plain_interruptedDraw(); - void test_Polygon_fullDraw(); - void test_Polygon_interruptedDraw(); +void test_Polygon_fullDraw(); +void test_Polygon_interruptedDraw(); - void test_Rectangle_fullDraw(); - void test_Rectangle_interruptedDraw(); +void test_Rectangle_fullDraw(); +void test_Rectangle_interruptedDraw(); - //test Triangulation - void test_Triangulation_Coverage(); +//test Triangulation +void test_Triangulation_Coverage(); }; UnitTest::UnitTest() { - char arg0[] = "programName"; - char arg1[] = "arg1"; - char arg2[] = "arg2"; - char *argv[] = {arg0, arg1, arg2, nullptr}; - int argc = sizeof(argv) / sizeof(char*) - 1; + char arg0[] = "programName"; + char arg1[] = "arg1"; + char arg2[] = "arg2"; + char*argv[] = {arg0, arg1, arg2, nullptr}; + int argc = sizeof(argv) / sizeof(char*) - 1; - app = new QApplication(argc,argv); - gui = new IntelliPhotoGui(); - area = gui->paintingArea; + app = new QApplication(argc,argv); + gui = new IntelliPhotoGui(); + area = gui->paintingArea; } UnitTest::~UnitTest() @@ -117,8 +117,8 @@ void UnitTest::initTestCase() void UnitTest::cleanupTestCase() { - delete gui; - delete app; + delete gui; + delete app; } //void UnitTest::test_case1() @@ -129,73 +129,123 @@ void UnitTest::cleanupTestCase() //} //test painting area -void UnitTest::test_addLayer(){} -void UnitTest::test_deleteLayer(){} -void UnitTest::test_setActive(){} -void UnitTest::test_setAlpha(){} -void UnitTest::test_floodFill(){} -void UnitTest::test_moveActive(){} -void UnitTest::test_setPolygon(){} -void UnitTest::test_setLayerUp(){} -void UnitTest::test_setLayerDown(){} +void UnitTest::test_addLayer(){ +} +void UnitTest::test_deleteLayer(){ +} +void UnitTest::test_setActive(){ +} +void UnitTest::test_setAlpha(){ +} +void UnitTest::test_floodFill(){ +} +void UnitTest::test_moveActive(){ +} +void UnitTest::test_setPolygon(){ +} +void UnitTest::test_setLayerUp(){ +} +void UnitTest::test_setLayerDown(){ +} -void UnitTest::test_createTools(){} +void UnitTest::test_createTools(){ +} //test Raster-Image operations -void UnitTest::test_RasterImage_drawPixel(){} -void UnitTest::test_RasterImage_drawLine(){} -void UnitTest::test_RasterImage_drawPoint(){} -void UnitTest::test_RasterImage_getDisplayable(){} -void UnitTest::test_RasterImage_setPolygon(){} -void UnitTest::test_RasterImage_loadImage(){} -void UnitTest::test_RasterImage_getPixelColor(){} -void UnitTest::test_RasterImage_getImageData(){} -void UnitTest::test_RasterImage_setImageData(){} +void UnitTest::test_RasterImage_drawPixel(){ +} +void UnitTest::test_RasterImage_drawLine(){ +} +void UnitTest::test_RasterImage_drawPoint(){ +} +void UnitTest::test_RasterImage_getDisplayable(){ +} +void UnitTest::test_RasterImage_setPolygon(){ +} +void UnitTest::test_RasterImage_loadImage(){ +} +void UnitTest::test_RasterImage_getPixelColor(){ +} +void UnitTest::test_RasterImage_getImageData(){ +} +void UnitTest::test_RasterImage_setImageData(){ +} //test Shaped-Image operations -void UnitTest::test_ShapedImage_drawPixel(){} -void UnitTest::test_ShapedImage_drawLine(){} -void UnitTest::test_ShapedImage_drawPoint(){} -void UnitTest::test_ShapedImage_getDisplayable(){} -void UnitTest::test_ShapedImage_setPolygon(){} -void UnitTest::test_ShapedImage_loadImage(){} -void UnitTest::test_ShapedImage_getPixelColor(){} -void UnitTest::test_ShapedImage_getImageData(){} -void UnitTest::test_ShapedImage_setImageData(){} +void UnitTest::test_ShapedImage_drawPixel(){ +} +void UnitTest::test_ShapedImage_drawLine(){ +} +void UnitTest::test_ShapedImage_drawPoint(){ +} +void UnitTest::test_ShapedImage_getDisplayable(){ +} +void UnitTest::test_ShapedImage_setPolygon(){ +} +void UnitTest::test_ShapedImage_loadImage(){ +} +void UnitTest::test_ShapedImage_getPixelColor(){ +} +void UnitTest::test_ShapedImage_getImageData(){ +} +void UnitTest::test_ShapedImage_setImageData(){ +} //test painting-area tools -void UnitTest::test_createTool_Circle(){} -void UnitTest::test_createTool_FloodFill(){} -void UnitTest::test_createTool_Line(){} -void UnitTest::test_createTool_Pen(){} -void UnitTest::test_createTool_Plain(){} -void UnitTest::test_createTool_Polygon(){} -void UnitTest::test_createTool_Rectangle(){} +void UnitTest::test_createTool_Circle(){ +} +void UnitTest::test_createTool_FloodFill(){ +} +void UnitTest::test_createTool_Line(){ +} +void UnitTest::test_createTool_Pen(){ +} +void UnitTest::test_createTool_Plain(){ +} +void UnitTest::test_createTool_Polygon(){ +} +void UnitTest::test_createTool_Rectangle(){ +} //test tools -void UnitTest::test_Circle_fullDraw(){} -void UnitTest::test_Circle_interruptedDraw(){} +void UnitTest::test_Circle_fullDraw(){ +} +void UnitTest::test_Circle_interruptedDraw(){ +} -void UnitTest::test_FloodFill_fullDraw(){} -void UnitTest::test_FloodFill_interruptedDraw(){} +void UnitTest::test_FloodFill_fullDraw(){ +} +void UnitTest::test_FloodFill_interruptedDraw(){ +} -void UnitTest::test_Line_fullDraw(){} -void UnitTest::test_Line_interruptedDraw(){} +void UnitTest::test_Line_fullDraw(){ +} +void UnitTest::test_Line_interruptedDraw(){ +} -void UnitTest::test_Pen_fullDraw(){} -void UnitTest::test_Pen_interruptedDraw(){} +void UnitTest::test_Pen_fullDraw(){ +} +void UnitTest::test_Pen_interruptedDraw(){ +} -void UnitTest::test_Plain_fullDraw(){} -void UnitTest::test_Plain_interruptedDraw(){} +void UnitTest::test_Plain_fullDraw(){ +} +void UnitTest::test_Plain_interruptedDraw(){ +} -void UnitTest::test_Polygon_fullDraw(){} -void UnitTest::test_Polygon_interruptedDraw(){} +void UnitTest::test_Polygon_fullDraw(){ +} +void UnitTest::test_Polygon_interruptedDraw(){ +} -void UnitTest::test_Rectangle_fullDraw(){} -void UnitTest::test_Rectangle_interruptedDraw(){} +void UnitTest::test_Rectangle_fullDraw(){ +} +void UnitTest::test_Rectangle_interruptedDraw(){ +} //test Triangulation -void UnitTest::test_Triangulation_Coverage(){} +void UnitTest::test_Triangulation_Coverage(){ +} QTEST_APPLESS_MAIN(UnitTest) diff --git a/src/tst_unittest.cpp b/src/tst_unittest.cpp index dc21b8a..5e9f88c 100644 --- a/src/tst_unittest.cpp +++ b/src/tst_unittest.cpp @@ -282,7 +282,7 @@ void UnitTest::test_moveActive(){ area->addLayer(200,200,10,20,IntelliImage::ImageType::SHAPEDIMAGE); area->addLayer(200,200,10,20,IntelliImage::ImageType::SHAPEDIMAGE); - area->layerBundle[1].image->drawPlain(QColor(0, 0, 0, 255)); + area->layerBundle[1].image->drawPlain(QColor(0, 0, 0, 255)); QPoint point(0,0); area->moveActiveLayer(-1); @@ -449,9 +449,9 @@ void UnitTest::test_RasterImage_getDisplayable(){ area->layerBundle[0].image->drawPlain(QColor(255, 255, 255, 255)); QImage img = area->layerBundle[0].image->getDisplayable(QSize(200,200),255); QPoint point; - for(size_t i=0; i<200; i++) { + for(size_t i = 0; i<200; i++) { point.setX(static_cast(i)); - for(size_t j=0; j<200; j++) { + for(size_t j = 0; j<200; j++) { point.setY(static_cast(j)); QVERIFY(img.pixelColor(point) == QColor(255,255,255,255)); } @@ -1136,20 +1136,20 @@ void UnitTest::bench_moveActive(){ } void UnitTest::bench_setPolygon(){ - area->addLayer(200,200,10,20,IntelliImage::ImageType::SHAPEDIMAGE); + area->addLayer(200,200,10,20,IntelliImage::ImageType::SHAPEDIMAGE); - std::vector polygon{ - QPoint(10,00), - QPoint(00,10), - QPoint(10,10), - QPoint(00,10) - }; + std::vector polygon{ + QPoint(10,00), + QPoint(00,10), + QPoint(10,10), + QPoint(00,10) + }; - QBENCHMARK{ - area->layerBundle[0].image->setPolygon(polygon); - } + QBENCHMARK{ + area->layerBundle[0].image->setPolygon(polygon); + } - area->deleteLayer(0); + area->deleteLayer(0); } void UnitTest::bench_setLayerUp(){ @@ -1561,65 +1561,65 @@ void UnitTest::bench_Plain_interruptedDraw(){ } void UnitTest::bench_Polygon_fullDraw(){ - area->addLayer(21,21,10,20,IntelliImage::ImageType::RASTERIMAGE); - std::vector points{ - QPoint(10,00), - QPoint(00,10), - QPoint(10,20), - QPoint(20,10) - }; + area->addLayer(21,21,10,20,IntelliImage::ImageType::RASTERIMAGE); + std::vector points{ + QPoint(10,00), + QPoint(00,10), + QPoint(10,20), + QPoint(20,10) + }; - area->colorPicker.setFirstColor(QColor(255,255,255,255)); - area->colorPicker.setSecondColor(QColor(0,0,0,255)); - area->createPolygonTool(); - area->layerBundle[0].image->drawPlain(QColor(255, 0, 0, 255)); + area->colorPicker.setFirstColor(QColor(255,255,255,255)); + area->colorPicker.setSecondColor(QColor(0,0,0,255)); + area->createPolygonTool(); + area->layerBundle[0].image->drawPlain(QColor(255, 0, 0, 255)); - QBENCHMARK{ - area->Tool->onMouseLeftPressed(points[0].x(), points[0].y()); - area->Tool->onMouseLeftReleased(points[0].x(), points[0].y()); - area->Tool->onMouseMoved(points[1].x(), points[1].y()); + QBENCHMARK{ + area->Tool->onMouseLeftPressed(points[0].x(), points[0].y()); + area->Tool->onMouseLeftReleased(points[0].x(), points[0].y()); + area->Tool->onMouseMoved(points[1].x(), points[1].y()); - area->Tool->onMouseLeftPressed(points[1].x(), points[1].y()); - area->Tool->onMouseLeftReleased(points[1].x(), points[1].y()); - area->Tool->onMouseMoved(points[2].x(), points[2].y()); + area->Tool->onMouseLeftPressed(points[1].x(), points[1].y()); + area->Tool->onMouseLeftReleased(points[1].x(), points[1].y()); + area->Tool->onMouseMoved(points[2].x(), points[2].y()); - area->Tool->onMouseLeftPressed(points[2].x(), points[2].y()); - area->Tool->onMouseLeftReleased(points[2].x(), points[2].y()); - area->Tool->onMouseMoved(points[3].x(), points[3].y()); + area->Tool->onMouseLeftPressed(points[2].x(), points[2].y()); + area->Tool->onMouseLeftReleased(points[2].x(), points[2].y()); + area->Tool->onMouseMoved(points[3].x(), points[3].y()); - area->Tool->onMouseLeftPressed(points[3].x(), points[3].y()); - area->Tool->onMouseLeftReleased(points[3].x(), points[3].y()); - area->Tool->onMouseMoved(points[0].x(), points[0].y()); + area->Tool->onMouseLeftPressed(points[3].x(), points[3].y()); + area->Tool->onMouseLeftReleased(points[3].x(), points[3].y()); + area->Tool->onMouseMoved(points[0].x(), points[0].y()); - area->Tool->onMouseLeftPressed(points[0].x(), points[0].y()); - area->Tool->onMouseLeftReleased(points[0].x(), points[0].y()); - } + area->Tool->onMouseLeftPressed(points[0].x(), points[0].y()); + area->Tool->onMouseLeftReleased(points[0].x(), points[0].y()); + } - area->deleteLayer(0); + area->deleteLayer(0); } void UnitTest::bench_Polygon_interruptedDraw(){ - area->addLayer(201,201,10,20,IntelliImage::ImageType::RASTERIMAGE); - std::vector points{ - QPoint(100,000) - }; + area->addLayer(201,201,10,20,IntelliImage::ImageType::RASTERIMAGE); + std::vector points{ + QPoint(100,000) + }; - area->colorPicker.setFirstColor(QColor(255,255,255,255)); - area->colorPicker.setSecondColor(QColor(0,0,0,255)); - area->createPolygonTool(); - area->layerBundle[0].image->drawPlain(QColor(255, 0, 0, 255)); + area->colorPicker.setFirstColor(QColor(255,255,255,255)); + area->colorPicker.setSecondColor(QColor(0,0,0,255)); + area->createPolygonTool(); + area->layerBundle[0].image->drawPlain(QColor(255, 0, 0, 255)); - QBENCHMARK{ - area->Tool->onMouseLeftPressed(points[0].x(), points[0].y()); - area->Tool->onMouseLeftReleased(points[0].x(), points[0].y()); + QBENCHMARK{ + area->Tool->onMouseLeftPressed(points[0].x(), points[0].y()); + area->Tool->onMouseLeftReleased(points[0].x(), points[0].y()); - area->Tool->onMouseRightPressed(points[0].x(), points[0].y()); - area->Tool->onMouseRightReleased(points[0].x(), points[0].y()); - } + area->Tool->onMouseRightPressed(points[0].x(), points[0].y()); + area->Tool->onMouseRightReleased(points[0].x(), points[0].y()); + } - area->deleteLayer(0); + area->deleteLayer(0); } @@ -1681,9 +1681,9 @@ void UnitTest::bench_Triangulation_Coverage(){ QBENCHMARK{ std::vector tria = IntelliTriangulation::calculateTriangles(points); QPoint point; - for(int i=0; i<200; i++) { + for(int i = 0; i<200; i++) { point.setX(i); - for(int j=0; j<200; j++) { + for(int j = 0; j<200; j++) { point.setY(j); IntelliTriangulation::isInPolygon(tria, point); } From 8e9c1d676926bd3f503854f715be08b6242b051f Mon Sep 17 00:00:00 2001 From: Jan Schuffenhauer Date: Fri, 17 Jan 2020 09:47:20 +0100 Subject: [PATCH 3/4] Fixed all warnings. the rest is just some false warnings from cppcheck --- src/GUI/IntelliPhotoGui.cpp | 4 +++- src/Layer/PaintingArea.cpp | 32 ++++++++++++++++---------------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/src/GUI/IntelliPhotoGui.cpp b/src/GUI/IntelliPhotoGui.cpp index 5237ee0..207ffc4 100644 --- a/src/GUI/IntelliPhotoGui.cpp +++ b/src/GUI/IntelliPhotoGui.cpp @@ -856,7 +856,9 @@ void IntelliPhotoGui::UpdateGui(){ dimCanvas->setText(string); if(paintingArea->layerBundle.size() != 0) { - string = QString("%1x%2").arg(paintingArea->layerBundle[static_cast(paintingArea->getNumberOfActiveLayer())].width).arg(paintingArea->layerBundle[static_cast(paintingArea->getNumberOfActiveLayer())].height); + string = QString("%1x%2").arg(paintingArea->layerBundle[static_cast + (paintingArea->getNumberOfActiveLayer())].width).arg(paintingArea->layerBundle[static_cast + (paintingArea->getNumberOfActiveLayer())].height); dimActive->setText(string); } else{ diff --git a/src/Layer/PaintingArea.cpp b/src/Layer/PaintingArea.cpp index 0bf6a0e..b471da0 100644 --- a/src/Layer/PaintingArea.cpp +++ b/src/Layer/PaintingArea.cpp @@ -233,11 +233,11 @@ void PaintingArea::createFloodFillTool(){ } int PaintingArea::getWidthOfActive(){ - return this->layerBundle[static_cast(activeLayer)].width; + return this->layerBundle[static_cast(activeLayer)].width; } int PaintingArea::getHeightOfActive(){ - return this->layerBundle[static_cast(activeLayer)].height; + return this->layerBundle[static_cast(activeLayer)].height; } int PaintingArea::getMaxWidth(){ @@ -249,11 +249,11 @@ int PaintingArea::getMaxHeight(){ } IntelliImage::ImageType PaintingArea::getTypeOfImageRealLayer(){ - return this->layerBundle[static_cast(activeLayer)].image->getTypeOfImage(); + return this->layerBundle[static_cast(activeLayer)].image->getTypeOfImage(); } std::vector PaintingArea::getPolygonDataOfRealLayer(){ - return this->layerBundle[static_cast(activeLayer)].image->getPolygonData(); + return this->layerBundle[static_cast(activeLayer)].image->getPolygonData(); } // If a mouse button is pressed check if it was the @@ -265,8 +265,8 @@ void PaintingArea::mousePressEvent(QMouseEvent*event){ } if(Tool == nullptr) return; - int x = event->x() - layerBundle[static_cast(activeLayer)].widthOffset; - int y = event->y() - layerBundle[static_cast(activeLayer)].heightOffset; + int x = event->x() - layerBundle[static_cast(activeLayer)].widthOffset; + int y = event->y() - layerBundle[static_cast(activeLayer)].heightOffset; if(event->button() == Qt::LeftButton) { Tool->onMouseLeftPressed(x, y); }else if(event->button() == Qt::RightButton) { @@ -284,8 +284,8 @@ void PaintingArea::mouseMoveEvent(QMouseEvent*event){ } if(Tool == nullptr) return; - int x = event->x() - layerBundle[static_cast(activeLayer)].widthOffset; - int y = event->y() - layerBundle[static_cast(activeLayer)].heightOffset; + int x = event->x() - layerBundle[static_cast(activeLayer)].widthOffset; + int y = event->y() - layerBundle[static_cast(activeLayer)].heightOffset; Tool->onMouseMoved(x, y); update(); } @@ -296,8 +296,8 @@ void PaintingArea::mouseReleaseEvent(QMouseEvent*event){ return; if(Tool == nullptr) return; - int x = event->x() - layerBundle[static_cast(activeLayer)].widthOffset; - int y = event->y() - layerBundle[static_cast(activeLayer)].heightOffset; + int x = event->x() - layerBundle[static_cast(activeLayer)].widthOffset; + int y = event->y() - layerBundle[static_cast(activeLayer)].heightOffset; if(event->button() == Qt::LeftButton) { Tool->onMouseLeftReleased(x, y); }else if(event->button() == Qt::RightButton) { @@ -341,7 +341,7 @@ void PaintingArea::selectLayerUp(){ void PaintingArea::selectLayerDown(){ updateTools(); if(activeLayer>0) { - std::swap(layerBundle[static_cast(activeLayer)], layerBundle[static_cast(activeLayer - 1)]); + std::swap(layerBundle[static_cast(activeLayer)], layerBundle[static_cast(activeLayer - 1)]); activeLayer--; } } @@ -385,11 +385,11 @@ bool PaintingArea::createTempTopLayer(int idx){ if(idx>=0) { LayerObject newLayer; newLayer.alpha = 255; - newLayer.height = layerBundle[static_cast(idx)].height; - newLayer.width = layerBundle[static_cast(idx)].width; - newLayer.heightOffset = layerBundle[static_cast(idx)].heightOffset; - newLayer.widthOffset = layerBundle[static_cast(idx)].widthOffset; - newLayer.image = layerBundle[static_cast(idx)].image->getDeepCopy(); + newLayer.height = layerBundle[static_cast(idx)].height; + newLayer.width = layerBundle[static_cast(idx)].width; + newLayer.heightOffset = layerBundle[static_cast(idx)].heightOffset; + newLayer.widthOffset = layerBundle[static_cast(idx)].widthOffset; + newLayer.image = layerBundle[static_cast(idx)].image->getDeepCopy(); layerBundle.insert(layerBundle.begin() + idx + 1,newLayer); return true; } From 579e9028e034ed9d6c3f16b69af7fe72130335ee Mon Sep 17 00:00:00 2001 From: Jan Schuffenhauer Date: Fri, 17 Jan 2020 10:00:04 +0100 Subject: [PATCH 4/4] Automated Merge Preparation --- .../_intelli_color_picker_8cpp_source.html | 8 +- .../html/_intelli_color_picker_8h_source.html | 4 +- docs/html/_intelli_photo_gui_8cpp.html | 2 + docs/html/_intelli_photo_gui_8cpp_source.html | 1695 +++++++++-------- docs/html/_intelli_photo_gui_8h_source.html | 8 +- docs/html/_intelli_tool_8cpp_source.html | 5 +- .../_intelli_tool_circle_8cpp_source.html | 13 +- .../_intelli_tool_flood_fill_8cpp_source.html | 1 - docs/html/_intelli_tool_line_8cpp_source.html | 1 - docs/html/_intelli_tool_pen_8cpp_source.html | 1 - .../html/_intelli_tool_plain_8cpp_source.html | 1 - .../_intelli_tool_polygon_8cpp_source.html | 16 +- .../_intelli_tool_rectangle_8cpp_source.html | 2 - docs/html/_painting_area_8cpp_source.html | 38 +- docs/html/class_intelli_photo_gui.html | 8 +- docs/html/tst__unittest_8cpp_source.html | 2 - 16 files changed, 897 insertions(+), 908 deletions(-) diff --git a/docs/html/_intelli_color_picker_8cpp_source.html b/docs/html/_intelli_color_picker_8cpp_source.html index f7131a1..02695a7 100644 --- a/docs/html/_intelli_color_picker_8cpp_source.html +++ b/docs/html/_intelli_color_picker_8cpp_source.html @@ -100,11 +100,11 @@ $(document).ready(function(){initNavTree('_intelli_color_picker_8cpp_source.html
    12  std::swap(firstColor, secondColor);
    13 }
    14 
    - +
    16  return this->firstColor;
    17 }
    18 
    - +
    20  return this->secondColor;
    21 }
    22 
    @@ -122,12 +122,12 @@ $(document).ready(function(){initNavTree('_intelli_color_picker_8cpp_source.html
    34 }
    +
    QColor getFirstColor() const
    A function to read the primary selected color.
    virtual ~IntelliColorPicker()
    IntelliColorPicker destructor clears up his used memory, if there is some.
    void setSecondColor(QColor Color)
    A function to set the secondary color.
    -
    QColor getSecondColor()
    A function to read the secondary selected color.
    +
    QColor getSecondColor() const
    A function to read the secondary selected color.
    void setFirstColor(QColor Color)
    A function to set the primary color.
    -
    QColor getFirstColor()
    A function to read the primary selected color.
    void swapColors()
    A function switching primary and secondary color.
    IntelliColorPicker()
    IntelliColorPicker constructor, setting 2 preset colors, be careful, theese color may change in produ...
    diff --git a/docs/html/_intelli_color_picker_8h_source.html b/docs/html/_intelli_color_picker_8h_source.html index ea836cf..b9fbf6a 100644 --- a/docs/html/_intelli_color_picker_8h_source.html +++ b/docs/html/_intelli_color_picker_8h_source.html @@ -124,11 +124,11 @@ $(document).ready(function(){initNavTree('_intelli_color_picker_8h_source.html',
    73 #endif
    +
    QColor getFirstColor() const
    A function to read the primary selected color.
    virtual ~IntelliColorPicker()
    IntelliColorPicker destructor clears up his used memory, if there is some.
    void setSecondColor(QColor Color)
    A function to set the secondary color.
    -
    QColor getSecondColor()
    A function to read the secondary selected color.
    +
    QColor getSecondColor() const
    A function to read the secondary selected color.
    void setFirstColor(QColor Color)
    A function to set the primary color.
    -
    QColor getFirstColor()
    A function to read the primary selected color.
    The IntelliColorPicker manages the selected colors for one whole project.
    void swapColors()
    A function switching primary and secondary color.
    diff --git a/docs/html/_intelli_photo_gui_8cpp.html b/docs/html/_intelli_photo_gui_8cpp.html index ace1645..db1e96f 100644 --- a/docs/html/_intelli_photo_gui_8cpp.html +++ b/docs/html/_intelli_photo_gui_8cpp.html @@ -88,6 +88,8 @@ $(document).ready(function(){initNavTree('_intelli_photo_gui_8cpp.html',''); ini
    #include "IntelliPhotoGui.h"
    #include "Layer/PaintingArea.h"
    +#include "QEvent"
    +#include "QCloseEvent"

    Go to the source code of this file.

    diff --git a/docs/html/_intelli_photo_gui_8cpp_source.html b/docs/html/_intelli_photo_gui_8cpp_source.html index 9658796..94da67a 100644 --- a/docs/html/_intelli_photo_gui_8cpp_source.html +++ b/docs/html/_intelli_photo_gui_8cpp_source.html @@ -91,866 +91,869 @@ $(document).ready(function(){initNavTree('_intelli_photo_gui_8cpp_source.html','
    3 #include "IntelliPhotoGui.h"
    4 #include "Layer/PaintingArea.h"
    5 
    -
    6 // IntelliPhotoGui constructor
    - -
    8  // create Gui elements and lay them out
    -
    9  createGui();
    -
    10  // Create actions
    -
    11  createActions();
    -
    12  // create Menus
    -
    13  createMenus();
    -
    14  // set style of the gui
    -
    15  setIntelliStyle();
    -
    16  // Size the app
    -
    17  resize(600,600);
    -
    18  showMaximized();
    -
    19  setDefaultToolValue();
    -
    20 }
    -
    21 
    -
    22 // User tried to close the app
    -
    23 void IntelliPhotoGui::closeEvent(QCloseEvent*event){
    -
    24  // If they try to close maybeSave() returns true
    -
    25  // if no changes have been made and the app closes
    -
    26  if (maybeSave()) {
    -
    27  event->accept();
    -
    28  } else {
    -
    29  // If there have been changes ignore the event
    -
    30  event->ignore();
    -
    31  }
    -
    32 }
    -
    33 
    -
    34 // Check if the current image has been changed and then
    -
    35 // open a dialog to open a file
    -
    36 void IntelliPhotoGui::slotOpen(){
    -
    37  // Check if changes have been made since last save
    -
    38  // maybeSave() returns true if no changes have been made
    -
    39  if (maybeSave()) {
    -
    40 
    -
    41  // Get the file to open from a dialog
    -
    42  // tr sets the window title to Open File
    -
    43  // QDir opens the current dirctory
    -
    44  QString fileName = QFileDialog::getOpenFileName(this,
    -
    45  tr("Open File"), QDir::currentPath(), nullptr, nullptr, QFileDialog::DontUseNativeDialog);
    -
    46 
    -
    47  // If we have a file name load the image and place
    -
    48  // it in the paintingArea
    -
    49  if (!fileName.isEmpty()) {
    -
    50  paintingArea->open(fileName);
    -
    51  UpdateGui();
    -
    52  }
    -
    53  }
    -
    54 }
    -
    55 
    -
    56 // Called when the user clicks Save As in the menu
    -
    57 void IntelliPhotoGui::slotSave(){
    -
    58  // A QAction represents the action of the user clicking
    -
    59  QAction*action = qobject_cast<QAction*>(sender());
    -
    60 
    -
    61  // Stores the array of bytes of the users data
    -
    62  QByteArray fileFormat = action->data().toByteArray();
    +
    6 #include "QEvent"
    +
    7 #include "QCloseEvent"
    +
    8 
    +
    9 // IntelliPhotoGui constructor
    + +
    11  // create Gui elements and lay them out
    +
    12  createGui();
    +
    13  // Create actions
    +
    14  createActions();
    +
    15  // create Menus
    +
    16  createMenus();
    +
    17  // set style of the gui
    +
    18  setIntelliStyle();
    +
    19  // Size the app
    +
    20  resize(600,600);
    +
    21  showMaximized();
    +
    22  setDefaultToolValue();
    +
    23 }
    +
    24 
    +
    25 // User tried to close the app
    +
    26 void IntelliPhotoGui::closeEvent(QCloseEvent*event){
    +
    27  // If they try to close maybeSave() returns true
    +
    28  // if no changes have been made and the app closes
    +
    29  if (maybeSave()) {
    +
    30  event->accept();
    +
    31  } else {
    +
    32  // If there have been changes ignore the event
    +
    33  event->ignore();
    +
    34  }
    +
    35 }
    +
    36 
    +
    37 // Check if the current image has been changed and then
    +
    38 // open a dialog to open a file
    +
    39 void IntelliPhotoGui::slotOpen(){
    +
    40  // Check if changes have been made since last save
    +
    41  // maybeSave() returns true if no changes have been made
    +
    42  if (maybeSave()) {
    +
    43 
    +
    44  // Get the file to open from a dialog
    +
    45  // tr sets the window title to Open File
    +
    46  // QDir opens the current dirctory
    +
    47  QString fileName = QFileDialog::getOpenFileName(this,
    +
    48  tr("Open File"), QDir::currentPath(), nullptr, nullptr, QFileDialog::DontUseNativeDialog);
    +
    49 
    +
    50  // If we have a file name load the image and place
    +
    51  // it in the paintingArea
    +
    52  if (!fileName.isEmpty()) {
    +
    53  paintingArea->open(fileName);
    +
    54  UpdateGui();
    +
    55  }
    +
    56  }
    +
    57 }
    +
    58 
    +
    59 // Called when the user clicks Save As in the menu
    +
    60 void IntelliPhotoGui::slotSave(){
    +
    61  // A QAction represents the action of the user clicking
    +
    62  QAction*action = qobject_cast<QAction*>(sender());
    63 
    -
    64  // Pass it to be saved
    -
    65  saveFile(fileFormat);
    -
    66 }
    -
    67 
    -
    68 // Opens a dialog that allows the user to create a New RASTER Layer
    -
    69 void IntelliPhotoGui::slotCreateNewRasterLayer(){
    -
    70  // Stores button value
    -
    71  bool ok1, ok2;
    -
    72 
    -
    73  // "New Layer" is the title of the window
    -
    74  // the next tr is the text to display
    -
    75  // Define the standard Value, min, max, step and ok button
    -
    76  int width = IntelliInputDialog::getInt("New Raster Layer", "Width:", 200, 1, paintingArea->getMaxWidth(), 1, &ok1);
    -
    77 
    -
    78  int height = IntelliInputDialog::getInt("New Raster Layer", "Height:", 200, 1, paintingArea->getMaxHeight(), 1, &ok2);
    -
    79 
    -
    80  // Create New Layer
    -
    81  if (ok1&&ok2) {
    -
    82  paintingArea->addLayer(width,height,0,0,IntelliImage::ImageType::RASTERIMAGE);
    -
    83  UpdateGui();
    -
    84  }
    -
    85 }
    -
    86 
    -
    87 // Opens a dialog that allows the user to create a New SHAPED Layer
    -
    88 void IntelliPhotoGui::slotCreateNewShapedLayer(){
    -
    89  // Stores button value
    -
    90  bool ok1, ok2;
    -
    91 
    -
    92  // "New Layer" is the title of the window
    -
    93  // the next tr is the text to display
    -
    94  // Define the standard Value, min, max, step and ok button
    -
    95  int width = IntelliInputDialog::getInt("New Shaped Layer", "Width:", 200, 1, paintingArea->getMaxWidth(), 1, &ok1);
    -
    96 
    -
    97  int height = IntelliInputDialog::getInt("New Shaped Layer", "Height:", 200, 1, paintingArea->getMaxHeight(), 1, &ok2);
    -
    98 
    -
    99  // Create New Layer
    -
    100  if (ok1&&ok2) {
    -
    101  paintingArea->addLayer(width, height, 0, 0, IntelliImage::ImageType::SHAPEDIMAGE);
    -
    102  UpdateGui();
    -
    103  }
    -
    104 }
    -
    105 
    -
    106 // Opens a dialog that allows the user to change Dimension
    -
    107 void IntelliPhotoGui::slotChangeDim(){
    -
    108  // Stores button value
    -
    109  bool ok1, ok2;
    -
    110 
    -
    111  // "change Dimension" is the title of the window
    -
    112  // the next tr is the text to display
    -
    113  // Define the standard Value, min, step and ok button
    -
    114  int width = IntelliInputDialog::getInt("New Canvas Size", "Width:", 600, 1, 50000, 1, &ok1);
    -
    115 
    -
    116  int height = IntelliInputDialog::getInt("New Canvas Size", "Height:", 600, 1, 50000, 1, &ok2);
    -
    117 
    -
    118  // Change dimension
    -
    119  if (ok1&&ok2) {
    -
    120  paintingArea->setLayerDimensions(width,height);
    -
    121  UpdateGui();
    -
    122  }
    -
    123 }
    -
    124 
    -
    125 // Opens a dialog that allows the user to delete a Layer
    -
    126 void IntelliPhotoGui::slotDeleteLayer(){
    +
    64  // Stores the array of bytes of the users data
    +
    65  QByteArray fileFormat = action->data().toByteArray();
    +
    66 
    +
    67  // Pass it to be saved
    +
    68  saveFile(fileFormat);
    +
    69 }
    +
    70 
    +
    71 // Opens a dialog that allows the user to create a New RASTER Layer
    +
    72 void IntelliPhotoGui::slotCreateNewRasterLayer(){
    +
    73  // Stores button value
    +
    74  bool ok1, ok2;
    +
    75 
    +
    76  // "New Layer" is the title of the window
    +
    77  // the next tr is the text to display
    +
    78  // Define the standard Value, min, max, step and ok button
    +
    79  int width = IntelliInputDialog::getInt("New Raster Layer", "Width:", 200, 1, paintingArea->getMaxWidth(), 1, &ok1);
    +
    80 
    +
    81  int height = IntelliInputDialog::getInt("New Raster Layer", "Height:", 200, 1, paintingArea->getMaxHeight(), 1, &ok2);
    +
    82 
    +
    83  // Create New Layer
    +
    84  if (ok1&&ok2) {
    +
    85  paintingArea->addLayer(width,height,0,0,IntelliImage::ImageType::RASTERIMAGE);
    +
    86  UpdateGui();
    +
    87  }
    +
    88 }
    +
    89 
    +
    90 // Opens a dialog that allows the user to create a New SHAPED Layer
    +
    91 void IntelliPhotoGui::slotCreateNewShapedLayer(){
    +
    92  // Stores button value
    +
    93  bool ok1, ok2;
    +
    94 
    +
    95  // "New Layer" is the title of the window
    +
    96  // the next tr is the text to display
    +
    97  // Define the standard Value, min, max, step and ok button
    +
    98  int width = IntelliInputDialog::getInt("New Shaped Layer", "Width:", 200, 1, paintingArea->getMaxWidth(), 1, &ok1);
    +
    99 
    +
    100  int height = IntelliInputDialog::getInt("New Shaped Layer", "Height:", 200, 1, paintingArea->getMaxHeight(), 1, &ok2);
    +
    101 
    +
    102  // Create New Layer
    +
    103  if (ok1&&ok2) {
    +
    104  paintingArea->addLayer(width, height, 0, 0, IntelliImage::ImageType::SHAPEDIMAGE);
    +
    105  UpdateGui();
    +
    106  }
    +
    107 }
    +
    108 
    +
    109 // Opens a dialog that allows the user to change Dimension
    +
    110 void IntelliPhotoGui::slotChangeDim(){
    +
    111  // Stores button value
    +
    112  bool ok1, ok2;
    +
    113 
    +
    114  // "change Dimension" is the title of the window
    +
    115  // the next tr is the text to display
    +
    116  // Define the standard Value, min, step and ok button
    +
    117  int width = IntelliInputDialog::getInt("New Canvas Size", "Width:", 600, 1, 50000, 1, &ok1);
    +
    118 
    +
    119  int height = IntelliInputDialog::getInt("New Canvas Size", "Height:", 600, 1, 50000, 1, &ok2);
    +
    120 
    +
    121  // Change dimension
    +
    122  if (ok1&&ok2) {
    +
    123  paintingArea->setLayerDimensions(width,height);
    +
    124  UpdateGui();
    +
    125  }
    +
    126 }
    127 
    -
    128  bool ok1;
    -
    129  // "delete Layer" is the title of the window
    -
    130  // the next tr is the text to display
    -
    131  // Define the standard Value, min, max, step and ok button
    -
    132  int layerNumber = IntelliInputDialog::getInt("Delete Layer", "Number:", paintingArea->getNumberOfActiveLayer() + 1, 1, static_cast<int>(paintingArea->layerBundle.size()), 1, &ok1);
    -
    133 
    -
    134  // Create New Layer
    -
    135  if(ok1) {
    -
    136  paintingArea->deleteLayer(layerNumber - 1);
    -
    137  UpdateGui();
    -
    138  }
    -
    139 }
    -
    140 
    -
    141 void IntelliPhotoGui::slotSetActiveAlpha(){
    -
    142 
    -
    143  bool ok1, ok2;
    -
    144  // "Layer to set on" is the title of the window
    -
    145  // the next tr is the text to display
    -
    146  // Define the standard Value, min, max, step and ok button
    -
    147 
    -
    148  int layer = IntelliInputDialog::getInt("Layer to set on", "Layer:", paintingArea->getNumberOfActiveLayer() + 1, 1, static_cast<int>(paintingArea->layerBundle.size()), 1, &ok1);
    -
    149 
    -
    150  // "New Alpha" is the title of the window
    -
    151  int alpha = IntelliInputDialog::getInt("Layer to set on", "Alpha:", 255, 0, 255, 1, &ok2);
    +
    128 // Opens a dialog that allows the user to delete a Layer
    +
    129 void IntelliPhotoGui::slotDeleteLayer(){
    +
    130 
    +
    131  bool ok1;
    +
    132  // "delete Layer" is the title of the window
    +
    133  // the next tr is the text to display
    +
    134  // Define the standard Value, min, max, step and ok button
    +
    135  int layerNumber = IntelliInputDialog::getInt("Delete Layer", "Number:", paintingArea->getNumberOfActiveLayer() + 1, 1, static_cast<int>(paintingArea->layerBundle.size()), 1, &ok1);
    +
    136 
    +
    137  // Create New Layer
    +
    138  if(ok1) {
    +
    139  paintingArea->deleteLayer(layerNumber - 1);
    +
    140  UpdateGui();
    +
    141  }
    +
    142 }
    +
    143 
    +
    144 void IntelliPhotoGui::slotSetActiveAlpha(){
    +
    145 
    +
    146  bool ok1, ok2;
    +
    147  // "Layer to set on" is the title of the window
    +
    148  // the next tr is the text to display
    +
    149  // Define the standard Value, min, max, step and ok button
    +
    150 
    +
    151  int layer = IntelliInputDialog::getInt("Layer to set on", "Layer:", paintingArea->getNumberOfActiveLayer() + 1, 1, static_cast<int>(paintingArea->layerBundle.size()), 1, &ok1);
    152 
    -
    153  if (ok1&&ok2)
    -
    154  {
    -
    155  paintingArea->setLayerAlpha(layer - 1,alpha);
    -
    156  UpdateGui();
    -
    157  }
    -
    158 }
    -
    159 
    -
    160 void IntelliPhotoGui::slotSetPolygon(){
    -
    161  // Stores button value
    -
    162  bool ok1;
    -
    163 
    -
    164  // "Layer to set on" is the title of the window
    -
    165  // the next tr is the text to display
    -
    166  // Define the standard Value, min, max, step and ok button
    -
    167  int layer = IntelliInputDialog::getInt("Layer to set on", "Layer:", paintingArea->getNumberOfActiveLayer() + 1, 1, static_cast<int>(paintingArea->layerBundle.size()), 1, &ok1);
    -
    168 
    -
    169  if (ok1)
    -
    170  {
    -
    171  paintingArea->setPolygon(layer - 1);
    -
    172  UpdateGui();
    -
    173  }
    -
    174 }
    -
    175 
    -
    176 void IntelliPhotoGui::slotPositionMoveUp(){
    -
    177  paintingArea->movePositionActive(0,-20);
    -
    178  update();
    -
    179 }
    -
    180 
    -
    181 void IntelliPhotoGui::slotPositionMoveDown(){
    -
    182  paintingArea->movePositionActive(0,20);
    -
    183  update();
    -
    184 }
    -
    185 
    -
    186 void IntelliPhotoGui::slotPositionMoveLeft(){
    -
    187  paintingArea->movePositionActive(-20,0);
    -
    188  update();
    -
    189 }
    -
    190 
    -
    191 void IntelliPhotoGui::slotPositionMoveRight(){
    -
    192  paintingArea->movePositionActive(20,0);
    -
    193  update();
    -
    194 }
    -
    195 
    -
    196 void IntelliPhotoGui::slotMoveLayerUp(){
    -
    197  paintingArea->moveActiveLayer(1);
    -
    198  update();
    -
    199 }
    -
    200 
    -
    201 void IntelliPhotoGui::slotMoveLayerDown(){
    -
    202  paintingArea->moveActiveLayer(-1);
    -
    203  update();
    -
    204 }
    -
    205 
    -
    206 void IntelliPhotoGui::slotSetActiveLayer(){
    -
    207  bool ok1;
    -
    208  // "Layer to set on" is the title of the window
    -
    209  // the next tr is the text to display
    -
    210  // Define the standard Value, min, max, step and ok button
    -
    211  int layer = IntelliInputDialog::getInt("Layer to set on", "Layer:", 1, 1, static_cast<int>(paintingArea->layerBundle.size()), 1, &ok1);
    -
    212 
    -
    213  if(ok1) {
    -
    214  paintingArea->setLayerActive(layer - 1);
    -
    215  UpdateGui();
    -
    216  }
    -
    217 }
    -
    218 
    -
    219 void IntelliPhotoGui::slotUpdateRenderSettingsOn(){
    -
    220  paintingArea->setRenderSettings(true);
    -
    221  UpdateGui();
    -
    222 }
    -
    223 
    -
    224 void IntelliPhotoGui::slotUpdateRenderSettingsOff(){
    -
    225  paintingArea->setRenderSettings(false);
    -
    226  UpdateGui();
    -
    227 }
    -
    228 
    -
    229 void IntelliPhotoGui::slotSetFirstColor(){
    -
    230  paintingArea->colorPickerSetFirstColor();
    -
    231  UpdateGui();
    -
    232 }
    -
    233 
    -
    234 void IntelliPhotoGui::slotSetSecondColor(){
    -
    235  paintingArea->colorPickerSetSecondColor();
    -
    236  UpdateGui();
    -
    237 }
    -
    238 
    -
    239 void IntelliPhotoGui::slotSwapColor(){
    -
    240  paintingArea->colorPickerSwapColors();
    -
    241  UpdateGui();
    -
    242 }
    -
    243 
    -
    244 void IntelliPhotoGui::slotCreatePenTool(){
    -
    245  PenButton->setChecked(true);
    -
    246  paintingArea->createPenTool();
    -
    247 }
    -
    248 
    -
    249 void IntelliPhotoGui::slotCreatePlainTool(){
    -
    250  PlainButton->setChecked(true);
    -
    251  paintingArea->createPlainTool();
    -
    252 }
    -
    253 
    -
    254 void IntelliPhotoGui::slotCreateLineTool(){
    -
    255  LineButton->setChecked(true);
    -
    256  paintingArea->createLineTool();
    -
    257 }
    -
    258 
    -
    259 void IntelliPhotoGui::slotCreateRectangleTool(){
    -
    260  RectangleButton->setChecked(true);
    -
    261  paintingArea->createRectangleTool();
    -
    262 }
    -
    263 
    -
    264 void IntelliPhotoGui::slotCreateCircleTool(){
    -
    265  CircleButton->setChecked(true);
    -
    266  paintingArea->createCircleTool();
    -
    267 }
    -
    268 
    -
    269 void IntelliPhotoGui::slotCreatePolygonTool(){
    -
    270  PolygonButton->setChecked(true);
    -
    271  paintingArea->createPolygonTool();
    -
    272 }
    -
    273 
    -
    274 void IntelliPhotoGui::slotCreateFloodFillTool(){
    -
    275  FloodFillButton->setChecked(true);
    -
    276  paintingArea->createFloodFillTool();
    -
    277 }
    -
    278 
    -
    279 // Open an about dialog
    -
    280 void IntelliPhotoGui::slotAboutDialog(){
    -
    281  // Window title and text to display
    -
    282  QMessageBox::about(this, tr("About Painting"),
    -
    283  tr("<p><b>IntelliPhoto - </b>A Pretty basic editor.</p> <br>Developed by Team 7."));
    -
    284 }
    -
    285 
    -
    286 void IntelliPhotoGui::slotEnterPressed(){
    -
    287  QString string = EditLineWidth->text();
    -
    288  if(string.toInt() > 50) {
    -
    289  EditLineWidth->setText("50");
    -
    290  }
    -
    291  paintingArea->Toolsettings.setLineWidth(string.toInt());
    -
    292  string = EditLineInnerAlpha->text();
    -
    293  if(string.toInt() > 255) {
    -
    294  EditLineInnerAlpha->setText("255");
    -
    295  }
    -
    296  paintingArea->Toolsettings.setInnerAlpha(string.toInt());
    -
    297 }
    -
    298 
    -
    299 void IntelliPhotoGui::slotResetTools(){
    -
    300  CircleButton->setChecked(false);
    -
    301  FloodFillButton->setChecked(false);
    -
    302  LineButton->setChecked(false);
    -
    303  PenButton->setChecked(false);
    -
    304  PlainButton->setChecked(false);
    -
    305  PolygonButton->setChecked(false);
    -
    306  RectangleButton->setChecked(false);
    -
    307 }
    -
    308 
    -
    309 void IntelliPhotoGui::slotSetWidth(){
    -
    310  bool ok1;
    -
    311  int temp = IntelliInputDialog::getInt("Toolsettings", "Width:", 5, 1, 50, 1, &ok1);
    -
    312  if(ok1) {
    -
    313  paintingArea->Toolsettings.setLineWidth(temp);
    -
    314  EditLineWidth->setText(QString("%1").arg(temp));
    -
    315  }
    -
    316 }
    -
    317 
    -
    318 void IntelliPhotoGui::slotSetInnerAlpha(){
    -
    319  bool ok1;
    -
    320  int temp = IntelliInputDialog::getInt("Toolsettings", "Alpha:", 5, 1, 50, 1, &ok1);
    -
    321  if(ok1) {
    -
    322  paintingArea->Toolsettings.setInnerAlpha(temp);
    -
    323  EditLineInnerAlpha->setText(QString("%1").arg(temp));
    -
    324  }
    -
    325 }
    -
    326 
    -
    327 // Define menu actions that call functions
    -
    328 void IntelliPhotoGui::createActions(){
    -
    329  // Get a list of the supported file formats
    -
    330  // QImageWriter is used to write images to files
    -
    331  foreach (QByteArray format, QImageWriter::supportedImageFormats()) {
    -
    332  QString text = tr("%1...").arg(QString(format).toUpper());
    -
    333 
    -
    334  // Create an action for each file format
    -
    335  QAction*action = new QAction(text, this);
    +
    153  // "New Alpha" is the title of the window
    +
    154  int alpha = IntelliInputDialog::getInt("Layer to set on", "Alpha:", 255, 0, 255, 1, &ok2);
    +
    155 
    +
    156  if (ok1&&ok2)
    +
    157  {
    +
    158  paintingArea->setLayerAlpha(layer - 1,alpha);
    +
    159  UpdateGui();
    +
    160  }
    +
    161 }
    +
    162 
    +
    163 void IntelliPhotoGui::slotSetPolygon(){
    +
    164  // Stores button value
    +
    165  bool ok1;
    +
    166 
    +
    167  // "Layer to set on" is the title of the window
    +
    168  // the next tr is the text to display
    +
    169  // Define the standard Value, min, max, step and ok button
    +
    170  int layer = IntelliInputDialog::getInt("Layer to set on", "Layer:", paintingArea->getNumberOfActiveLayer() + 1, 1, static_cast<int>(paintingArea->layerBundle.size()), 1, &ok1);
    +
    171 
    +
    172  if (ok1)
    +
    173  {
    +
    174  paintingArea->setPolygon(layer - 1);
    +
    175  UpdateGui();
    +
    176  }
    +
    177 }
    +
    178 
    +
    179 void IntelliPhotoGui::slotPositionMoveUp(){
    +
    180  paintingArea->movePositionActive(0,-20);
    +
    181  update();
    +
    182 }
    +
    183 
    +
    184 void IntelliPhotoGui::slotPositionMoveDown(){
    +
    185  paintingArea->movePositionActive(0,20);
    +
    186  update();
    +
    187 }
    +
    188 
    +
    189 void IntelliPhotoGui::slotPositionMoveLeft(){
    +
    190  paintingArea->movePositionActive(-20,0);
    +
    191  update();
    +
    192 }
    +
    193 
    +
    194 void IntelliPhotoGui::slotPositionMoveRight(){
    +
    195  paintingArea->movePositionActive(20,0);
    +
    196  update();
    +
    197 }
    +
    198 
    +
    199 void IntelliPhotoGui::slotMoveLayerUp(){
    +
    200  paintingArea->moveActiveLayer(1);
    +
    201  update();
    +
    202 }
    +
    203 
    +
    204 void IntelliPhotoGui::slotMoveLayerDown(){
    +
    205  paintingArea->moveActiveLayer(-1);
    +
    206  update();
    +
    207 }
    +
    208 
    +
    209 void IntelliPhotoGui::slotSetActiveLayer(){
    +
    210  bool ok1;
    +
    211  // "Layer to set on" is the title of the window
    +
    212  // the next tr is the text to display
    +
    213  // Define the standard Value, min, max, step and ok button
    +
    214  int layer = IntelliInputDialog::getInt("Layer to set on", "Layer:", 1, 1, static_cast<int>(paintingArea->layerBundle.size()), 1, &ok1);
    +
    215 
    +
    216  if(ok1) {
    +
    217  paintingArea->setLayerActive(layer - 1);
    +
    218  UpdateGui();
    +
    219  }
    +
    220 }
    +
    221 
    +
    222 void IntelliPhotoGui::slotUpdateRenderSettingsOn(){
    +
    223  paintingArea->setRenderSettings(true);
    +
    224  UpdateGui();
    +
    225 }
    +
    226 
    +
    227 void IntelliPhotoGui::slotUpdateRenderSettingsOff(){
    +
    228  paintingArea->setRenderSettings(false);
    +
    229  UpdateGui();
    +
    230 }
    +
    231 
    +
    232 void IntelliPhotoGui::slotSetFirstColor(){
    +
    233  paintingArea->colorPickerSetFirstColor();
    +
    234  UpdateGui();
    +
    235 }
    +
    236 
    +
    237 void IntelliPhotoGui::slotSetSecondColor(){
    +
    238  paintingArea->colorPickerSetSecondColor();
    +
    239  UpdateGui();
    +
    240 }
    +
    241 
    +
    242 void IntelliPhotoGui::slotSwapColor(){
    +
    243  paintingArea->colorPickerSwapColors();
    +
    244  UpdateGui();
    +
    245 }
    +
    246 
    +
    247 void IntelliPhotoGui::slotCreatePenTool(){
    +
    248  PenButton->setChecked(true);
    +
    249  paintingArea->createPenTool();
    +
    250 }
    +
    251 
    +
    252 void IntelliPhotoGui::slotCreatePlainTool(){
    +
    253  PlainButton->setChecked(true);
    +
    254  paintingArea->createPlainTool();
    +
    255 }
    +
    256 
    +
    257 void IntelliPhotoGui::slotCreateLineTool(){
    +
    258  LineButton->setChecked(true);
    +
    259  paintingArea->createLineTool();
    +
    260 }
    +
    261 
    +
    262 void IntelliPhotoGui::slotCreateRectangleTool(){
    +
    263  RectangleButton->setChecked(true);
    +
    264  paintingArea->createRectangleTool();
    +
    265 }
    +
    266 
    +
    267 void IntelliPhotoGui::slotCreateCircleTool(){
    +
    268  CircleButton->setChecked(true);
    +
    269  paintingArea->createCircleTool();
    +
    270 }
    +
    271 
    +
    272 void IntelliPhotoGui::slotCreatePolygonTool(){
    +
    273  PolygonButton->setChecked(true);
    +
    274  paintingArea->createPolygonTool();
    +
    275 }
    +
    276 
    +
    277 void IntelliPhotoGui::slotCreateFloodFillTool(){
    +
    278  FloodFillButton->setChecked(true);
    +
    279  paintingArea->createFloodFillTool();
    +
    280 }
    +
    281 
    +
    282 // Open an about dialog
    +
    283 void IntelliPhotoGui::slotAboutDialog(){
    +
    284  // Window title and text to display
    +
    285  QMessageBox::about(this, tr("About Painting"),
    +
    286  tr("<p><b>IntelliPhoto - </b>A Pretty basic editor.</p> <br>Developed by Team 7."));
    +
    287 }
    +
    288 
    +
    289 void IntelliPhotoGui::slotEnterPressed(){
    +
    290  QString string = EditLineWidth->text();
    +
    291  if(string.toInt() > 50) {
    +
    292  EditLineWidth->setText("50");
    +
    293  }
    +
    294  paintingArea->Toolsettings.setLineWidth(string.toInt());
    +
    295  string = EditLineInnerAlpha->text();
    +
    296  if(string.toInt() > 255) {
    +
    297  EditLineInnerAlpha->setText("255");
    +
    298  }
    +
    299  paintingArea->Toolsettings.setInnerAlpha(string.toInt());
    +
    300 }
    +
    301 
    +
    302 void IntelliPhotoGui::slotResetTools(){
    +
    303  CircleButton->setChecked(false);
    +
    304  FloodFillButton->setChecked(false);
    +
    305  LineButton->setChecked(false);
    +
    306  PenButton->setChecked(false);
    +
    307  PlainButton->setChecked(false);
    +
    308  PolygonButton->setChecked(false);
    +
    309  RectangleButton->setChecked(false);
    +
    310 }
    +
    311 
    +
    312 void IntelliPhotoGui::slotSetWidth(){
    +
    313  bool ok1;
    +
    314  int temp = IntelliInputDialog::getInt("Toolsettings", "Width:", 5, 1, 50, 1, &ok1);
    +
    315  if(ok1) {
    +
    316  paintingArea->Toolsettings.setLineWidth(temp);
    +
    317  EditLineWidth->setText(QString("%1").arg(temp));
    +
    318  }
    +
    319 }
    +
    320 
    +
    321 void IntelliPhotoGui::slotSetInnerAlpha(){
    +
    322  bool ok1;
    +
    323  int temp = IntelliInputDialog::getInt("Toolsettings", "Alpha:", 5, 1, 50, 1, &ok1);
    +
    324  if(ok1) {
    +
    325  paintingArea->Toolsettings.setInnerAlpha(temp);
    +
    326  EditLineInnerAlpha->setText(QString("%1").arg(temp));
    +
    327  }
    +
    328 }
    +
    329 
    +
    330 // Define menu actions that call functions
    +
    331 void IntelliPhotoGui::createActions(){
    +
    332  // Get a list of the supported file formats
    +
    333  // QImageWriter is used to write images to files
    +
    334  foreach (QByteArray format, QImageWriter::supportedImageFormats()) {
    +
    335  QString text = tr("%1...").arg(QString(format).toUpper());
    336 
    -
    337  // Set an action for each file format
    -
    338  action->setData(format);
    +
    337  // Create an action for each file format
    +
    338  QAction*action = new QAction(text, this);
    339 
    -
    340  // When clicked call IntelliPhotoGui::save()
    -
    341  connect(action, SIGNAL(triggered()), this, SLOT(slotSave()));
    +
    340  // Set an action for each file format
    +
    341  action->setData(format);
    342 
    -
    343  // Attach each file format option menu item to Save As
    -
    344  actionSaveAs.append(action);
    -
    345  }
    -
    346 
    -
    347  //set exporter to actions
    -
    348  QAction*pngSaveAction = new QAction("PNG-8", this);
    -
    349  pngSaveAction->setData("PNG");
    -
    350  // When clicked call IntelliPhotoGui::save()
    -
    351  connect(pngSaveAction, SIGNAL(triggered()), this, SLOT(slotSave()));
    -
    352  // Attach each PNG in save Menu
    -
    353  actionSaveAs.append(pngSaveAction);
    -
    354  pngSaveAction->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_S));
    -
    355 
    -
    356  // Create exit action and tie to IntelliPhotoGui::close()
    -
    357  actionExit = new QAction(tr("&Exit"), this);
    -
    358  actionExit->setShortcuts(QKeySequence::Quit);
    -
    359  connect(actionExit, SIGNAL(triggered()), this, SLOT(close()));
    -
    360 
    -
    361  actionOpen = new QAction(tr("&Open"), this);
    -
    362  actionOpen->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_O));
    -
    363  connect(actionOpen, SIGNAL(triggered()), this, SLOT(slotOpen()));
    -
    364 
    -
    365  // Create New RASTER Layer action and tie to IntelliPhotoGui::newLayer()
    -
    366  actionCreateNewRasterLayer = new QAction(tr("&Raster Image"), this);
    -
    367  actionCreateNewRasterLayer->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_N));
    -
    368  connect(actionCreateNewRasterLayer, SIGNAL(triggered()), this, SLOT(slotCreateNewRasterLayer()));
    -
    369 
    -
    370 
    -
    371  // Create New SHAPED Layer action and tie to IntelliPhotoGui::newLayer()
    -
    372  actionCreateNewShapedLayer = new QAction(tr("&Shaped Image"), this);
    -
    373  actionCreateNewShapedLayer->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_N + Qt::ALT));
    -
    374  connect(actionCreateNewShapedLayer, SIGNAL(triggered()), this, SLOT(slotCreateNewShapedLayer()));
    -
    375 
    -
    376  // Delete New Layer action and tie to IntelliPhotoGui::deleteLayer()
    -
    377  actionDeleteLayer = new QAction(tr("&Delete Layer..."), this);
    -
    378  actionDeleteLayer->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_D));
    -
    379  connect(actionDeleteLayer, SIGNAL(triggered()), this, SLOT(slotDeleteLayer()));
    -
    380 
    -
    381  actionChangeDim = new QAction(tr("&Change Dimension"), this);
    -
    382  actionChangeDim->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_X));
    -
    383  connect(actionChangeDim, SIGNAL(triggered()), this, SLOT(slotChangeDim()));
    -
    384  connect(dimCanvas, SIGNAL(clicked()), this, SLOT(slotChangeDim()));
    -
    385 
    -
    386  actionSetActiveLayer = new QAction(tr("&set Active"), this);
    -
    387  actionSetActiveLayer->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_A));
    -
    388  connect(actionSetActiveLayer, SIGNAL(triggered()), this, SLOT(slotSetActiveLayer()));
    -
    389 
    -
    390  actionSetActiveAlpha = new QAction(tr("&set Alpha"), this);
    -
    391  actionSetActiveAlpha->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_A));
    -
    392  connect(actionSetActiveAlpha, SIGNAL(triggered()), this, SLOT(slotSetActiveAlpha()));
    -
    393 
    -
    394  actionSetPolygon = new QAction(tr("&set new Polygondata"), this);
    -
    395  actionSetPolygon->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_P));
    -
    396  connect(actionSetPolygon, SIGNAL(triggered()), this, SLOT(slotSetPolygon()));
    -
    397 
    -
    398  actionMovePositionUp = new QAction(tr("&move Up"), this);
    -
    399  actionMovePositionUp->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Up));
    -
    400  connect(actionMovePositionUp, SIGNAL(triggered()), this, SLOT(slotPositionMoveUp()));
    -
    401 
    -
    402  actionMovePositionDown = new QAction(tr("&move Down"), this);
    -
    403  actionMovePositionDown->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Down));
    -
    404  connect(actionMovePositionDown, SIGNAL(triggered()), this, SLOT(slotPositionMoveDown()));
    -
    405 
    -
    406  actionMovePositionLeft = new QAction(tr("&move Left"), this);
    -
    407  actionMovePositionLeft->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Left));
    -
    408  connect(actionMovePositionLeft, SIGNAL(triggered()), this, SLOT(slotPositionMoveLeft()));
    -
    409 
    -
    410  actionMovePositionRight = new QAction(tr("&move Right"), this);
    -
    411  actionMovePositionRight->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Right));
    -
    412  connect(actionMovePositionRight, SIGNAL(triggered()), this, SLOT(slotPositionMoveRight()));
    -
    413 
    -
    414  actionMoveLayerUp = new QAction(tr("&move Layer Up"), this);
    -
    415  actionMoveLayerUp->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_Up));
    -
    416  connect(actionMoveLayerUp, SIGNAL(triggered()), this, SLOT(slotMoveLayerUp()));
    -
    417 
    -
    418  actionMoveLayerDown = new QAction(tr("&move Layer Down"), this);
    -
    419  actionMoveLayerDown->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_Down));
    -
    420  connect(actionMoveLayerDown, SIGNAL(triggered()), this, SLOT(slotMoveLayerDown()));
    -
    421 
    -
    422  //Create Update RenderSettings Actions here
    -
    423  actionUpdateRenderSettingsOn = new QAction(tr("&On"), this);
    -
    424  actionUpdateRenderSettingsOn->setShortcut(QKeySequence(Qt::ALT + Qt::SHIFT + +Qt::Key_A));
    -
    425  connect(actionUpdateRenderSettingsOn, SIGNAL(triggered()),this, SLOT(slotUpdateRenderSettingsOn()));
    -
    426 
    -
    427  actionUpdateRenderSettingsOff = new QAction(tr("&Off"), this);
    -
    428  actionUpdateRenderSettingsOff->setShortcut(QKeySequence(Qt::ALT + Qt::SHIFT + +Qt::Key_D));
    -
    429  connect(actionUpdateRenderSettingsOff, SIGNAL(triggered()),this, SLOT(slotUpdateRenderSettingsOff()));
    -
    430 
    -
    431  //Create Color Actions here
    -
    432  actionColorPickerFirstColor = new QAction(tr("&Main"), this);
    -
    433  actionColorPickerFirstColor->setShortcut(QKeySequence(Qt::ALT + Qt::Key_N));
    -
    434  connect(actionColorPickerFirstColor, SIGNAL(triggered()), this, SLOT(slotSetFirstColor()));
    -
    435  connect(FirstColorButton, SIGNAL(clicked()), this, SLOT(slotSetFirstColor()));
    -
    436 
    -
    437  actionColorPickerSecondColor = new QAction(tr("&Secondary"), this);
    -
    438  actionColorPickerSecondColor->setShortcut(QKeySequence(Qt::ALT + Qt::Key_M));
    -
    439  connect(actionColorPickerSecondColor, SIGNAL(triggered()), this, SLOT(slotSetSecondColor()));
    -
    440  connect(SecondColorButton, SIGNAL(clicked()), this, SLOT(slotSetSecondColor()));
    -
    441 
    -
    442  actionColorSwap = new QAction(tr("&Switch"), this);
    -
    443  actionColorSwap->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_S));
    -
    444  connect(actionColorSwap, SIGNAL(triggered()), this, SLOT(slotSwapColor()));
    -
    445  connect(SwitchColorButton, SIGNAL(clicked()), this, SLOT(slotSwapColor()));
    -
    446 
    -
    447  //Create Tool actions down here
    -
    448  actionCreatePlainTool = new QAction(tr("&Plain"), this);
    -
    449  actionCreatePlainTool->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::SHIFT + Qt::Key_P));
    -
    450  connect(actionCreatePlainTool, SIGNAL(triggered()), this, SLOT(slotResetTools()));
    -
    451  connect(actionCreatePlainTool, SIGNAL(triggered()), this, SLOT(slotCreatePlainTool()));
    -
    452 
    -
    453 
    -
    454  actionCreatePenTool = new QAction(tr("&Pen"),this);
    -
    455  actionCreatePenTool->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::SHIFT + Qt::Key_S));
    -
    456  connect(actionCreatePenTool, SIGNAL(triggered()), this, SLOT(slotResetTools()));
    -
    457  connect(actionCreatePenTool, SIGNAL(triggered()), this, SLOT(slotCreatePenTool()));
    -
    458 
    -
    459  actionCreateLineTool = new QAction(tr("&Line"), this);
    -
    460  actionCreateLineTool->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::SHIFT + Qt::Key_L));
    -
    461  connect(actionCreateLineTool, SIGNAL(triggered()), this, SLOT(slotResetTools()));
    -
    462  connect(actionCreateLineTool, SIGNAL(triggered()), this, SLOT(slotCreateLineTool()));
    -
    463 
    -
    464  actionCreateCircleTool = new QAction(tr("&Circle"), this);
    -
    465  actionCreateCircleTool->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::SHIFT + Qt::Key_C));
    -
    466  connect(actionCreateCircleTool, SIGNAL(triggered()), this, SLOT(slotResetTools()));
    -
    467  connect(actionCreateCircleTool, SIGNAL(triggered()), this, SLOT(slotCreateCircleTool()));
    -
    468 
    -
    469  actionCreateRectangleTool = new QAction(tr("&Rectangle"), this);
    -
    470  actionCreateRectangleTool->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::SHIFT + Qt::Key_R));
    -
    471  connect(actionCreateRectangleTool, SIGNAL(triggered()), this, SLOT(slotResetTools()));
    -
    472  connect(actionCreateRectangleTool, SIGNAL(triggered()), this, SLOT(slotCreateRectangleTool()));
    -
    473 
    -
    474  actionCreatePolygonTool = new QAction(tr("&Polygon"), this);
    -
    475  actionCreatePolygonTool->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::SHIFT + Qt::Key_V));
    -
    476  connect(actionCreatePolygonTool, SIGNAL(triggered()), this, SLOT(slotResetTools()));
    -
    477  connect(actionCreatePolygonTool, SIGNAL(triggered()), this, SLOT(slotCreatePolygonTool()));
    -
    478 
    -
    479  actionCreateFloodFillTool = new QAction(tr("&FloodFill"), this);
    -
    480  actionCreateFloodFillTool->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::SHIFT + Qt::Key_F));
    -
    481  connect(actionCreateFloodFillTool, SIGNAL(triggered()), this, SLOT(slotResetTools()));
    -
    482  connect(actionCreateFloodFillTool, SIGNAL(triggered()), this, SLOT(slotCreateFloodFillTool()));
    -
    483 
    -
    484  // Create about action and tie to IntelliPhotoGui::about()
    -
    485  actionAboutDialog = new QAction(tr("&About"), this);
    -
    486  actionAboutDialog->setShortcut(Qt::Key_F2);
    -
    487  connect(actionAboutDialog, SIGNAL(triggered()), this, SLOT(slotAboutDialog()));
    -
    488 
    -
    489  // Create about Qt action and tie to IntelliPhotoGui::aboutQt()
    -
    490  actionAboutQtDialog = new QAction(tr("About &Qt"), this);
    -
    491  actionAboutQtDialog->setShortcut(Qt::Key_F3);
    -
    492  connect(actionAboutQtDialog, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
    -
    493 
    -
    494  connect(EditLineWidth, SIGNAL(returnPressed()), this, SLOT(slotEnterPressed()));
    -
    495  connect(EditLineInnerAlpha, SIGNAL(returnPressed()), this, SLOT(slotEnterPressed()));
    +
    343  // When clicked call IntelliPhotoGui::save()
    +
    344  connect(action, SIGNAL(triggered()), this, SLOT(slotSave()));
    +
    345 
    +
    346  // Attach each file format option menu item to Save As
    +
    347  actionSaveAs.append(action);
    +
    348  }
    +
    349 
    +
    350  //set exporter to actions
    +
    351  QAction*pngSaveAction = new QAction("PNG-8", this);
    +
    352  pngSaveAction->setData("PNG");
    +
    353  // When clicked call IntelliPhotoGui::save()
    +
    354  connect(pngSaveAction, SIGNAL(triggered()), this, SLOT(slotSave()));
    +
    355  // Attach each PNG in save Menu
    +
    356  actionSaveAs.append(pngSaveAction);
    +
    357  pngSaveAction->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_S));
    +
    358 
    +
    359  // Create exit action and tie to IntelliPhotoGui::close()
    +
    360  actionExit = new QAction(tr("&Exit"), this);
    +
    361  actionExit->setShortcuts(QKeySequence::Quit);
    +
    362  connect(actionExit, SIGNAL(triggered()), this, SLOT(close()));
    +
    363 
    +
    364  actionOpen = new QAction(tr("&Open"), this);
    +
    365  actionOpen->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_O));
    +
    366  connect(actionOpen, SIGNAL(triggered()), this, SLOT(slotOpen()));
    +
    367 
    +
    368  // Create New RASTER Layer action and tie to IntelliPhotoGui::newLayer()
    +
    369  actionCreateNewRasterLayer = new QAction(tr("&Raster Image"), this);
    +
    370  actionCreateNewRasterLayer->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_N));
    +
    371  connect(actionCreateNewRasterLayer, SIGNAL(triggered()), this, SLOT(slotCreateNewRasterLayer()));
    +
    372 
    +
    373 
    +
    374  // Create New SHAPED Layer action and tie to IntelliPhotoGui::newLayer()
    +
    375  actionCreateNewShapedLayer = new QAction(tr("&Shaped Image"), this);
    +
    376  actionCreateNewShapedLayer->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_N + Qt::ALT));
    +
    377  connect(actionCreateNewShapedLayer, SIGNAL(triggered()), this, SLOT(slotCreateNewShapedLayer()));
    +
    378 
    +
    379  // Delete New Layer action and tie to IntelliPhotoGui::deleteLayer()
    +
    380  actionDeleteLayer = new QAction(tr("&Delete Layer..."), this);
    +
    381  actionDeleteLayer->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_D));
    +
    382  connect(actionDeleteLayer, SIGNAL(triggered()), this, SLOT(slotDeleteLayer()));
    +
    383 
    +
    384  actionChangeDim = new QAction(tr("&Change Dimension"), this);
    +
    385  actionChangeDim->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_X));
    +
    386  connect(actionChangeDim, SIGNAL(triggered()), this, SLOT(slotChangeDim()));
    +
    387  connect(dimCanvas, SIGNAL(clicked()), this, SLOT(slotChangeDim()));
    +
    388 
    +
    389  actionSetActiveLayer = new QAction(tr("&set Active"), this);
    +
    390  actionSetActiveLayer->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_A));
    +
    391  connect(actionSetActiveLayer, SIGNAL(triggered()), this, SLOT(slotSetActiveLayer()));
    +
    392 
    +
    393  actionSetActiveAlpha = new QAction(tr("&set Alpha"), this);
    +
    394  actionSetActiveAlpha->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_A));
    +
    395  connect(actionSetActiveAlpha, SIGNAL(triggered()), this, SLOT(slotSetActiveAlpha()));
    +
    396 
    +
    397  actionSetPolygon = new QAction(tr("&set new Polygondata"), this);
    +
    398  actionSetPolygon->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_P));
    +
    399  connect(actionSetPolygon, SIGNAL(triggered()), this, SLOT(slotSetPolygon()));
    +
    400 
    +
    401  actionMovePositionUp = new QAction(tr("&move Up"), this);
    +
    402  actionMovePositionUp->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Up));
    +
    403  connect(actionMovePositionUp, SIGNAL(triggered()), this, SLOT(slotPositionMoveUp()));
    +
    404 
    +
    405  actionMovePositionDown = new QAction(tr("&move Down"), this);
    +
    406  actionMovePositionDown->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Down));
    +
    407  connect(actionMovePositionDown, SIGNAL(triggered()), this, SLOT(slotPositionMoveDown()));
    +
    408 
    +
    409  actionMovePositionLeft = new QAction(tr("&move Left"), this);
    +
    410  actionMovePositionLeft->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Left));
    +
    411  connect(actionMovePositionLeft, SIGNAL(triggered()), this, SLOT(slotPositionMoveLeft()));
    +
    412 
    +
    413  actionMovePositionRight = new QAction(tr("&move Right"), this);
    +
    414  actionMovePositionRight->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Right));
    +
    415  connect(actionMovePositionRight, SIGNAL(triggered()), this, SLOT(slotPositionMoveRight()));
    +
    416 
    +
    417  actionMoveLayerUp = new QAction(tr("&move Layer Up"), this);
    +
    418  actionMoveLayerUp->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_Up));
    +
    419  connect(actionMoveLayerUp, SIGNAL(triggered()), this, SLOT(slotMoveLayerUp()));
    +
    420 
    +
    421  actionMoveLayerDown = new QAction(tr("&move Layer Down"), this);
    +
    422  actionMoveLayerDown->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_Down));
    +
    423  connect(actionMoveLayerDown, SIGNAL(triggered()), this, SLOT(slotMoveLayerDown()));
    +
    424 
    +
    425  //Create Update RenderSettings Actions here
    +
    426  actionUpdateRenderSettingsOn = new QAction(tr("&On"), this);
    +
    427  actionUpdateRenderSettingsOn->setShortcut(QKeySequence(Qt::ALT + Qt::SHIFT + +Qt::Key_A));
    +
    428  connect(actionUpdateRenderSettingsOn, SIGNAL(triggered()),this, SLOT(slotUpdateRenderSettingsOn()));
    +
    429 
    +
    430  actionUpdateRenderSettingsOff = new QAction(tr("&Off"), this);
    +
    431  actionUpdateRenderSettingsOff->setShortcut(QKeySequence(Qt::ALT + Qt::SHIFT + +Qt::Key_D));
    +
    432  connect(actionUpdateRenderSettingsOff, SIGNAL(triggered()),this, SLOT(slotUpdateRenderSettingsOff()));
    +
    433 
    +
    434  //Create Color Actions here
    +
    435  actionColorPickerFirstColor = new QAction(tr("&Main"), this);
    +
    436  actionColorPickerFirstColor->setShortcut(QKeySequence(Qt::ALT + Qt::Key_N));
    +
    437  connect(actionColorPickerFirstColor, SIGNAL(triggered()), this, SLOT(slotSetFirstColor()));
    +
    438  connect(FirstColorButton, SIGNAL(clicked()), this, SLOT(slotSetFirstColor()));
    +
    439 
    +
    440  actionColorPickerSecondColor = new QAction(tr("&Secondary"), this);
    +
    441  actionColorPickerSecondColor->setShortcut(QKeySequence(Qt::ALT + Qt::Key_M));
    +
    442  connect(actionColorPickerSecondColor, SIGNAL(triggered()), this, SLOT(slotSetSecondColor()));
    +
    443  connect(SecondColorButton, SIGNAL(clicked()), this, SLOT(slotSetSecondColor()));
    +
    444 
    +
    445  actionColorSwap = new QAction(tr("&Switch"), this);
    +
    446  actionColorSwap->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_S));
    +
    447  connect(actionColorSwap, SIGNAL(triggered()), this, SLOT(slotSwapColor()));
    +
    448  connect(SwitchColorButton, SIGNAL(clicked()), this, SLOT(slotSwapColor()));
    +
    449 
    +
    450  //Create Tool actions down here
    +
    451  actionCreatePlainTool = new QAction(tr("&Plain"), this);
    +
    452  actionCreatePlainTool->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::SHIFT + Qt::Key_P));
    +
    453  connect(actionCreatePlainTool, SIGNAL(triggered()), this, SLOT(slotResetTools()));
    +
    454  connect(actionCreatePlainTool, SIGNAL(triggered()), this, SLOT(slotCreatePlainTool()));
    +
    455 
    +
    456 
    +
    457  actionCreatePenTool = new QAction(tr("&Pen"),this);
    +
    458  actionCreatePenTool->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::SHIFT + Qt::Key_S));
    +
    459  connect(actionCreatePenTool, SIGNAL(triggered()), this, SLOT(slotResetTools()));
    +
    460  connect(actionCreatePenTool, SIGNAL(triggered()), this, SLOT(slotCreatePenTool()));
    +
    461 
    +
    462  actionCreateLineTool = new QAction(tr("&Line"), this);
    +
    463  actionCreateLineTool->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::SHIFT + Qt::Key_L));
    +
    464  connect(actionCreateLineTool, SIGNAL(triggered()), this, SLOT(slotResetTools()));
    +
    465  connect(actionCreateLineTool, SIGNAL(triggered()), this, SLOT(slotCreateLineTool()));
    +
    466 
    +
    467  actionCreateCircleTool = new QAction(tr("&Circle"), this);
    +
    468  actionCreateCircleTool->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::SHIFT + Qt::Key_C));
    +
    469  connect(actionCreateCircleTool, SIGNAL(triggered()), this, SLOT(slotResetTools()));
    +
    470  connect(actionCreateCircleTool, SIGNAL(triggered()), this, SLOT(slotCreateCircleTool()));
    +
    471 
    +
    472  actionCreateRectangleTool = new QAction(tr("&Rectangle"), this);
    +
    473  actionCreateRectangleTool->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::SHIFT + Qt::Key_R));
    +
    474  connect(actionCreateRectangleTool, SIGNAL(triggered()), this, SLOT(slotResetTools()));
    +
    475  connect(actionCreateRectangleTool, SIGNAL(triggered()), this, SLOT(slotCreateRectangleTool()));
    +
    476 
    +
    477  actionCreatePolygonTool = new QAction(tr("&Polygon"), this);
    +
    478  actionCreatePolygonTool->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::SHIFT + Qt::Key_V));
    +
    479  connect(actionCreatePolygonTool, SIGNAL(triggered()), this, SLOT(slotResetTools()));
    +
    480  connect(actionCreatePolygonTool, SIGNAL(triggered()), this, SLOT(slotCreatePolygonTool()));
    +
    481 
    +
    482  actionCreateFloodFillTool = new QAction(tr("&FloodFill"), this);
    +
    483  actionCreateFloodFillTool->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::SHIFT + Qt::Key_F));
    +
    484  connect(actionCreateFloodFillTool, SIGNAL(triggered()), this, SLOT(slotResetTools()));
    +
    485  connect(actionCreateFloodFillTool, SIGNAL(triggered()), this, SLOT(slotCreateFloodFillTool()));
    +
    486 
    +
    487  // Create about action and tie to IntelliPhotoGui::about()
    +
    488  actionAboutDialog = new QAction(tr("&About"), this);
    +
    489  actionAboutDialog->setShortcut(Qt::Key_F2);
    +
    490  connect(actionAboutDialog, SIGNAL(triggered()), this, SLOT(slotAboutDialog()));
    +
    491 
    +
    492  // Create about Qt action and tie to IntelliPhotoGui::aboutQt()
    +
    493  actionAboutQtDialog = new QAction(tr("About &Qt"), this);
    +
    494  actionAboutQtDialog->setShortcut(Qt::Key_F3);
    +
    495  connect(actionAboutQtDialog, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
    496 
    -
    497  connect(CircleButton,SIGNAL(pressed()), this, SLOT(slotResetTools()));
    -
    498  connect(CircleButton, SIGNAL(clicked()), this, SLOT(slotCreateCircleTool()));
    +
    497  connect(EditLineWidth, SIGNAL(returnPressed()), this, SLOT(slotEnterPressed()));
    +
    498  connect(EditLineInnerAlpha, SIGNAL(returnPressed()), this, SLOT(slotEnterPressed()));
    499 
    -
    500  connect(FloodFillButton,SIGNAL(pressed()), this, SLOT(slotResetTools()));
    -
    501  connect(FloodFillButton, SIGNAL(clicked()), this, SLOT(slotCreateFloodFillTool()));
    +
    500  connect(CircleButton,SIGNAL(pressed()), this, SLOT(slotResetTools()));
    +
    501  connect(CircleButton, SIGNAL(clicked()), this, SLOT(slotCreateCircleTool()));
    502 
    -
    503  connect(LineButton,SIGNAL(pressed()), this, SLOT(slotResetTools()));
    -
    504  connect(LineButton, SIGNAL(clicked()), this, SLOT(slotCreateLineTool()));
    +
    503  connect(FloodFillButton,SIGNAL(pressed()), this, SLOT(slotResetTools()));
    +
    504  connect(FloodFillButton, SIGNAL(clicked()), this, SLOT(slotCreateFloodFillTool()));
    505 
    -
    506  connect(PenButton,SIGNAL(pressed()), this, SLOT(slotResetTools()));
    -
    507  connect(PenButton, SIGNAL(clicked()), this, SLOT(slotCreatePenTool()));
    +
    506  connect(LineButton,SIGNAL(pressed()), this, SLOT(slotResetTools()));
    +
    507  connect(LineButton, SIGNAL(clicked()), this, SLOT(slotCreateLineTool()));
    508 
    -
    509  connect(PlainButton,SIGNAL(pressed()), this, SLOT(slotResetTools()));
    -
    510  connect(PlainButton, SIGNAL(clicked()), this, SLOT(slotCreatePlainTool()));
    +
    509  connect(PenButton,SIGNAL(pressed()), this, SLOT(slotResetTools()));
    +
    510  connect(PenButton, SIGNAL(clicked()), this, SLOT(slotCreatePenTool()));
    511 
    -
    512  connect(PolygonButton,SIGNAL(pressed()), this, SLOT(slotResetTools()));
    -
    513  connect(PolygonButton, SIGNAL(clicked()), this, SLOT(slotCreatePolygonTool()));
    +
    512  connect(PlainButton,SIGNAL(pressed()), this, SLOT(slotResetTools()));
    +
    513  connect(PlainButton, SIGNAL(clicked()), this, SLOT(slotCreatePlainTool()));
    514 
    -
    515  connect(RectangleButton,SIGNAL(pressed()), this, SLOT(slotResetTools()));
    -
    516  connect(RectangleButton, SIGNAL(clicked()), this, SLOT(slotCreateRectangleTool()));
    +
    515  connect(PolygonButton,SIGNAL(pressed()), this, SLOT(slotResetTools()));
    +
    516  connect(PolygonButton, SIGNAL(clicked()), this, SLOT(slotCreatePolygonTool()));
    517 
    -
    518  actionSetWidth = new QAction(tr("&Set Width"),this);
    -
    519  actionSetWidth->setShortcut(QKeySequence(Qt::ALT + Qt::Key_W));
    -
    520  connect(actionSetWidth, SIGNAL(triggered()), this, SLOT(slotSetWidth()));
    -
    521 
    -
    522  actionSetInnerAlpha = new QAction(tr("&Set Inner Alpha"),this);
    -
    523  actionSetInnerAlpha->setShortcut(QKeySequence(Qt::ALT + Qt::Key_A));
    -
    524  connect(actionSetInnerAlpha, SIGNAL(triggered()), this, SLOT(slotSetInnerAlpha()));
    -
    525 }
    -
    526 
    -
    527 // Create the menubar
    -
    528 void IntelliPhotoGui::createMenus(){
    -
    529  // Create Save As option and the list of file types
    -
    530  saveAsMenu = new QMenu(tr("&Save As"), this);
    -
    531  foreach (QAction * action, actionSaveAs)
    -
    532  saveAsMenu->addAction(action);
    -
    533 
    -
    534  // Attach all actions to File
    -
    535  fileMenu = new QMenu(tr("&File"), this);
    -
    536  fileMenu->addAction(actionOpen);
    -
    537  fileMenu->addMenu(saveAsMenu);
    -
    538  fileMenu->addSeparator();
    -
    539  fileMenu->addAction(actionExit);
    -
    540 
    -
    541  //Attach all actions to Render Settings
    -
    542  renderMenu = new QMenu(tr("&Fast Renderer"), this);
    -
    543  renderMenu->addAction(actionUpdateRenderSettingsOn);
    -
    544  renderMenu->addAction(actionUpdateRenderSettingsOff);
    -
    545 
    -
    546  //Attach all Layer Creations to Menu
    -
    547  layerCreationMenu = new QMenu(tr("&Create new Layer"), this);
    -
    548  layerCreationMenu->addAction(actionCreateNewRasterLayer);
    -
    549  layerCreationMenu->addAction(actionCreateNewShapedLayer);
    -
    550  // Attach all actions to Layer
    -
    551  layerMenu = new QMenu(tr("&Layer"), this);
    -
    552  layerMenu->addMenu(layerCreationMenu);
    -
    553  layerMenu->addSeparator();
    -
    554  layerMenu->addAction(actionSetActiveAlpha);
    -
    555  layerMenu->addAction(actionSetActiveLayer);
    -
    556  layerMenu->addAction(actionSetPolygon);
    -
    557  layerMenu->addSeparator();
    -
    558  layerMenu->addAction(actionMovePositionUp);
    -
    559  layerMenu->addAction(actionMovePositionDown);
    -
    560  layerMenu->addAction(actionMovePositionLeft);
    -
    561  layerMenu->addAction(actionMovePositionRight);
    -
    562  layerMenu->addAction(actionMoveLayerUp);
    -
    563  layerMenu->addAction(actionMoveLayerDown);
    -
    564  layerMenu->addSeparator();
    -
    565  layerMenu->addAction(actionDeleteLayer);
    -
    566 
    -
    567  //Attach all Color Options
    -
    568  colorMenu = new QMenu(tr("&Color"), this);
    -
    569  colorMenu->addAction(actionColorPickerFirstColor);
    -
    570  colorMenu->addAction(actionColorPickerSecondColor);
    -
    571  colorMenu->addAction(actionColorSwap);
    -
    572 
    -
    573  //Attach all Tool Creation Actions
    -
    574  toolCreationMenu = new QMenu(tr("&Drawingtools"), this);
    -
    575  toolCreationMenu->addAction(actionCreateCircleTool);
    -
    576  toolCreationMenu->addAction(actionCreateFloodFillTool);
    -
    577  toolCreationMenu->addAction(actionCreateLineTool);
    -
    578  toolCreationMenu->addAction(actionCreatePenTool);
    -
    579  toolCreationMenu->addAction(actionCreatePlainTool);
    -
    580  toolCreationMenu->addAction(actionCreatePolygonTool);
    -
    581  toolCreationMenu->addAction(actionCreateRectangleTool);
    -
    582 
    -
    583  //Attach all Tool Setting Actions
    -
    584  toolSettingsMenu = new QMenu(tr("&Toolsettings"), this);
    -
    585  toolSettingsMenu->addAction(actionSetWidth);
    -
    586  toolSettingsMenu->addAction(actionSetInnerAlpha);
    -
    587 
    -
    588  //Attach all Tool Options
    -
    589  toolMenu = new QMenu(tr("&Tools"), this);
    -
    590  toolMenu->addMenu(toolCreationMenu);
    -
    591  toolMenu->addMenu(toolSettingsMenu);
    -
    592  toolMenu->addSeparator();
    -
    593  toolMenu->addMenu(colorMenu);
    -
    594 
    -
    595  // Attach all actions to Options
    -
    596  optionMenu = new QMenu(tr("&Options"), this);
    -
    597  optionMenu->addMenu(layerMenu);
    -
    598  optionMenu->addMenu(toolMenu);
    -
    599  optionMenu->addSeparator();
    -
    600  optionMenu->addMenu(renderMenu);
    -
    601  optionMenu->addAction(actionChangeDim);
    -
    602 
    -
    603  // Attach all actions to Help
    -
    604  helpMenu = new QMenu(tr("&Help"), this);
    -
    605  helpMenu->addAction(actionAboutDialog);
    -
    606  helpMenu->addAction(actionAboutQtDialog);
    -
    607 
    -
    608  // Add menu items to the menubar
    -
    609  menuBar()->addMenu(fileMenu);
    -
    610  menuBar()->addMenu(optionMenu);
    -
    611  menuBar()->addMenu(helpMenu);
    -
    612 }
    -
    613 
    -
    614 void IntelliPhotoGui::createGui(){
    -
    615  // create a central widget to work on
    -
    616  centralGuiWidget = new QWidget(this);
    -
    617  setCentralWidget(centralGuiWidget);
    -
    618 
    -
    619  // create the grid for the layout
    -
    620  mainLayout = new QGridLayout(centralGuiWidget);
    -
    621  centralGuiWidget->setLayout(mainLayout);
    -
    622 
    -
    623  // create Gui elements
    -
    624  // get and set max width and height
    -
    625  paintingArea = new PaintingArea(1280, 720);
    -
    626  paintingArea->DummyGui = this;
    -
    627 
    -
    628  preview = QPixmap(":/Icons/Buttons/icons/circle-tool.svg");
    -
    629  CircleButton = new QPushButton();
    -
    630  CircleButton->setFixedSize(Buttonsize);
    -
    631  CircleButton->setIcon(preview);
    -
    632  CircleButton->setIconSize(Buttonsize);
    -
    633  CircleButton->setCheckable(true);
    -
    634 
    -
    635  preview = QPixmap(":/Icons/Buttons/icons/flood-fill-tool.svg");
    -
    636  FloodFillButton = new QPushButton();
    -
    637  FloodFillButton->setFixedSize(Buttonsize);
    -
    638  FloodFillButton->setIcon(preview);
    -
    639  FloodFillButton->setIconSize(Buttonsize);
    -
    640  FloodFillButton->setCheckable(true);
    -
    641 
    -
    642  preview = QPixmap(":/Icons/Buttons/icons/line-tool.svg");
    -
    643  LineButton = new QPushButton();
    -
    644  LineButton->setFixedSize(Buttonsize);
    -
    645  LineButton->setIcon(preview);
    -
    646  LineButton->setIconSize(Buttonsize);
    -
    647  LineButton->setCheckable(true);
    -
    648 
    -
    649  preview = QPixmap(":/Icons/Buttons/icons/pen-tool.svg");
    -
    650  PenButton = new QPushButton();
    -
    651  PenButton->setFixedSize(Buttonsize);
    -
    652  PenButton->setIcon(preview);
    -
    653  PenButton->setIconSize(Buttonsize);
    -
    654  PenButton->setCheckable(true);
    -
    655 
    -
    656  preview = QPixmap(":/Icons/Buttons/icons/plain-tool.svg");
    -
    657  PlainButton = new QPushButton();
    -
    658  PlainButton->setFixedSize(Buttonsize);
    -
    659  PlainButton->setIcon(preview);
    -
    660  PlainButton->setIconSize(Buttonsize);
    -
    661  PlainButton->setCheckable(true);
    -
    662 
    -
    663  preview = QPixmap(":/Icons/Buttons/icons/polygon-tool.svg");
    -
    664  PolygonButton = new QPushButton();
    -
    665  PolygonButton->setFixedSize(Buttonsize);
    -
    666  PolygonButton->setIcon(preview);
    -
    667  PolygonButton->setIconSize(Buttonsize);
    -
    668  PolygonButton->setCheckable(true);
    -
    669 
    -
    670  preview = QPixmap(":/Icons/Buttons/icons/rectangle-tool.svg");
    -
    671  RectangleButton = new QPushButton();
    -
    672  RectangleButton->setFixedSize(Buttonsize);
    -
    673  RectangleButton->setIcon(preview);
    -
    674  RectangleButton->setIconSize(Buttonsize);
    -
    675  RectangleButton->setCheckable(true);
    -
    676 
    -
    677  WidthLine = new QLabel();
    -
    678  WidthLine->setText("Width");
    -
    679  WidthLine->setFixedSize(Buttonsize.width() * 2,(Buttonsize.height() * 2) / 3);
    -
    680 
    -
    681  EditLineWidth = new QLineEdit();
    -
    682  EditLineWidth->setFixedSize(Buttonsize.width() * 2,(Buttonsize.height() * 2) / 3);
    -
    683  EditLineWidth->setText("5");
    -
    684  ValidatorLineWidth = new QIntValidator();
    -
    685  ValidatorLineWidth->setTop(99);
    -
    686  ValidatorLineWidth->setBottom(1);
    -
    687  EditLineWidth->setValidator(ValidatorLineWidth);
    -
    688 
    -
    689  innerAlphaLine = new QLabel();
    -
    690  innerAlphaLine->setText("Inner Alpha");
    -
    691  innerAlphaLine->setFixedSize(Buttonsize.width() * 2,(Buttonsize.height() * 2) / 3);
    -
    692 
    -
    693  EditLineInnerAlpha = new QLineEdit();
    -
    694  EditLineInnerAlpha->setFixedSize(Buttonsize.width() * 2,(Buttonsize.height() * 2) / 3);
    -
    695  EditLineInnerAlpha->setText("255");
    -
    696  ValidatorInnerAlpha = new QIntValidator();
    -
    697  ValidatorInnerAlpha->setTop(999);
    -
    698  ValidatorInnerAlpha->setBottom(0);
    -
    699  EditLineInnerAlpha->setValidator(ValidatorInnerAlpha);
    -
    700 
    -
    701  FirstColorButton = new QPushButton();
    -
    702  FirstColorButton->setFixedSize(Buttonsize);
    +
    518  connect(RectangleButton,SIGNAL(pressed()), this, SLOT(slotResetTools()));
    +
    519  connect(RectangleButton, SIGNAL(clicked()), this, SLOT(slotCreateRectangleTool()));
    +
    520 
    +
    521  actionSetWidth = new QAction(tr("&Set Width"),this);
    +
    522  actionSetWidth->setShortcut(QKeySequence(Qt::ALT + Qt::Key_W));
    +
    523  connect(actionSetWidth, SIGNAL(triggered()), this, SLOT(slotSetWidth()));
    +
    524 
    +
    525  actionSetInnerAlpha = new QAction(tr("&Set Inner Alpha"),this);
    +
    526  actionSetInnerAlpha->setShortcut(QKeySequence(Qt::ALT + Qt::Key_A));
    +
    527  connect(actionSetInnerAlpha, SIGNAL(triggered()), this, SLOT(slotSetInnerAlpha()));
    +
    528 }
    +
    529 
    +
    530 // Create the menubar
    +
    531 void IntelliPhotoGui::createMenus(){
    +
    532  // Create Save As option and the list of file types
    +
    533  saveAsMenu = new QMenu(tr("&Save As"), this);
    +
    534  foreach (QAction * action, actionSaveAs)
    +
    535  saveAsMenu->addAction(action);
    +
    536 
    +
    537  // Attach all actions to File
    +
    538  fileMenu = new QMenu(tr("&File"), this);
    +
    539  fileMenu->addAction(actionOpen);
    +
    540  fileMenu->addMenu(saveAsMenu);
    +
    541  fileMenu->addSeparator();
    +
    542  fileMenu->addAction(actionExit);
    +
    543 
    +
    544  //Attach all actions to Render Settings
    +
    545  renderMenu = new QMenu(tr("&Fast Renderer"), this);
    +
    546  renderMenu->addAction(actionUpdateRenderSettingsOn);
    +
    547  renderMenu->addAction(actionUpdateRenderSettingsOff);
    +
    548 
    +
    549  //Attach all Layer Creations to Menu
    +
    550  layerCreationMenu = new QMenu(tr("&Create new Layer"), this);
    +
    551  layerCreationMenu->addAction(actionCreateNewRasterLayer);
    +
    552  layerCreationMenu->addAction(actionCreateNewShapedLayer);
    +
    553  // Attach all actions to Layer
    +
    554  layerMenu = new QMenu(tr("&Layer"), this);
    +
    555  layerMenu->addMenu(layerCreationMenu);
    +
    556  layerMenu->addSeparator();
    +
    557  layerMenu->addAction(actionSetActiveAlpha);
    +
    558  layerMenu->addAction(actionSetActiveLayer);
    +
    559  layerMenu->addAction(actionSetPolygon);
    +
    560  layerMenu->addSeparator();
    +
    561  layerMenu->addAction(actionMovePositionUp);
    +
    562  layerMenu->addAction(actionMovePositionDown);
    +
    563  layerMenu->addAction(actionMovePositionLeft);
    +
    564  layerMenu->addAction(actionMovePositionRight);
    +
    565  layerMenu->addAction(actionMoveLayerUp);
    +
    566  layerMenu->addAction(actionMoveLayerDown);
    +
    567  layerMenu->addSeparator();
    +
    568  layerMenu->addAction(actionDeleteLayer);
    +
    569 
    +
    570  //Attach all Color Options
    +
    571  colorMenu = new QMenu(tr("&Color"), this);
    +
    572  colorMenu->addAction(actionColorPickerFirstColor);
    +
    573  colorMenu->addAction(actionColorPickerSecondColor);
    +
    574  colorMenu->addAction(actionColorSwap);
    +
    575 
    +
    576  //Attach all Tool Creation Actions
    +
    577  toolCreationMenu = new QMenu(tr("&Drawingtools"), this);
    +
    578  toolCreationMenu->addAction(actionCreateCircleTool);
    +
    579  toolCreationMenu->addAction(actionCreateFloodFillTool);
    +
    580  toolCreationMenu->addAction(actionCreateLineTool);
    +
    581  toolCreationMenu->addAction(actionCreatePenTool);
    +
    582  toolCreationMenu->addAction(actionCreatePlainTool);
    +
    583  toolCreationMenu->addAction(actionCreatePolygonTool);
    +
    584  toolCreationMenu->addAction(actionCreateRectangleTool);
    +
    585 
    +
    586  //Attach all Tool Setting Actions
    +
    587  toolSettingsMenu = new QMenu(tr("&Toolsettings"), this);
    +
    588  toolSettingsMenu->addAction(actionSetWidth);
    +
    589  toolSettingsMenu->addAction(actionSetInnerAlpha);
    +
    590 
    +
    591  //Attach all Tool Options
    +
    592  toolMenu = new QMenu(tr("&Tools"), this);
    +
    593  toolMenu->addMenu(toolCreationMenu);
    +
    594  toolMenu->addMenu(toolSettingsMenu);
    +
    595  toolMenu->addSeparator();
    +
    596  toolMenu->addMenu(colorMenu);
    +
    597 
    +
    598  // Attach all actions to Options
    +
    599  optionMenu = new QMenu(tr("&Options"), this);
    +
    600  optionMenu->addMenu(layerMenu);
    +
    601  optionMenu->addMenu(toolMenu);
    +
    602  optionMenu->addSeparator();
    +
    603  optionMenu->addMenu(renderMenu);
    +
    604  optionMenu->addAction(actionChangeDim);
    +
    605 
    +
    606  // Attach all actions to Help
    +
    607  helpMenu = new QMenu(tr("&Help"), this);
    +
    608  helpMenu->addAction(actionAboutDialog);
    +
    609  helpMenu->addAction(actionAboutQtDialog);
    +
    610 
    +
    611  // Add menu items to the menubar
    +
    612  menuBar()->addMenu(fileMenu);
    +
    613  menuBar()->addMenu(optionMenu);
    +
    614  menuBar()->addMenu(helpMenu);
    +
    615 }
    +
    616 
    +
    617 void IntelliPhotoGui::createGui(){
    +
    618  // create a central widget to work on
    +
    619  centralGuiWidget = new QWidget(this);
    +
    620  setCentralWidget(centralGuiWidget);
    +
    621 
    +
    622  // create the grid for the layout
    +
    623  mainLayout = new QGridLayout(centralGuiWidget);
    +
    624  centralGuiWidget->setLayout(mainLayout);
    +
    625 
    +
    626  // create Gui elements
    +
    627  // get and set max width and height
    +
    628  paintingArea = new PaintingArea(1280, 720);
    +
    629  paintingArea->DummyGui = this;
    +
    630 
    +
    631  preview = QPixmap(":/Icons/Buttons/icons/circle-tool.svg");
    +
    632  CircleButton = new QPushButton();
    +
    633  CircleButton->setFixedSize(Buttonsize);
    +
    634  CircleButton->setIcon(preview);
    +
    635  CircleButton->setIconSize(Buttonsize);
    +
    636  CircleButton->setCheckable(true);
    +
    637 
    +
    638  preview = QPixmap(":/Icons/Buttons/icons/flood-fill-tool.svg");
    +
    639  FloodFillButton = new QPushButton();
    +
    640  FloodFillButton->setFixedSize(Buttonsize);
    +
    641  FloodFillButton->setIcon(preview);
    +
    642  FloodFillButton->setIconSize(Buttonsize);
    +
    643  FloodFillButton->setCheckable(true);
    +
    644 
    +
    645  preview = QPixmap(":/Icons/Buttons/icons/line-tool.svg");
    +
    646  LineButton = new QPushButton();
    +
    647  LineButton->setFixedSize(Buttonsize);
    +
    648  LineButton->setIcon(preview);
    +
    649  LineButton->setIconSize(Buttonsize);
    +
    650  LineButton->setCheckable(true);
    +
    651 
    +
    652  preview = QPixmap(":/Icons/Buttons/icons/pen-tool.svg");
    +
    653  PenButton = new QPushButton();
    +
    654  PenButton->setFixedSize(Buttonsize);
    +
    655  PenButton->setIcon(preview);
    +
    656  PenButton->setIconSize(Buttonsize);
    +
    657  PenButton->setCheckable(true);
    +
    658 
    +
    659  preview = QPixmap(":/Icons/Buttons/icons/plain-tool.svg");
    +
    660  PlainButton = new QPushButton();
    +
    661  PlainButton->setFixedSize(Buttonsize);
    +
    662  PlainButton->setIcon(preview);
    +
    663  PlainButton->setIconSize(Buttonsize);
    +
    664  PlainButton->setCheckable(true);
    +
    665 
    +
    666  preview = QPixmap(":/Icons/Buttons/icons/polygon-tool.svg");
    +
    667  PolygonButton = new QPushButton();
    +
    668  PolygonButton->setFixedSize(Buttonsize);
    +
    669  PolygonButton->setIcon(preview);
    +
    670  PolygonButton->setIconSize(Buttonsize);
    +
    671  PolygonButton->setCheckable(true);
    +
    672 
    +
    673  preview = QPixmap(":/Icons/Buttons/icons/rectangle-tool.svg");
    +
    674  RectangleButton = new QPushButton();
    +
    675  RectangleButton->setFixedSize(Buttonsize);
    +
    676  RectangleButton->setIcon(preview);
    +
    677  RectangleButton->setIconSize(Buttonsize);
    +
    678  RectangleButton->setCheckable(true);
    +
    679 
    +
    680  WidthLine = new QLabel();
    +
    681  WidthLine->setText("Width");
    +
    682  WidthLine->setFixedSize(Buttonsize.width() * 2,(Buttonsize.height() * 2) / 3);
    +
    683 
    +
    684  EditLineWidth = new QLineEdit();
    +
    685  EditLineWidth->setFixedSize(Buttonsize.width() * 2,(Buttonsize.height() * 2) / 3);
    +
    686  EditLineWidth->setText("5");
    +
    687  ValidatorLineWidth = new QIntValidator();
    +
    688  ValidatorLineWidth->setTop(99);
    +
    689  ValidatorLineWidth->setBottom(1);
    +
    690  EditLineWidth->setValidator(ValidatorLineWidth);
    +
    691 
    +
    692  innerAlphaLine = new QLabel();
    +
    693  innerAlphaLine->setText("Inner Alpha");
    +
    694  innerAlphaLine->setFixedSize(Buttonsize.width() * 2,(Buttonsize.height() * 2) / 3);
    +
    695 
    +
    696  EditLineInnerAlpha = new QLineEdit();
    +
    697  EditLineInnerAlpha->setFixedSize(Buttonsize.width() * 2,(Buttonsize.height() * 2) / 3);
    +
    698  EditLineInnerAlpha->setText("255");
    +
    699  ValidatorInnerAlpha = new QIntValidator();
    +
    700  ValidatorInnerAlpha->setTop(999);
    +
    701  ValidatorInnerAlpha->setBottom(0);
    +
    702  EditLineInnerAlpha->setValidator(ValidatorInnerAlpha);
    703 
    -
    704  SecondColorButton = new QPushButton();
    -
    705  SecondColorButton->setFixedSize(Buttonsize);
    +
    704  FirstColorButton = new QPushButton();
    +
    705  FirstColorButton->setFixedSize(Buttonsize);
    706 
    -
    707  preview = QPixmap(":/Icons/Buttons/icons/Wechselpfeile.png");
    -
    708  SwitchColorButton = new QPushButton();
    -
    709  SwitchColorButton->setFixedSize(Buttonsize.width() * 2,Buttonsize.height());
    -
    710  SwitchColorButton->setIcon(preview);
    -
    711  SwitchColorButton->setIconSize(QSize(Buttonsize.width() * 2,Buttonsize.height()));
    -
    712 
    -
    713  ActiveLayerLine = new QLabel();
    -
    714  QString string = QString("Active Layer: %1").arg(paintingArea->getNumberOfActiveLayer() + 1);
    -
    715  ActiveLayerLine->setText(string);
    -
    716  ActiveLayerLine->setFixedSize(Buttonsize.width() * 2 + 10,(Buttonsize.height() * 2) / 3);
    -
    717 
    -
    718  IntelliImage* activePicture = paintingArea->getImageOfActiveLayer();
    -
    719  if(activePicture) {
    -
    720  preview = preview.fromImage(activePicture->getImageData());
    -
    721  }else{
    -
    722  QImage tmp(1,1,QImage::Format_ARGB32);
    -
    723  tmp.fill(Qt::transparent);
    -
    724  preview = preview.fromImage(tmp);
    -
    725  }
    -
    726 
    -
    727  ActiveLayerImageLabel = new QLabel();
    -
    728  ActiveLayerImageLabel->setFixedSize(Buttonsize * 2);
    -
    729  ActiveLayerImageLabel->setPixmap(preview.scaled(Buttonsize * 2));
    -
    730 
    -
    731  dimActive = new QPushButton();
    -
    732  dimActive->setFixedSize(Buttonsize.width() * 2,Buttonsize.height() / 2);
    -
    733  dimActive->setText("0x0");
    -
    734 
    -
    735  dimCanvas = new QPushButton();
    -
    736  dimCanvas->setFixedSize(Buttonsize.width() * 2,Buttonsize.height() / 2);
    -
    737  QString String = QString("%1x%2").arg(paintingArea->Canvas->width()).arg(paintingArea->Canvas->height());
    -
    738  dimCanvas->setText(String);
    -
    739 
    -
    740  // set gui elements
    -
    741  mainLayout->addWidget(paintingArea,1,1,20,1);
    -
    742  mainLayout->addWidget(CircleButton,1,2,1,1);
    -
    743  mainLayout->addWidget(FloodFillButton,1,3,1,1);
    -
    744  mainLayout->addWidget(LineButton,2,2,1,1);
    -
    745  mainLayout->addWidget(PenButton,2,3,1,1);
    -
    746  mainLayout->addWidget(PlainButton,3,2,1,1);
    -
    747  mainLayout->addWidget(PolygonButton,3,3,1,1);
    -
    748  mainLayout->addWidget(RectangleButton,4,2,1,1);
    -
    749  mainLayout->addWidget(WidthLine,5,2,1,2);
    -
    750  mainLayout->addWidget(EditLineWidth,6,2,1,2);
    -
    751  mainLayout->addWidget(innerAlphaLine,7,2,1,2);
    -
    752  mainLayout->addWidget(EditLineInnerAlpha,8,2,1,2);
    -
    753  mainLayout->addWidget(FirstColorButton,9,2,1,1);
    -
    754  mainLayout->addWidget(SecondColorButton,9,3,1,1);
    -
    755  mainLayout->addWidget(SwitchColorButton,10,2,1,2);
    -
    756  mainLayout->addWidget(ActiveLayerLine,11,2,1,2);
    -
    757  mainLayout->addWidget(ActiveLayerImageLabel,12,2,1,2);
    -
    758  mainLayout->addWidget(dimActive,13,2,1,2);
    -
    759  mainLayout->addWidget(dimCanvas,14,2,1,2);
    -
    760  mainLayout->setHorizontalSpacing(0);
    -
    761 }
    -
    762 
    -
    763 void IntelliPhotoGui::setIntelliStyle(){
    -
    764  // Set the title
    -
    765  setWindowTitle("IntelliPhoto Prototype");
    -
    766  // Set style sheet
    -
    767  this->setStyleSheet("color: white;" "background-color: rgb(64, 64, 64);" "selection-color: rgb(200, 10, 10);" "selection-background-color: rgb(64, 64, 64);");
    -
    768 
    -
    769  QString string = QString("background-color: %1").arg(paintingArea->colorPicker.getFirstColor().name());
    -
    770  FirstColorButton->setStyleSheet(string);
    -
    771  string = QString("background-color: %1").arg(paintingArea->colorPicker.getSecondColor().name());
    -
    772  SecondColorButton->setStyleSheet(string);
    -
    773 }
    -
    774 
    -
    775 bool IntelliPhotoGui::maybeSave(){
    -
    776  // Check for changes since last save
    +
    707  SecondColorButton = new QPushButton();
    +
    708  SecondColorButton->setFixedSize(Buttonsize);
    +
    709 
    +
    710  preview = QPixmap(":/Icons/Buttons/icons/Wechselpfeile.png");
    +
    711  SwitchColorButton = new QPushButton();
    +
    712  SwitchColorButton->setFixedSize(Buttonsize.width() * 2,Buttonsize.height());
    +
    713  SwitchColorButton->setIcon(preview);
    +
    714  SwitchColorButton->setIconSize(QSize(Buttonsize.width() * 2,Buttonsize.height()));
    +
    715 
    +
    716  ActiveLayerLine = new QLabel();
    +
    717  QString string = QString("Active Layer: %1").arg(paintingArea->getNumberOfActiveLayer() + 1);
    +
    718  ActiveLayerLine->setText(string);
    +
    719  ActiveLayerLine->setFixedSize(Buttonsize.width() * 2 + 10,(Buttonsize.height() * 2) / 3);
    +
    720 
    +
    721  IntelliImage* activePicture = paintingArea->getImageOfActiveLayer();
    +
    722  if(activePicture) {
    +
    723  preview = preview.fromImage(activePicture->getImageData());
    +
    724  }else{
    +
    725  QImage tmp(1,1,QImage::Format_ARGB32);
    +
    726  tmp.fill(Qt::transparent);
    +
    727  preview = preview.fromImage(tmp);
    +
    728  }
    +
    729 
    +
    730  ActiveLayerImageLabel = new QLabel();
    +
    731  ActiveLayerImageLabel->setFixedSize(Buttonsize * 2);
    +
    732  ActiveLayerImageLabel->setPixmap(preview.scaled(Buttonsize * 2));
    +
    733 
    +
    734  dimActive = new QPushButton();
    +
    735  dimActive->setFixedSize(Buttonsize.width() * 2,Buttonsize.height() / 2);
    +
    736  dimActive->setText("0x0");
    +
    737 
    +
    738  dimCanvas = new QPushButton();
    +
    739  dimCanvas->setFixedSize(Buttonsize.width() * 2,Buttonsize.height() / 2);
    +
    740  QString String = QString("%1x%2").arg(paintingArea->Canvas->width()).arg(paintingArea->Canvas->height());
    +
    741  dimCanvas->setText(String);
    +
    742 
    +
    743  // set gui elements
    +
    744  mainLayout->addWidget(paintingArea,1,1,20,1);
    +
    745  mainLayout->addWidget(CircleButton,1,2,1,1);
    +
    746  mainLayout->addWidget(FloodFillButton,1,3,1,1);
    +
    747  mainLayout->addWidget(LineButton,2,2,1,1);
    +
    748  mainLayout->addWidget(PenButton,2,3,1,1);
    +
    749  mainLayout->addWidget(PlainButton,3,2,1,1);
    +
    750  mainLayout->addWidget(PolygonButton,3,3,1,1);
    +
    751  mainLayout->addWidget(RectangleButton,4,2,1,1);
    +
    752  mainLayout->addWidget(WidthLine,5,2,1,2);
    +
    753  mainLayout->addWidget(EditLineWidth,6,2,1,2);
    +
    754  mainLayout->addWidget(innerAlphaLine,7,2,1,2);
    +
    755  mainLayout->addWidget(EditLineInnerAlpha,8,2,1,2);
    +
    756  mainLayout->addWidget(FirstColorButton,9,2,1,1);
    +
    757  mainLayout->addWidget(SecondColorButton,9,3,1,1);
    +
    758  mainLayout->addWidget(SwitchColorButton,10,2,1,2);
    +
    759  mainLayout->addWidget(ActiveLayerLine,11,2,1,2);
    +
    760  mainLayout->addWidget(ActiveLayerImageLabel,12,2,1,2);
    +
    761  mainLayout->addWidget(dimActive,13,2,1,2);
    +
    762  mainLayout->addWidget(dimCanvas,14,2,1,2);
    +
    763  mainLayout->setHorizontalSpacing(0);
    +
    764 }
    +
    765 
    +
    766 void IntelliPhotoGui::setIntelliStyle(){
    +
    767  // Set the title
    +
    768  setWindowTitle("IntelliPhoto Prototype");
    +
    769  // Set style sheet
    +
    770  this->setStyleSheet("color: white;" "background-color: rgb(64, 64, 64);" "selection-color: rgb(200, 10, 10);" "selection-background-color: rgb(64, 64, 64);");
    +
    771 
    +
    772  QString string = QString("background-color: %1").arg(paintingArea->colorPicker.getFirstColor().name());
    +
    773  FirstColorButton->setStyleSheet(string);
    +
    774  string = QString("background-color: %1").arg(paintingArea->colorPicker.getSecondColor().name());
    +
    775  SecondColorButton->setStyleSheet(string);
    +
    776 }
    777 
    -
    778  // TODO insert variable for modified status here to make an save exit message
    -
    779  if (false) {
    -
    780  QMessageBox::StandardButton ret;
    -
    781 
    -
    782  // Painting is the title of the window
    -
    783  // Add text and the buttons
    -
    784  ret = QMessageBox::warning(this, tr("Painting"),
    -
    785  tr("The image has been modified.\n"
    -
    786  "Do you want to save your changes?"),
    -
    787  QMessageBox::Save | QMessageBox::Discard
    -
    788  | QMessageBox::Cancel);
    -
    789 
    -
    790  // If save button clicked call for file to be saved
    -
    791  if (ret == QMessageBox::Save) {
    -
    792  return saveFile("png");
    -
    793 
    -
    794  // If cancel do nothing
    -
    795  } else if (ret == QMessageBox::Cancel) {
    -
    796  return false;
    -
    797  }
    +
    778 bool IntelliPhotoGui::maybeSave(){
    +
    779  // Check for changes since last save
    +
    780 #ifdef QT_NO_DEBUG
    +
    781  QMessageBox::StandardButton ret;
    +
    782 
    +
    783  // Painting is the title of the window
    +
    784  // Add text and the buttons
    +
    785  ret = QMessageBox::warning(this, tr("Painting"),
    +
    786  tr("The image has been modified.\n"
    +
    787  "Do you want to save your changes?"),
    +
    788  QMessageBox::Save | QMessageBox::Discard
    +
    789  | QMessageBox::Cancel);
    +
    790 
    +
    791  // If save button clicked call for file to be saved
    +
    792  if (ret == QMessageBox::Save) {
    +
    793  return saveFile("png");
    +
    794 
    +
    795  // If cancel do nothing
    +
    796  } else if (ret == QMessageBox::Cancel) {
    +
    797  return false;
    798  }
    -
    799  return true;
    -
    800 }
    -
    801 
    -
    802 bool IntelliPhotoGui::saveFile(const QByteArray &fileFormat){
    -
    803  // Define path, name and default file type
    -
    804  QString initialPath = QDir::currentPath() + "/untitled." + fileFormat;
    -
    805 
    -
    806  // Get selected file from dialog
    -
    807  // Add the proper file formats and extensions
    -
    808  QString fileName = QFileDialog::getSaveFileName(this, tr("Save As"),
    -
    809  initialPath,
    -
    810  tr("%1 Files (*.%2);;All Files (*)")
    -
    811  .arg(QString::fromLatin1(fileFormat.toUpper()))
    -
    812  .arg(QString::fromLatin1(fileFormat)), nullptr, QFileDialog::DontUseNativeDialog);
    -
    813 
    -
    814  // If no file do nothing
    -
    815  if (fileName.isEmpty()) {
    -
    816  return false;
    -
    817  } else {
    -
    818  // Call for the file to be saved
    -
    819  return paintingArea->save(fileName, fileFormat.constData());
    -
    820  }
    -
    821 }
    -
    822 
    -
    823 void IntelliPhotoGui::setDefaultToolValue(){
    -
    824  slotEnterPressed();
    -
    825 }
    -
    826 
    - -
    828  if(value < 1) {
    -
    829  value = 1;
    -
    830  }else if(value > 50) {
    -
    831  value = 50;
    -
    832  }
    -
    833  EditLineWidth->setText(QString("%1").arg(value));
    -
    834 }
    -
    835 
    - -
    837  QString string = QString("Active Layer: %1").arg(paintingArea->getNumberOfActiveLayer() + 1);
    -
    838  ActiveLayerLine->setText(string);
    -
    839 
    -
    840  IntelliImage* activePicture = paintingArea->getImageOfActiveLayer();
    -
    841  if(activePicture) {
    -
    842  preview = preview.fromImage(activePicture->getImageData());
    -
    843  }else{
    -
    844  QImage tmp(1,1,QImage::Format_ARGB32);
    -
    845  tmp.fill(Qt::transparent);
    -
    846  preview = preview.fromImage(tmp);
    -
    847  }
    -
    848  ActiveLayerImageLabel->setPixmap(preview.scaled(Buttonsize * 2));
    -
    849 
    -
    850  string = QString("background-color: %1").arg(paintingArea->colorPicker.getFirstColor().name());
    -
    851  FirstColorButton->setStyleSheet(string);
    -
    852  string = QString("background-color: %1").arg(paintingArea->colorPicker.getSecondColor().name());
    -
    853  SecondColorButton->setStyleSheet(string);
    -
    854 
    -
    855  string = QString("%1x%2").arg(paintingArea->Canvas->width()).arg(paintingArea->Canvas->height());
    -
    856  dimCanvas->setText(string);
    -
    857 
    -
    858  if(paintingArea->layerBundle.size() != 0) {
    -
    859  string = QString("%1x%2").arg(paintingArea->layerBundle[static_cast<unsigned long long>(paintingArea->getNumberOfActiveLayer())].width).arg(paintingArea->layerBundle[static_cast<unsigned long long>(paintingArea->getNumberOfActiveLayer())].height);
    -
    860  dimActive->setText(string);
    -
    861  }
    -
    862  else{
    -
    863  dimActive->setText("0x0");
    +
    799 #endif
    +
    800  return true;
    +
    801 }
    +
    802 
    +
    803 bool IntelliPhotoGui::saveFile(const QByteArray &fileFormat){
    +
    804  // Define path, name and default file type
    +
    805  QString initialPath = QDir::currentPath() + "/untitled." + fileFormat;
    +
    806 
    +
    807  // Get selected file from dialog
    +
    808  // Add the proper file formats and extensions
    +
    809  QString fileName = QFileDialog::getSaveFileName(this, tr("Save As"),
    +
    810  initialPath,
    +
    811  tr("%1 Files (*.%2);;All Files (*)")
    +
    812  .arg(QString::fromLatin1(fileFormat.toUpper()))
    +
    813  .arg(QString::fromLatin1(fileFormat)), nullptr, QFileDialog::DontUseNativeDialog);
    +
    814 
    +
    815  // If no file do nothing
    +
    816  if (fileName.isEmpty()) {
    +
    817  return false;
    +
    818  } else {
    +
    819  // Call for the file to be saved
    +
    820  return paintingArea->save(fileName, fileFormat.constData());
    +
    821  }
    +
    822 }
    +
    823 
    +
    824 void IntelliPhotoGui::setDefaultToolValue(){
    +
    825  slotEnterPressed();
    +
    826 }
    +
    827 
    + +
    829  if(value < 1) {
    +
    830  value = 1;
    +
    831  }else if(value > 50) {
    +
    832  value = 50;
    +
    833  }
    +
    834  EditLineWidth->setText(QString("%1").arg(value));
    +
    835 }
    +
    836 
    + +
    838  QString string = QString("Active Layer: %1").arg(paintingArea->getNumberOfActiveLayer() + 1);
    +
    839  ActiveLayerLine->setText(string);
    +
    840 
    +
    841  IntelliImage* activePicture = paintingArea->getImageOfActiveLayer();
    +
    842  if(activePicture) {
    +
    843  preview = preview.fromImage(activePicture->getImageData());
    +
    844  }else{
    +
    845  QImage tmp(1,1,QImage::Format_ARGB32);
    +
    846  tmp.fill(Qt::transparent);
    +
    847  preview = preview.fromImage(tmp);
    +
    848  }
    +
    849  ActiveLayerImageLabel->setPixmap(preview.scaled(Buttonsize * 2));
    +
    850 
    +
    851  string = QString("background-color: %1").arg(paintingArea->colorPicker.getFirstColor().name());
    +
    852  FirstColorButton->setStyleSheet(string);
    +
    853  string = QString("background-color: %1").arg(paintingArea->colorPicker.getSecondColor().name());
    +
    854  SecondColorButton->setStyleSheet(string);
    +
    855 
    +
    856  string = QString("%1x%2").arg(paintingArea->Canvas->width()).arg(paintingArea->Canvas->height());
    +
    857  dimCanvas->setText(string);
    +
    858 
    +
    859  if(paintingArea->layerBundle.size() != 0) {
    +
    860  string = QString("%1x%2").arg(paintingArea->layerBundle[static_cast<size_t>
    +
    861  (paintingArea->getNumberOfActiveLayer())].width).arg(paintingArea->layerBundle[static_cast<size_t>
    +
    862  (paintingArea->getNumberOfActiveLayer())].height);
    +
    863  dimActive->setText(string);
    864  }
    -
    865 }
    +
    865  else{
    +
    866  dimActive->setText("0x0");
    +
    867  }
    +
    868 }
    void createCircleTool()
    @@ -964,9 +967,8 @@ $(document).ready(function(){initNavTree('_intelli_photo_gui_8cpp_source.html','
    void setLayerActive(int idx)
    The setLayerToActive method marks a specific layer as active.
    void deleteLayer(int idx, bool isTool=false)
    The deleteLayer method removes a layer at a given idx.
    -
    QColor getSecondColor()
    A function to read the secondary selected color.
    void createPlainTool()
    -
    IntelliPhotoGui()
    The IntelliPhotoGui method is the constructor and is used to create a new instance of the main progra...
    +
    IntelliPhotoGui()
    The IntelliPhotoGui method is the constructor and is used to create a new instance of the main progra...
    The PaintingArea class manages the methods and stores information about the current painting area,...
    Definition: PaintingArea.h:53
    void createPenTool()
    QColor getSecondColor() const
    A function to read the secondary selected color.
    @@ -977,18 +979,17 @@ $(document).ready(function(){initNavTree('_intelli_photo_gui_8cpp_source.html','
    int getNumberOfActiveLayer()
    -
    void closeEvent(QCloseEvent *event) override
    The closeEvent function handles closing events.
    +
    void closeEvent(QCloseEvent *event) override
    The closeEvent function handles closing events.
    virtual QImage getImageData()
    getImageData returns the data of the current image (Note: It will allways return a ARGB32bit QImage!...
    -
    void setToolWidth(int value)
    +
    void setToolWidth(int value)
    bool open(const QString &filePath)
    The open method is used for loading a picture into the current layer.
    void createPolygonTool()
    void moveActiveLayer(int idx)
    The moveActiveLayer moves the active layer to a specific position in the layer stack.
    IntelliColorPicker colorPicker
    Definition: PaintingArea.h:202
    -
    QColor getFirstColor()
    A function to read the primary selected color.
    void createFloodFillTool()
    void setInnerAlpha(int innerAlpha)
    - +
    IntelliToolsettings Toolsettings
    Definition: PaintingArea.h:201
    void setPolygon(int idx)
    setPolygon is used for setting polygondata, it only works on RASTER images
    diff --git a/docs/html/_intelli_photo_gui_8h_source.html b/docs/html/_intelli_photo_gui_8h_source.html index e75e8b8..5a4d433 100644 --- a/docs/html/_intelli_photo_gui_8h_source.html +++ b/docs/html/_intelli_photo_gui_8h_source.html @@ -290,13 +290,13 @@ $(document).ready(function(){initNavTree('_intelli_photo_gui_8h_source.html','')
    The IntelliPhotoGui base class handles the graphical user interface and events for the intelliPhoto p...
    -
    IntelliPhotoGui()
    The IntelliPhotoGui method is the constructor and is used to create a new instance of the main progra...
    +
    IntelliPhotoGui()
    The IntelliPhotoGui method is the constructor and is used to create a new instance of the main progra...
    The PaintingArea class manages the methods and stores information about the current painting area,...
    Definition: PaintingArea.h:53
    An abstract class that manages the basic events, like mouse clicks or scrolls events.
    Definition: IntelliTool.h:17
    -
    void closeEvent(QCloseEvent *event) override
    The closeEvent function handles closing events.
    -
    void setToolWidth(int value)
    +
    void closeEvent(QCloseEvent *event) override
    The closeEvent function handles closing events.
    +
    void setToolWidth(int value)
    The IntelliColorPicker manages the selected colors for one whole project.
    - + @@ -171,7 +171,7 @@ Protected Member Functions

    The closeEvent function handles closing events.

    -

    Definition at line 23 of file IntelliPhotoGui.cpp.

    +

    Definition at line 26 of file IntelliPhotoGui.cpp.

    @@ -191,7 +191,7 @@ Protected Member Functions
    -

    Definition at line 827 of file IntelliPhotoGui.cpp.

    +

    Definition at line 828 of file IntelliPhotoGui.cpp.

    @@ -210,7 +210,7 @@ Protected Member Functions
    -

    Definition at line 836 of file IntelliPhotoGui.cpp.

    +

    Definition at line 837 of file IntelliPhotoGui.cpp.

    diff --git a/docs/html/tst__unittest_8cpp_source.html b/docs/html/tst__unittest_8cpp_source.html index 572e3bf..c3292b4 100644 --- a/docs/html/tst__unittest_8cpp_source.html +++ b/docs/html/tst__unittest_8cpp_source.html @@ -1803,7 +1803,6 @@ $(document).ready(function(){initNavTree('tst__unittest_8cpp_source.html',''); i
    void setSecondColor(QColor Color)
    A function to set the secondary color.
    The IntelliToolPlainTool class represents a tool to fill the whole canvas with one color.
    The IntelliShapedImage manages a Shapedimage.
    -
    QColor getSecondColor()
    A function to read the secondary selected color.
    void createPlainTool()
    @@ -1826,7 +1825,6 @@ $(document).ready(function(){initNavTree('tst__unittest_8cpp_source.html',''); i
    void moveActiveLayer(int idx)
    The moveActiveLayer moves the active layer to a specific position in the layer stack.
    IntelliColorPicker colorPicker
    Definition: PaintingArea.h:202
    -
    QColor getFirstColor()
    A function to read the primary selected color.
    void createFloodFillTool()