40 std::vector<std::string> tokens;
41 boost::split(tokens, line, boost::is_any_of(
" "), boost::token_compress_on);
42 if (tokens.size() == 3) {
44 boost::lexical_cast<double>(tokens[1]),
45 boost::lexical_cast<double>(tokens[2]));
48 throw std::runtime_error(
"Error on reading OFF vertex");
51 throw std::runtime_error(
"Unexpected end of file, while reading OFF m_vertices");
62 std::vector<std::string> tokens;
63 boost::split(tokens, line, boost::is_any_of(
" "), boost::token_compress_on);
64 if (tokens.size() >= 4) {
65 nFaceVertices = boost::lexical_cast<size_t>(tokens[0]);
66 if (nFaceVertices == 3) {
67 t1 = boost::lexical_cast<uint32_t>(tokens[1]);
68 t2 = boost::lexical_cast<uint32_t>(tokens[2]);
69 t3 = boost::lexical_cast<uint32_t>(tokens[3]);
71 throw std::runtime_error(
"OFF face is not a triangle.");
77 throw std::runtime_error(
"Error on reading OFF triangle");
80 throw std::runtime_error(
"Unexpected end of file, while reading OFF triangles");
90 std::vector<std::string> tokens;
91 boost::split(tokens, line, boost::is_any_of(
" "), boost::token_compress_on);
92 if (tokens.size() == 3) {
94 m_nVertices = boost::lexical_cast<uint32_t>(tokens[0]);
97 throw std::runtime_error(
"Error in reading numbers of OFF m_vertices and "
98 "triangles, which may be too large");
103 throw std::runtime_error(
"Error on reading OFF number of m_vertices, faces & edges");
106 throw std::runtime_error(
"Unexpected end of OFF file");
112 std::unique_ptr<Geometry::MeshObject> retVal =