HEKTO
HEKTO

Reputation: 4191

How to import CGAL 2D general polygon from file?

According to this documentation page the General_polygon_2 can be imported from a text file using operator>>. However the program below can't be compiled:

#include <iostream>
#include <fstream>

#include <CGAL/Simple_cartesian.h>
#include <CGAL/Gps_circle_segment_traits_2.h>
#include <CGAL/General_polygon_2.h>

using Kernel = CGAL::Simple_cartesian<double>;
using PolygonTraits = CGAL::Gps_circle_segment_traits_2<Kernel>;
using Polygon = CGAL::General_polygon_2<PolygonTraits>;

int main()
{
  Polygon pgn;
  std::ifstream fs("abc");
  fs >> pgn;                       // <== error is here
  std::cout << pgn << std::endl;
}

(The error output is too long to show it here)

What am I doing wrong?

UPDATE. The same problem with CGAL 5.5 - there are no operator>> for the X_monotone_curve_2 type.

UPDATE from 11/4/24. The problem remains in the CGAL 6.0.1.

Upvotes: 1

Views: 147

Answers (0)

Related Questions