Added handling for all enum in draco::DataType (#182)

* Added handling for all enum in draco::DataType

Added support for 64bit integer, 64bit float and boolean in
ConvertValue
Reordered the case label to match those in the enum
for easier maintenance in the long run

* Change tab to space characters

Inline with coding convention in project Draco
This commit is contained in:
Nicholas Yue 2017-08-22 09:45:41 -07:00 committed by Ondrej Stava
parent 92433ca250
commit dcf5cd67c4

View File

@ -127,27 +127,39 @@ class GeometryAttribute {
if (out_val == nullptr)
return false;
switch (data_type_) {
case DT_FLOAT32:
return ConvertTypedValue<float, OutT, out_att_components_t>(att_id,
out_val);
case DT_UINT8:
return ConvertTypedValue<uint8_t, OutT, out_att_components_t>(att_id,
out_val);
case DT_INT8:
return ConvertTypedValue<int8_t, OutT, out_att_components_t>(att_id,
out_val);
case DT_UINT16:
return ConvertTypedValue<uint16_t, OutT, out_att_components_t>(att_id,
out_val);
case DT_UINT8:
return ConvertTypedValue<uint8_t, OutT, out_att_components_t>(att_id,
out_val);
case DT_INT16:
return ConvertTypedValue<int16_t, OutT, out_att_components_t>(att_id,
out_val);
case DT_UINT32:
return ConvertTypedValue<uint32_t, OutT, out_att_components_t>(att_id,
case DT_UINT16:
return ConvertTypedValue<uint16_t, OutT, out_att_components_t>(att_id,
out_val);
case DT_INT32:
return ConvertTypedValue<int32_t, OutT, out_att_components_t>(att_id,
out_val);
case DT_UINT32:
return ConvertTypedValue<uint32_t, OutT, out_att_components_t>(att_id,
out_val);
case DT_INT64:
return ConvertTypedValue<int64_t, OutT, out_att_components_t>(att_id,
out_val);
case DT_UINT64:
return ConvertTypedValue<uint64_t, OutT, out_att_components_t>(att_id,
out_val);
case DT_FLOAT32:
return ConvertTypedValue<float, OutT, out_att_components_t>(att_id,
out_val);
case DT_FLOAT64:
return ConvertTypedValue<double, OutT, out_att_components_t>(att_id,
out_val);
case DT_BOOL:
return ConvertTypedValue<bool, OutT, out_att_components_t>(att_id,
out_val);
default:
// Wrong attribute type.
return false;