| 32 | } |
| 33 | |
| 34 | int ply_parser_call_back(p_ply_argument argument) { |
| 35 | p_ply_element elem; |
| 36 | p_ply_property prop; |
| 37 | const char* elem_name; |
| 38 | const char* prop_name; |
| 39 | PLYParser* parser; |
| 40 | long prop_len; |
| 41 | long value_idx; |
| 42 | |
| 43 | assert_success(ply_get_argument_element(argument, &elem, NULL)); |
| 44 | assert_success(ply_get_argument_property(argument, &prop, &prop_len, &value_idx)); |
| 45 | assert_success(ply_get_element_info(elem, &elem_name, NULL)); |
| 46 | assert_success(ply_get_property_info(prop, &prop_name, NULL, NULL, NULL)); |
| 47 | assert_success(ply_get_argument_user_data(argument, (void**)&parser, NULL)); |
| 48 | |
| 49 | Float value = ply_get_argument_value(argument); |
| 50 | |
| 51 | if (value_idx >= 0) |
| 52 | parser->add_property_value(elem_name, prop_name, value); |
| 53 | return 1; |
| 54 | } |
| 55 | |
| 56 | void parse_ply(const std::string& filename, PLYParser* parser) { |
| 57 | p_ply ply = ply_open(filename.c_str(), NULL, 0, NULL); |
nothing calls this directly
no test coverage detected