Commit 2b51f3c8 authored by Dan Lipsa's avatar Dan Lipsa

Add float64 to the list of supported types.

parent 03ac5cda
......@@ -86,7 +86,7 @@ static const char *type_names[] = {
"invalid",
"char", "short", "int", "int8", "int16", "int32",
"uchar", "ushort", "uint", "uint8", "uint16", "uint32",
"float", "float32", "double",
"float", "float32", "double", "float64"
};
static const int ply_type_size[] = {
......@@ -1938,6 +1938,7 @@ double vtkPLY::get_item_value(const char *item, int type)
return ((double) value);
}
case PLY_DOUBLE:
case PLY_FLOAT64:
{
vtkTypeFloat64 value;
memcpy(&value, item, sizeof(value));
......@@ -2024,6 +2025,7 @@ void vtkPLY::write_binary_item(PlyFile *plyfile,
fwrite (&float_val, sizeof(float_val), 1, fp);
break;
case PLY_DOUBLE:
case PLY_FLOAT64:
plyfile->file_type == PLY_BINARY_BE ?
vtkByteSwap::Swap8BE(&double_val) :
vtkByteSwap::Swap8LE(&double_val);
......@@ -2075,6 +2077,7 @@ void vtkPLY::write_ascii_item(
case PLY_FLOAT:
case PLY_FLOAT32:
case PLY_DOUBLE:
case PLY_FLOAT64:
fprintf (fp, "%g ", double_val);
break;
default:
......@@ -2156,6 +2159,7 @@ double vtkPLY::old_write_ascii_item(FILE *fp, char *item, int type)
return value;
}
case PLY_DOUBLE:
case PLY_FLOAT64:
{
vtkTypeFloat64 value;
memcpy(&value, item, sizeof(value));
......@@ -2262,6 +2266,7 @@ void vtkPLY::get_stored_item(
break;
}
case PLY_DOUBLE:
case PLY_FLOAT64:
{
vtkTypeFloat64 value;
memcpy(&value, ptr, sizeof(value));
......@@ -2444,6 +2449,7 @@ void vtkPLY::get_binary_item(
}
break;
case PLY_DOUBLE:
case PLY_FLOAT64:
{
vtkTypeFloat64 value = 0.0;
if (fread (&value, sizeof(value), 1, plyfile->fp) != 1)
......@@ -2518,6 +2524,7 @@ void vtkPLY::get_ascii_item(
case PLY_FLOAT:
case PLY_FLOAT32:
case PLY_DOUBLE:
case PLY_FLOAT64:
*double_val = atof (word);
*int_val = (int) *double_val;
*uint_val = (unsigned int) *double_val;
......@@ -2603,6 +2610,7 @@ void vtkPLY::store_item (
break;
}
case PLY_DOUBLE:
case PLY_FLOAT64:
{
vtkTypeFloat64 value = static_cast<vtkTypeFloat64>(double_val);
memcpy(item, &value, sizeof(value));
......
......@@ -93,7 +93,8 @@ WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
#define PLY_FLOAT 13
#define PLY_FLOAT32 14
#define PLY_DOUBLE 15
#define PLY_END_TYPE 16
#define PLY_FLOAT64 16
#define PLY_END_TYPE 17
#define PLY_SCALAR 0
#define PLY_LIST 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment