Don't typedef to Polygon, as it conflicts with a function defined in wingdi.h

See https://stackoverflow.com/questions/4315399/error-c2143-syntax-error-missing-before/4315475#4315475
This commit is contained in:
Sebastian Morr 2015-05-12 23:35:10 +02:00
parent 423ce309f4
commit 09666e34bc
6 changed files with 19 additions and 19 deletions

View File

@ -33,12 +33,12 @@ int main(int argc, char* argv[])
<< std::endl;
// Approximate the offset polygon.
std::list<Polygon> inset_polygons;
std::list<Polygon_2> inset_polygons;
boost::timer timer;
approximated_inset_2(P, 1, 0.00001, std::back_inserter(inset_polygons));
double secs = timer.elapsed();
std::list<Polygon>::iterator it;
std::list<Polygon_2>::iterator it;
std::cout << "The inset comprises " << inset_polygons.size()
<< " polygon(s)." << std::endl;
for (it = inset_polygons.begin(); it != inset_polygons.end(); ++it)

View File

@ -28,7 +28,7 @@ int main(int argc, char* argv[])
// Approximate the offset polygon with radius 5 and error bound 0.00001.
boost::timer timer;
Polygon_with_holes offset = CGAL::approximated_offset_2(P, 5, 0.00001);
Polygon_with_holes_2 offset = CGAL::approximated_offset_2(P, 5, 0.00001);
double secs = timer.elapsed();
std::cout << "The offset polygon has " << offset.outer_boundary().size()

View File

@ -8,8 +8,8 @@
typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel;
typedef CGAL::Gps_circle_segment_traits_2<Kernel> Traits;
typedef CGAL::General_polygon_set_2<Traits> Polygon_set;
typedef Traits::Polygon_2 Polygon;
typedef Traits::Polygon_with_holes_2 Polygon_with_holes;
typedef CGAL::General_polygon_set_2<Traits> Polygon_set_2;
typedef Traits::Polygon_2 Polygon_2;
typedef Traits::Polygon_with_holes_2 Polygon_with_holes_2;
#endif

View File

@ -7,9 +7,9 @@
#include <CGAL/Boolean_set_operations_2.h>
typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel;
typedef Kernel::Point_2 Point;
typedef CGAL::Polygon_2<Kernel> Polygon;
typedef CGAL::Polygon_with_holes_2<Kernel> Polygon_with_holes;
typedef std::list<Polygon_with_holes> Pgn_with_holes_container;
typedef Kernel::Point_2 Point_2;
typedef CGAL::Polygon_2<Kernel> Polygon_2;
typedef CGAL::Polygon_with_holes_2<Kernel> Polygon_with_holes_2;
typedef std::list<Polygon_with_holes_2> Pgn_with_holes_2_container;
#endif

View File

@ -9,19 +9,19 @@
int main()
{
// Construct the triangle.
Polygon P;
P.push_back(Point(-1, -1)); P.push_back(Point(1, -1));
P.push_back(Point(0, 1));
Polygon_2 P;
P.push_back(Point_2(-1, -1)); P.push_back(Point_2(1, -1));
P.push_back(Point_2(0, 1));
std::cout << "P = " << P << std::endl;
// Construct the square.
Polygon Q;
Q.push_back(Point(3, -1)); Q.push_back(Point(5, -1));
Q.push_back(Point(5, 1)); Q.push_back(Point(3, 1));
Polygon_2 Q;
Q.push_back(Point_2(3, -1)); Q.push_back(Point_2(5, -1));
Q.push_back(Point_2(5, 1)); Q.push_back(Point_2(3, 1));
std::cout << "Q = " << Q << std::endl;
// Compute the Minkowski sum.
Polygon_with_holes sum = CGAL::minkowski_sum_2(P, Q);
Polygon_with_holes_2 sum = CGAL::minkowski_sum_2(P, Q);
CGAL_assertion(sum.number_of_holes() == 0);
std::cout << "P (+) Q = " << sum.outer_boundary() << std::endl;
return 0;

View File

@ -18,12 +18,12 @@ int main(int argc, char* argv[])
std::cerr << "Failed to open the input file." << std::endl;
return -1;
}
Polygon P, Q;
Polygon_2 P, Q;
in_file >> P >> Q;
in_file.close();
// Compute and print the Minkowski sum.
Polygon_with_holes sum = CGAL::minkowski_sum_2(P, Q);
Polygon_with_holes_2 sum = CGAL::minkowski_sum_2(P, Q);
std::cout << "P (+) Q = ";
print_polygon_with_holes(sum);
return 0;