Moved up src/ one level

This commit is contained in:
2019-12-13 08:57:53 +01:00
parent 610ed9fa7f
commit 9f9315c8a4
28 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
#include "IntelliColorPicker.h"
IntelliColorPicker::IntelliColorPicker(){
firstColor = {255,0,0,255};
secondColor = {0,0,255,255};
}
IntelliColorPicker::~IntelliColorPicker(){
}
void IntelliColorPicker::switchColors(){
std::swap(firstColor, secondColor);
}
QColor IntelliColorPicker::getFirstColor(){
return this->firstColor;
}
QColor IntelliColorPicker::getSecondColor(){
return this->secondColor;
}
void IntelliColorPicker::setFirstColor(QColor Color){
this->firstColor = Color;
}
void IntelliColorPicker::setSecondColor(QColor Color){
this->secondColor = Color;
}

View File

@@ -0,0 +1,26 @@
#ifndef INTELLITOOLSETCOLORTOOL_H
#define INTELLITOOLSETCOLORTOOL_H
#include"QColor"
#include"QPoint"
#include"QColorDialog"
class IntelliColorPicker{
public:
IntelliColorPicker();
virtual ~IntelliColorPicker();
void switchColors();
QColor getFirstColor();
QColor getSecondColor();
void setFirstColor(QColor Color);
void setSecondColor(QColor Color);
private:
QColor firstColor;
QColor secondColor;
};
#endif // INTELLITOOLSETCOLORTOOL_H

View File

@@ -0,0 +1,4 @@
#include"IntelliHelper.h"
#include<algorithm>

View File

@@ -0,0 +1,31 @@
#ifndef INTELLIHELPER_H
#define INTELLIHELPER_H
#include<QPoint>
class IntelliHelper{
public:
static inline float sign(QPoint& p1, QPoint& p2, QPoint& p3){
return (p1.x()-p3.x())*(p2.y()-p3.y())-(p2.x()-p3.x())*(p1.y()-p3.y());
}
static inline bool isInTriangle(QPoint& A, QPoint& B, QPoint& C, QPoint& P){
float val1, val2, val3;
bool neg, pos;
val1 = IntelliHelper::sign(P,A,B);
val2 = IntelliHelper::sign(P,B,C);
val3 = IntelliHelper::sign(P,C,A);
neg = (val1<0.f) || (val2<0.f) || (val3<0.f);
pos = (val1>0.f) || (val2>0.f) || (val3>0.f);
return !(neg && pos);
}
};
#endif