diff --git a/include/hrlib/io/vertexio.hpp b/include/hrlib/io/vertexio.hpp index d466e8e..c584af6 100644 --- a/include/hrlib/io/vertexio.hpp +++ b/include/hrlib/io/vertexio.hpp @@ -55,7 +55,7 @@ namespace hrlib } template - std::istream& read_next_vertex(std::istream& str, vertex& v) + std::istream& read_next_vertex_line(std::istream& str, vertex& v) { while (str.peek()!=EOF) { // find next line containing floats @@ -83,6 +83,29 @@ namespace hrlib } return str; } + + template + std::istream& read_next_vertex(std::istream& str, vertex& v) + { + char c; + int i=0; + + while (i> v[i++]; + } + + return str; + } } } diff --git a/src/foillogic/foilio.cpp b/src/foillogic/foilio.cpp index cac4e4b..d4909c3 100644 --- a/src/foillogic/foilio.cpp +++ b/src/foillogic/foilio.cpp @@ -59,7 +59,7 @@ std::array>,2> foillogic::parse_profile(std::istream &stre double direction=0; vertex<2> prev; vertex<2> point; - while(utf8::read_next_vertex<2>(stream, point)) { + while(utf8::read_next_vertex_line<2>(stream, point)) { if (point[0]<-1 || point[0]>1 || point[1]<-1 || point[1]>1) continue; diff --git a/src/hrlib/io/pdfio.cpp b/src/hrlib/io/pdfio.cpp index 916a553..f5621df 100644 --- a/src/hrlib/io/pdfio.cpp +++ b/src/hrlib/io/pdfio.cpp @@ -135,7 +135,7 @@ std::istream& hrlib::pdf::read_next_binary(std::istream &stream, std::vector> curve; vertex<2> point; - while(utf8::read_next_vertex<2>(ifs, point)) + while(utf8::read_next_vertex_line<2>(ifs, point)) curve.push_back(point); if (std::all_of(curve.cbegin(), curve.cend(), [curve](const vertex<2> &p){return p[1] == curve[0][1];}))