CGAL 5.1 - IO Streams
Stream_support/Linestring_WKT.cpp
#include <boost/config.hpp>
#include <boost/version.hpp>
#if BOOST_VERSION >= 105600 && (! defined(BOOST_GCC) || BOOST_GCC >= 40500)
#include <iostream>
#include <fstream>
#include <CGAL/IO/WKT.h>
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <vector>
//typedef CGAL::Simple_cartesian<CGAL::Gmpq> Kernel;
int main(int argc, char* argv[])
{
typedef CGAL::Point_2<Kernel> Point;
typedef std::vector<Point> LineString;
typedef std::vector<LineString> MultiLineString;
LineString ls;
{
std::ifstream is((argc>1)?argv[1]:"data/linestring.wkt");
is.close();
}
for(Point p : ls)
std::cout<<p<<std::endl;
ls.clear();
MultiLineString mls;
{
std::ifstream is((argc>2)?argv[2]:"data/multilinestring.wkt");
is.close();
}
for(LineString l : mls)
{
for(const Point& p : l)
std::cout<<p<<std::endl;
}
return 0;
}
#else
int main()
{
return 0;
}
#endif
CGAL::Point_2
Kernel
CGAL::read_linestring_WKT
std::istream & read_linestring_WKT(std::istream &in, LineString &polyline)
read_linestring_WKT() fills a Linestring from a WKT stream. The first line starting with LINESTRING i...
CGAL::read_multi_linestring_WKT
std::istream & read_multi_linestring_WKT(std::istream &in, MultiLineString &mls)
read_multi_linestring_WKT() overwrites the content of a MultiLineString with the first line starting ...
CGAL::Exact_predicates_exact_constructions_kernel