mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: use double for VTK legacy output (issue #891)
- some paraview versions (eg, on windows) don't support float, only double. This mostly affected the vtkSurfaceWriter. The foamToVTK is also affected, but since it also supports the XML output formats (vtp, vtu) these can be used instead.
This commit is contained in:
@ -71,12 +71,13 @@ void Foam::vtkSetWriter<Type>::write
|
||||
<< points.name() << nl
|
||||
<< "ASCII" << nl
|
||||
<< "DATASET POLYDATA" << nl
|
||||
<< "POINTS " << points.size() << " float" << nl;
|
||||
<< "POINTS " << points.size() << " double" << nl;
|
||||
|
||||
forAll(points, i)
|
||||
for (const point& pt : points)
|
||||
{
|
||||
const vector& pt = points[i];
|
||||
os << pt.x() << ' ' << pt.y() << ' ' << pt.z() << nl;
|
||||
os << float(pt.x()) << ' '
|
||||
<< float(pt.y()) << ' '
|
||||
<< float(pt.z()) << nl;
|
||||
}
|
||||
|
||||
os << "POINT_DATA " << points.size() << nl
|
||||
@ -132,15 +133,16 @@ void Foam::vtkSetWriter<Type>::write
|
||||
<< tracks[0].name() << nl
|
||||
<< "ASCII" << nl
|
||||
<< "DATASET POLYDATA" << nl
|
||||
<< "POINTS " << nPoints << " float" << nl;
|
||||
<< "POINTS " << nPoints << " double" << nl;
|
||||
|
||||
forAll(tracks, trackI)
|
||||
{
|
||||
const coordSet& points = tracks[trackI];
|
||||
forAll(points, i)
|
||||
for (const point& pt : points)
|
||||
{
|
||||
const vector& pt = points[i];
|
||||
os << pt.x() << ' ' << pt.y() << ' ' << pt.z() << nl;
|
||||
os << float(pt.x()) << ' '
|
||||
<< float(pt.y()) << ' '
|
||||
<< float(pt.z()) << nl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user