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

Function parse_ply

src/IO/PLYParser.cpp:56–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54 }
55
56 void parse_ply(const std::string& filename, PLYParser* parser) {
57 p_ply ply = ply_open(filename.c_str(), NULL, 0, NULL);
58 assert_success(ply != NULL);
59 assert_success(ply_read_header(ply));
60
61 const char* elem_name;
62 const char* prop_name;
63 long num_elements;
64 p_ply_element element = ply_get_next_element(ply, NULL);
65 while (element != NULL) {
66 assert_success(ply_get_element_info(element, &elem_name, &num_elements));
67
68 p_ply_property property = ply_get_next_property(element, NULL);
69 while (property != NULL) {
70 assert_success(ply_get_property_info(property, &prop_name, NULL, NULL, NULL));
71
72 ply_set_read_cb(ply, elem_name, prop_name, ply_parser_call_back, parser, 0);
73 parser->add_property(elem_name, prop_name, num_elements);
74
75 property = ply_get_next_property(element, property);
76 }
77 element = ply_get_next_element(ply, element);
78 }
79 assert_success(ply_read(ply));
80 ply_close(ply);
81 }
82}
83
84using namespace PLYParserHelper;

Callers 1

parseMethod · 0.85

Calls 11

ply_openFunction · 0.85
ply_read_headerFunction · 0.85
ply_get_next_elementFunction · 0.85
ply_get_element_infoFunction · 0.85
ply_get_next_propertyFunction · 0.85
ply_get_property_infoFunction · 0.85
ply_set_read_cbFunction · 0.85
ply_readFunction · 0.85
ply_closeFunction · 0.85
add_propertyMethod · 0.80
assert_successFunction · 0.70

Tested by

no test coverage detected