#include <CGAL/Installation/internal/disable_deprecation_warnings_and_errors.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Barycentric_coordinates_2/Generalized_barycentric_coordinates_2.h>
#include <CGAL/Barycentric_coordinates_2/Mean_value_2.h>
using FT = Kernel::FT;
using Mean_value =
using Mean_value_coordinates =
int main() {
const std::vector<Point_2> star_shaped = {
Mean_value_coordinates mean_value_coordinates(
star_shaped.begin(), star_shaped.end());
mean_value_coordinates.print_information();
const std::vector<Point_2> interior_points = {
std::vector<FT> coordinates;
coordinates.reserve(star_shaped.size());
std::size_t count = 0;
for (const auto& query : interior_points) {
coordinates.clear();
const auto result = mean_value_coordinates(
query, std::back_inserter(coordinates), query_point_location, type_of_algorithm);
const std::string status = (result ? "SUCCESS." : "FAILURE.");
std::cout << std::endl << "point: " << count << ", status of the computation: " << status << std::endl;
++count;
for (std::size_t i = 0; i < coordinates.size() - 1; ++i) {
std::cout << coordinates[i] << ", ";
}
std::cout << coordinates[coordinates.size() - 1] << std::endl;
}
std::cout << std::endl;
return EXIT_SUCCESS;
}
The class Generalized_barycentric_coordinates_2 implements generalized barycentric coordinates along ...
Definition: Generalized_barycentric_coordinates_2.h:57
The class Mean_value_2 implements 2D mean value coordinates ( , , ).
Definition: Mean_value_2.h:112
@ FAST
A fast algorithm, which is less precise but much faster.
Definition: barycentric_enum_2.h:122
@ ON_BOUNDED_SIDE
Query point is located inside the polygon, excluding the boundary.
Definition: barycentric_enum_2.h:99