PLY: add short/ushort support to readInteger.

This commit is contained in:
Jan Möbius
2019-09-03 08:20:12 +02:00
parent d28df7edcb
commit 70c0123bfe

View File

@@ -976,6 +976,8 @@ void _PLYReader_::readInteger(ValueType _type, std::istream& _in, T& _value) con
static_assert(std::is_integral<T>::value, "Integral required."); static_assert(std::is_integral<T>::value, "Integral required.");
int16_t tmp_int16_t;
uint16_t tmp_uint16_t;
int32_t tmp_int32_t; int32_t tmp_int32_t;
uint32_t tmp_uint32_t; uint32_t tmp_uint32_t;
int8_t tmp_char; int8_t tmp_char;
@@ -983,6 +985,22 @@ void _PLYReader_::readInteger(ValueType _type, std::istream& _in, T& _value) con
switch (_type) { switch (_type) {
case ValueTypeINT16:
case ValueTypeSHORT:
restore(_in, tmp_int16_t, options_.check(Options::MSB));
_value = tmp_int16_t;
break;
case ValueTypeUINT16:
case ValueTypeUSHORT:
restore(_in, tmp_uint16_t, options_.check(Options::MSB));
_value = tmp_uint16_t;
break;
case ValueTypeINT: case ValueTypeINT:
case ValueTypeINT32: case ValueTypeINT32: