27 lines
788 B
C++
27 lines
788 B
C++
|
|
#include "Quickhull.h"
|
|
|
|
void Quickhull::get_hull(std::vector<Point> &input, std::vector<Point> &output)
|
|
{
|
|
// Get leftmost and rightmost point
|
|
// Add them to the output.
|
|
|
|
// Create a line from leftmost to rightmost
|
|
|
|
// Sort points between left and right of that line
|
|
|
|
// Call get_hull_with_line with the left points, as well as with the right points, and the line
|
|
}
|
|
|
|
void Quickhull::get_hull_with_line(std::vector<Point> &input, std::vector<Point> &output, Point, Point)
|
|
{
|
|
// If the input vector is empty, we're done
|
|
|
|
// Find the point which is furthest away from the line, add it to the output
|
|
|
|
// Build a triangle with these 3 points
|
|
// Remove points inside this triangle
|
|
|
|
// Recursively call get_hull_with_line for each side of the triangle
|
|
}
|