Go to the documentation of this file.
5 #include <QInputDialog>
9 this->alphaInner = QInputDialog::getInt(
nullptr,
"Inner Alpha Value",
"Value:", 0,0,255,1);
10 lineWidth = QInputDialog::getInt(
nullptr,
"Line Width Input",
"Width",1,1,50,1);;
11 PointIsNearStart =
false;
20 if(!isDrawing && x > 0 && y > 0 && x<Area->getWidthOfActive() && y<Area->getHeightOfActive()) {
22 QPoint drawingPoint = QPoint(x,y);
25 QPointList.push_back(drawingPoint);
30 else if(isDrawing && isNearStart(x,y,QPointList.front())) {
31 PointIsNearStart =
true;
36 QPoint drawingPoint(x,y);
37 QPointList.push_back(drawingPoint);
45 PointIsNearStart =
false;
51 if(PointIsNearStart && QPointList.size() > 1) {
52 PointIsNearStart =
false;
57 colorTwo.setAlpha(alphaInner);
66 for(
int i=0; i<QPointList.size(); i++) {
67 int next = (i+1)%QPointList.size();
82 if(lineWidth + value < 10) {
95 bool IntelliToolPolygon::isNearStart(
int x,
int y, QPoint Startpoint){
97 int StartX = Startpoint.x();
98 int StartY = Startpoint.y();
101 for(
int i = StartX - valueToNear; i < StartX + valueToNear; i++) {
102 for(
int j = StartY - valueToNear; j < StartY + valueToNear; j++) {
103 if((i == x) && (j == y)) {
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 drawPixel(const QPoint &p1, const QColor &color)
A funtcion used to draw a pixel on the Image with the given Color.
QColor getSecondColor()
A function to read the secondary selected color.
The PaintingArea class manages the methods and stores information about the current painting area,...
virtual void drawPoint(const QPoint &p1, const QColor &color, const int &penWidth)
A.
bool isInPolygon(std::vector< Triangle > &triangles, QPoint &point)
A function to check if a point lies in a polygon by checking its spanning triangles.
QColor getFirstColor()
A function to read the primary selected color.
The IntelliColorPicker manages the selected colors for one whole project.
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 ...
virtual void calculateVisiblity()=0
An abstract function that calculates the visiblity of the Image data if needed.