mirror of
https://github.com/creyD/intelliphoto.git
synced 2026-04-18 06:10:29 +02:00
Fixed bug / changed pi
like the pi could get removed if mucke wants to
This commit is contained in:
@@ -3,6 +3,8 @@
|
|||||||
#include <queue>
|
#include <queue>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
|
#define pi 3.14159265359
|
||||||
|
|
||||||
|
|
||||||
std::vector<Triangle> IntelliHelper::calculateTriangles(std::vector<QPoint> polyPoints){
|
std::vector<Triangle> IntelliHelper::calculateTriangles(std::vector<QPoint> polyPoints){
|
||||||
// helper for managing the triangle vertices and their state
|
// helper for managing the triangle vertices and their state
|
||||||
@@ -46,7 +48,7 @@ std::vector<Triangle> IntelliHelper::calculateTriangles(std::vector<QPoint> poly
|
|||||||
|
|
||||||
// return if the vertex is a tip
|
// return if the vertex is a tip
|
||||||
auto isTip = [](float angle){
|
auto isTip = [](float angle){
|
||||||
return static_cast<double>(angle)<(M_PI/2.);
|
return static_cast<double>(angle)<(pi/2.);
|
||||||
};
|
};
|
||||||
|
|
||||||
std::vector<TriangleHelper> Vertices;
|
std::vector<TriangleHelper> Vertices;
|
||||||
@@ -88,7 +90,7 @@ std::vector<Triangle> IntelliHelper::calculateTriangles(std::vector<QPoint> poly
|
|||||||
}
|
}
|
||||||
|
|
||||||
// update post und prev index
|
// update post und prev index
|
||||||
post = post-1;
|
post = getPrev(post, Vertices.size());
|
||||||
prev = prev<smallest.index ? prev : (prev-1);
|
prev = prev<smallest.index ? prev : (prev-1);
|
||||||
|
|
||||||
// calcultae neighboors of prev and post to calculate new interior angles
|
// calcultae neighboors of prev and post to calculate new interior angles
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ QT += core gui
|
|||||||
|
|
||||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||||
|
|
||||||
CONFIG += c++11
|
CONFIG += c++17
|
||||||
|
|
||||||
# The following define makes your compiler emit warnings if you use
|
# The following define makes your compiler emit warnings if you use
|
||||||
# any Qt feature that has been marked deprecated (the exact warnings
|
# any Qt feature that has been marked deprecated (the exact warnings
|
||||||
|
|||||||
Reference in New Issue
Block a user