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

Function ply_read_header_element

src/IO/rply.c:1233–1257  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1231}
1232
1233static int ply_read_header_element(p_ply ply) {
1234 p_ply_element element = NULL;
1235 long dummy;
1236 assert(ply && ply->fp && ply->io_mode == PLY_READ);
1237 if (strcmp(BWORD(ply), "element")) return 0;
1238 /* allocate room for new element */
1239 element = ply_grow_element(ply);
1240 if (!element) return 0;
1241 /* get element name */
1242 if (!ply_read_word(ply)) return 0;
1243 strcpy(element->name, BWORD(ply));
1244 /* get number of elements of this type */
1245 if (!ply_read_word(ply)) return 0;
1246 if (sscanf(BWORD(ply), "%ld", &dummy) != 1) {
1247 ply_ferror(ply, "Expected number got '%s'", BWORD(ply));
1248 return 0;
1249 }
1250 element->ninstances = dummy;
1251 /* get all properties for this element */
1252 if (!ply_read_word(ply)) return 0;
1253 while (ply_read_header_property(ply) ||
1254 ply_read_header_comment(ply) || ply_read_header_obj_info(ply))
1255 /* do nothing */;
1256 return 1;
1257}
1258
1259static void ply_error_cb(p_ply ply, const char *message) {
1260 (void) ply;

Callers 1

ply_read_headerFunction · 0.85

Calls 6

ply_grow_elementFunction · 0.85
ply_read_wordFunction · 0.85
ply_ferrorFunction · 0.85
ply_read_header_propertyFunction · 0.85
ply_read_header_commentFunction · 0.85
ply_read_header_obj_infoFunction · 0.85

Tested by

no test coverage detected