Commit 0b81157f authored by Maxime GIMENO's avatar Maxime GIMENO

Replace some atoi to get floating values for spacing and offset.

Set FileBottomLeftCorner to 1 to read data in the right order and update test.
parent 5caea543
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