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

Function ply_read_header_property

src/IO/rply.c:1205–1231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1203}
1204
1205static int ply_read_header_property(p_ply ply) {
1206 p_ply_element element = NULL;
1207 p_ply_property property = NULL;
1208 /* make sure it is a property */
1209 if (strcmp(BWORD(ply), "property")) return 0;
1210 element = &ply->element[ply->nelements-1];
1211 property = ply_grow_property(ply, element);
1212 if (!property) return 0;
1213 /* get property type */
1214 if (!ply_read_word(ply)) return 0;
1215 property->type = ply_find_string(BWORD(ply), ply_type_list);
1216 if (property->type == (e_ply_type) (-1)) return 0;
1217 if (property->type == PLY_LIST) {
1218 /* if it's a list, we need the base types */
1219 if (!ply_read_word(ply)) return 0;
1220 property->length_type = ply_find_string(BWORD(ply), ply_type_list);
1221 if (property->length_type == (e_ply_type) (-1)) return 0;
1222 if (!ply_read_word(ply)) return 0;
1223 property->value_type = ply_find_string(BWORD(ply), ply_type_list);
1224 if (property->value_type == (e_ply_type) (-1)) return 0;
1225 }
1226 /* get property name */
1227 if (!ply_read_word(ply)) return 0;
1228 strcpy(property->name, BWORD(ply));
1229 if (!ply_read_word(ply)) return 0;
1230 return 1;
1231}
1232
1233static int ply_read_header_element(p_ply ply) {
1234 p_ply_element element = NULL;

Callers 1

ply_read_header_elementFunction · 0.85

Calls 3

ply_grow_propertyFunction · 0.85
ply_read_wordFunction · 0.85
ply_find_stringFunction · 0.85

Tested by

no test coverage detected