From dcf5cd67c4126e9db6fafd9af7fcdf09b35398d1 Mon Sep 17 00:00:00 2001 From: Nicholas Yue Date: Tue, 22 Aug 2017 09:45:41 -0700 Subject: [PATCH] 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 --- src/draco/attributes/geometry_attribute.h | 34 +++++++++++++++-------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/src/draco/attributes/geometry_attribute.h b/src/draco/attributes/geometry_attribute.h index a3b7345..a7c32a4 100644 --- a/src/draco/attributes/geometry_attribute.h +++ b/src/draco/attributes/geometry_attribute.h @@ -127,27 +127,39 @@ class GeometryAttribute { if (out_val == nullptr) return false; switch (data_type_) { - case DT_FLOAT32: - return ConvertTypedValue(att_id, - out_val); - case DT_UINT8: - return ConvertTypedValue(att_id, - out_val); case DT_INT8: return ConvertTypedValue(att_id, out_val); - case DT_UINT16: - return ConvertTypedValue(att_id, - out_val); + case DT_UINT8: + return ConvertTypedValue(att_id, + out_val); case DT_INT16: return ConvertTypedValue(att_id, out_val); - case DT_UINT32: - return ConvertTypedValue(att_id, + case DT_UINT16: + return ConvertTypedValue(att_id, out_val); case DT_INT32: return ConvertTypedValue(att_id, out_val); + case DT_UINT32: + return ConvertTypedValue(att_id, + out_val); + case DT_INT64: + return ConvertTypedValue(att_id, + out_val); + case DT_UINT64: + return ConvertTypedValue(att_id, + out_val); + case DT_FLOAT32: + return ConvertTypedValue(att_id, + out_val); + case DT_FLOAT64: + return ConvertTypedValue(att_id, + out_val); + case DT_BOOL: + return ConvertTypedValue(att_id, + out_val); default: // Wrong attribute type. return false;