mirror of
https://github.com/creyD/intelliphoto.git
synced 2026-04-14 04:10:31 +02:00
start of unit test
This commit is contained in:
@@ -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;
|
||||
}
|
||||
@@ -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,
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user