mirror of https://github.com/CGAL/cgal
Triangulation_2 Demo: Read files with many WKT entities
This commit is contained in:
parent
0d89f3c12b
commit
8da2cd9a34
|
|
@ -559,9 +559,20 @@ MainWindow::loadWKT(QString filename)
|
||||||
{
|
{
|
||||||
typedef CGAL::Polygon_with_holes_2<K> Polygon;
|
typedef CGAL::Polygon_with_holes_2<K> Polygon;
|
||||||
typedef CGAL::Point_2<K> Point;
|
typedef CGAL::Point_2<K> Point;
|
||||||
std::vector<Polygon> mps;
|
|
||||||
CGAL::IO::read_multi_polygon_WKT(ifs, mps);
|
std::deque<Point> points;
|
||||||
for(const Polygon& p : mps)
|
std::deque<std::vector<Point>> linestrings;
|
||||||
|
std::deque<Polygon> polygons;
|
||||||
|
|
||||||
|
CGAL::IO::read_WKT(ifs, points, linestrings, polygons);
|
||||||
|
|
||||||
|
cdt.insert(points.begin(),points.end());
|
||||||
|
|
||||||
|
for(const std::vector<Point>& line){
|
||||||
|
cdt.insert_constraint(line.begin(), line.end());
|
||||||
|
}
|
||||||
|
|
||||||
|
for(const Polygon& p : polygons)
|
||||||
{
|
{
|
||||||
if(p.outer_boundary().is_empty())
|
if(p.outer_boundary().is_empty())
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue