Commit b97ba491 authored by Michael Migliore's avatar Michael Migliore Committed by Kitware Robot

Merge topic 'SEPReader-Fix_bounds_and_spacing_reading-GF'

0b81157f Replace some atoi to get floating values for spacing and offset.
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Michael Migliore's avatarMichael Migliore <michael.migliore@kitware.com>
Acked-by: Joachim Pouderoux's avatarJoachim Pouderoux <joachim.pouderoux@kitware.com>
Merge-request: !5082
parents 5caea543 0b81157f
61f373c79ac5e444481f83bb0aca50feedbf6e239d4376a9cb990a64657a63bc7683f67f09bee593ae3b48ce7a70834317f2fd02082ec72d92c3e02ecaff1186
5cdcdd6975a4973845dfa39f5429ac551eb6814035139da593e74d93b4645b38d6239d7117244739b14f703b09e973ea9f757af313a8401f62c93d1c0c0d439f
......@@ -18,6 +18,7 @@
#include "vtksys/SystemTools.hxx"
#include <iostream>
#include <sstream>
#include <string>
vtkStandardNewMacro(vtkSEPReader);
......@@ -46,6 +47,7 @@ void TrimString(std::string &s)
vtkSEPReader::vtkSEPReader()
{
this->SetNumberOfInputPorts(0);
this->SetFileLowerLeft(1);
}
//-----------------------------------------------------------------------------
......@@ -130,6 +132,11 @@ int vtkSEPReader::ReadHeader()
{
std::string key = splittedLine[0];
std::string value = splittedLine[1];
std::istringstream iss(value);
iss.imbue(std::locale::classic());
double d_value;
iss >> d_value;
::TrimString(key);
::TrimString(value);
if (key.length() == 2 && key[0] == 'n')
......@@ -139,11 +146,11 @@ int vtkSEPReader::ReadHeader()
}
else if (key.length() == 2 && key[0] == 'd')
{
this->DataSpacing[key[1] - '0' - 1] = atoi(value.c_str());
this->DataSpacing[key[1] - '0' - 1] = d_value;
}
else if (key.length() == 2 && key[0] == 'o')
{
this->DataOrigin[key[1] - '0' - 1] = atoi(value.c_str());
this->DataOrigin[key[1] - '0' - 1] = d_value;
}
else if (key == "data_format")
{
......
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