MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / parse_vertices

Method parse_vertices

src/IO/VEGAParser.cpp:63–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63void VEGAParser::parse_vertices(std::ifstream& fin) {
64 const std::string header = IOUtils::next_line(fin);
65 std::stringstream header_stream(header);
66 header_stream >> m_num_vertices >> m_dim;
67 for (size_t i=0; i<m_num_vertices; i++) {
68 if (fin.eof()) {
69 throw IOError("Error parsing VEGA vertices, EOF reached!");
70 }
71 const std::string line = IOUtils::next_line(fin);
72 size_t index;
73 VectorF v(3);
74 std::stringstream v_line(line);
75 v_line >> index >> v[0] >> v[1] >> v[2];
76 m_vertices.push_back(v);
77 if (i == 0 && index == 0 && m_vertices.size() == 1) {
78 m_index_start_from_zero = true;
79 }
80 }
81}
82
83void VEGAParser::parse_elements(std::ifstream& fin) {
84 const std::string elem_type = IOUtils::next_line(fin);

Callers

nothing calls this directly

Calls 3

IOErrorClass · 0.85
next_lineFunction · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected