mirror of
https://git.mirrors.martin98.com/https://github.com/google/draco
synced 2025-08-12 06:59:03 +08:00
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:
parent
92433ca250
commit
dcf5cd67c4
@ -127,26 +127,38 @@ class GeometryAttribute {
|
||||
if (out_val == nullptr)
|
||||
return false;
|
||||
switch (data_type_) {
|
||||
case DT_FLOAT32:
|
||||
return ConvertTypedValue<float, OutT, out_att_components_t>(att_id,
|
||||
case DT_INT8:
|
||||
return ConvertTypedValue<int8_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_INT8:
|
||||
return ConvertTypedValue<int8_t, OutT, out_att_components_t>(att_id,
|
||||
case DT_INT16:
|
||||
return ConvertTypedValue<int16_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_INT16:
|
||||
return ConvertTypedValue<int16_t, OutT, out_att_components_t>(att_id,
|
||||
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_INT32:
|
||||
return ConvertTypedValue<int32_t, OutT, out_att_components_t>(att_id,
|
||||
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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user