corrected precision for saving floating point into ascii ply using nanoply
This commit is contained in:
parent
313d9b14ff
commit
10af2ab4ae
|
|
@ -557,6 +557,30 @@ namespace nanoply
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <>
|
||||||
|
inline bool PlyFile::WriteAsciiData<double>(const double & src)
|
||||||
|
{
|
||||||
|
if (mode != 1)
|
||||||
|
return false;
|
||||||
|
const auto precision = fileStream.precision();
|
||||||
|
fileStream << std::setprecision(std::numeric_limits<double>::max_digits10)
|
||||||
|
<< src
|
||||||
|
<< std::setprecision(precision);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <>
|
||||||
|
inline bool PlyFile::WriteAsciiData<float>(const float & src)
|
||||||
|
{
|
||||||
|
if (mode != 1)
|
||||||
|
return false;
|
||||||
|
const auto precision = fileStream.precision();
|
||||||
|
fileStream << std::setprecision(std::numeric_limits<float>::max_digits10)
|
||||||
|
<< src
|
||||||
|
<< std::setprecision(precision);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
inline void PlyFile::SetBufferSize(int64_t size)
|
inline void PlyFile::SetBufferSize(int64_t size)
|
||||||
{
|
{
|
||||||
maxSize = size;
|
maxSize = size;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue