From 8bab72ea84a1bcea4b82c82c85d2377efe2a7dca Mon Sep 17 00:00:00 2001 From: Alexander Rose <alex.rose@rcsb.org> Date: Thu, 21 Mar 2019 14:15:17 -0700 Subject: [PATCH] support more ply type names --- src/mol-io/reader/ply/parser.ts | 8 ++++---- src/mol-io/reader/ply/schema.ts | 11 ++++++++++- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/mol-io/reader/ply/parser.ts b/src/mol-io/reader/ply/parser.ts index 3ec43ccb9..fb9c37684 100644 --- a/src/mol-io/reader/ply/parser.ts +++ b/src/mol-io/reader/ply/parser.ts @@ -139,11 +139,11 @@ function parseElements(state: State) { function getColumnSchema(type: PlyType): Column.Schema { switch (type) { - case 'char': case 'uchar': - case 'short': case 'ushort': - case 'int': case 'uint': + case 'char': case 'uchar': case 'int8': case 'uint8': + case 'short': case 'ushort': case 'int16': case 'uint16': + case 'int': case 'uint': case 'int32': case 'uint32': return Column.Schema.int - case 'float': case 'double': + case 'float': case 'double': case 'float32': case 'float64': return Column.Schema.float } } diff --git a/src/mol-io/reader/ply/schema.ts b/src/mol-io/reader/ply/schema.ts index 6f37e3223..bf23fbb70 100644 --- a/src/mol-io/reader/ply/schema.ts +++ b/src/mol-io/reader/ply/schema.ts @@ -17,7 +17,16 @@ export const PlyTypeByteLength = { 'int': 4, 'uint': 4, 'float': 4, - 'double': 8 + 'double': 8, + + 'int8': 1, + 'uint8': 1, + 'int16': 2, + 'uint16': 2, + 'int32': 4, + 'uint32': 4, + 'float32': 4, + 'float64': 8 } export type PlyType = keyof typeof PlyTypeByteLength export const PlyTypes = new Set(Object.keys(PlyTypeByteLength)) -- GitLab