Compare commits
No commits in common. "69b05cc335f101577b762fcaedefcc0549cd9f89" and "2d5920532b39763e6a9c95cf40183411cb4ab46b" have entirely different histories.
69b05cc335
...
2d5920532b
@ -56,7 +56,6 @@ static float pDistance(float x, float y, float x1, float y1, float x2, float y2)
|
|||||||
//return sqrt(dx * dx + dy * dy);
|
//return sqrt(dx * dx + dy * dy);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* not used anymore... or yet
|
|
||||||
static bool SortForMinXMaxY (const Point& a, const Point& b)
|
static bool SortForMinXMaxY (const Point& a, const Point& b)
|
||||||
{
|
{
|
||||||
if (a.x() != b.x())
|
if (a.x() != b.x())
|
||||||
@ -88,5 +87,5 @@ static std::pair<Point, Point> getMinMaxX(std::vector<Point>& pts)
|
|||||||
std::sort(pts.begin(), pts.end(), SortForMinXMaxY);
|
std::sort(pts.begin(), pts.end(), SortForMinXMaxY);
|
||||||
|
|
||||||
return std::make_pair(pts[0], pts[pts.size() - 1]);
|
return std::make_pair(pts[0], pts[pts.size() - 1]);
|
||||||
}*/
|
}
|
||||||
#endif // UTILITY_H
|
#endif // UTILITY_H
|
10
main.cpp
10
main.cpp
@ -6,7 +6,9 @@
|
|||||||
#include <vector> // TODO: or use arrays for maximum performance?
|
#include <vector> // TODO: or use arrays for maximum performance?
|
||||||
|
|
||||||
#include "Display.h"
|
#include "Display.h"
|
||||||
#include "Point.h"
|
#include "Point.h" // TODO: check if there is a usable SFML or c++ class
|
||||||
|
#include "Timing.h"
|
||||||
|
#include "Utility.h"
|
||||||
|
|
||||||
// TODOs:
|
// TODOs:
|
||||||
// - use SFML vec2 instead of Point class
|
// - use SFML vec2 instead of Point class
|
||||||
@ -78,8 +80,6 @@ int main (int argc, char **argv)
|
|||||||
std::string line;
|
std::string line;
|
||||||
std::getline(in, line); // get first line for explizit valueCount
|
std::getline(in, line); // get first line for explizit valueCount
|
||||||
valCount = std::stoi(line);
|
valCount = std::stoi(line);
|
||||||
float x = 0;
|
|
||||||
float y = 0;
|
|
||||||
for (int i = 0; i < valCount; ++i)
|
for (int i = 0; i < valCount; ++i)
|
||||||
{
|
{
|
||||||
getline(in, line);
|
getline(in, line);
|
||||||
@ -87,8 +87,8 @@ int main (int argc, char **argv)
|
|||||||
size_t pos = line.find(',');
|
size_t pos = line.find(',');
|
||||||
if (pos != std::string::npos)
|
if (pos != std::string::npos)
|
||||||
{
|
{
|
||||||
x = std::stof(line.substr(0, pos));
|
float x = std::stof(line.substr(0, pos));
|
||||||
y = std::stof(line.substr(pos + 1));
|
float y = std::stof(line.substr(pos + 1));
|
||||||
points.push_back(Point(x, y));
|
points.push_back(Point(x, y));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user