start of unit test

This commit is contained in:
Jonas Mucke
2020-01-12 20:23:39 +01:00
parent 573cabf448
commit 5a05aa4a19
21 changed files with 180 additions and 97 deletions

View File

@@ -1,36 +0,0 @@
#include "IntelliColorPicker.h"
#include "QDebug"
IntelliColorPicker::IntelliColorPicker(PaintingArea* Area)
: IntelliTool(Area){
firstColor = {255,0,0,255};
secondColor = {0,0,255,255};
}
IntelliColorPicker::~IntelliColorPicker(){
}
void IntelliColorPicker::getColorbar(int firstOrSecondColor = 1){
QString Titel;
QColor newColor;
if(firstOrSecondColor == 1) {
Titel = "Choose first Color";
newColor = QColorDialog::getColor(this->firstColor,nullptr,Titel);
this->firstColor = newColor;
qDebug() << "Firstcolor" << this->firstColor;
}
else{
Titel = "Choose second Color";
newColor = QColorDialog::getColor(this->secondColor,nullptr,Titel);
this->secondColor = newColor;
}
}
QColor IntelliColorPicker::getFirstColor(){
return firstColor;
}
QColor IntelliColorPicker::getSecondColor(){
return secondColor;
}

View File

@@ -5,6 +5,9 @@
#include "IntelliHelper/IntelliToolsettings.h"
#include <vector>
//for unit testing
class UnitTest;
struct LayerObject;
class PaintingArea;
@@ -12,6 +15,7 @@ class PaintingArea;
* \brief An abstract class that manages the basic events, like mouse clicks or scrolls events.
*/
class IntelliTool {
friend UnitTest;
public:
enum class Tooltype {
CIRCLE,

View File

@@ -4,10 +4,15 @@
#include "QColor"
#include "QPoint"
//for unit testing
class UnitTest;
/*!
* \brief The IntelliToolCircle class represents a tool to draw a circle.
*/
class IntelliToolCircle : public IntelliTool {
friend UnitTest;
/*!
* \brief A function that implements a circle drawing algorithm.
* \param radius - The radius of the circle.

View File

@@ -4,10 +4,15 @@
#include "QColor"
//for unit testing
class UnitTest;
/*!
* \brief The IntelliToolFloodFill class represents a tool to flood FIll a certian area.
*/
class IntelliToolFloodFill : public IntelliTool {
friend UnitTest;
public:
/*!
* \brief A constructor setting the general paintingArea and colorPicker.

View File

@@ -4,10 +4,14 @@
#include "QPoint"
//for unit testing
class UnitTest;
/*!
* \brief The IntelliToolFloodFill class represents a tool to draw a line.
*/
class IntelliToolLine : public IntelliTool {
friend UnitTest;
/*!
* \brief The starting point of the line.
*/

View File

@@ -5,10 +5,14 @@
#include "QColor"
#include "QPoint"
//for unit testing
class UnitTest;
/*!
* \brief The IntelliToolPen class represents a tool to draw a line.
*/
class IntelliToolPen : public IntelliTool {
friend UnitTest;
/*!
* \brief point - Represents the previous point to help drawing a line.
*/

View File

@@ -3,10 +3,15 @@
#include "IntelliTool.h"
#include "QColor"
//for unit testing
class UnitTest;
/*!
* \brief The IntelliToolPlainTool class represents a tool to fill the whole canvas with one color.
*/
class IntelliToolPlainTool : public IntelliTool {
friend UnitTest;
public:
/*!
* \brief A constructor setting the general paintingArea and colorPicker.

View File

@@ -5,11 +5,16 @@
#include "IntelliHelper/IntelliTriangulation.h"
#include <vector>
#include <QPoint>
//for unit testing
class UnitTest;
/*!
* \brief The IntelliToolPolygon managed the Drawing of Polygonforms
*/
class IntelliToolPolygon : public IntelliTool
{
friend UnitTest;
/*!
* \brief Checks if the given Point lies near the starting Point.
* \param x - x coordinate of a point.

View File

@@ -5,10 +5,15 @@
#include "QColor"
#include "QPoint"
//for unit testing
class UnitTest;
/*!
* \brief The IntelliToolRectangle class represents a tool to draw a rectangle.
*/
class IntelliToolRectangle : public IntelliTool {
friend UnitTest;
/*!
* \brief A function that implements a rectagle drawing algorithm.
* \param othercorner - The second corner point of the rectangle.