Skip to content

Commit

Permalink
BUG: Export ASCII Data now exports multiple arrays correctly. (#756)
Browse files Browse the repository at this point in the history
Signed-off-by: Joey Kleingers <[email protected]>
  • Loading branch information
joeykleingers authored Oct 27, 2023
1 parent 816d375 commit 7d13d2f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/complex/Utilities/OStreamUtilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ struct PrintDataArray
maxLine = static_cast<size_t>(dataArray.getNumberOfComponents());
}

usize numComps = dataArray.getNumberOfComponents();
for(size_t tuple = 0; tuple < numTuples; tuple++)
{
auto now = std::chrono::steady_clock::now();
Expand All @@ -163,19 +164,19 @@ struct PrintDataArray
return {};
}
}
for(size_t index = 0; index < dataArray.getNumberOfComponents(); index++)
for(size_t index = 0; index < numComps; index++)
{
if constexpr(std::is_same_v<ScalarType, int8> || std::is_same_v<ScalarType, uint8>)
{
outputStrm << static_cast<int32>(dataArray[index]);
outputStrm << static_cast<int32>(dataArray[tuple * numComps + index]);
}
else if constexpr(std::is_same_v<ScalarType, float32> || std::is_same_v<ScalarType, float64>)
{
outputStrm << fmt::format("{}", dataArray[index]);
outputStrm << fmt::format("{}", dataArray[tuple * numComps + index]);
}
else
{
outputStrm << dataArray[index];
outputStrm << dataArray[tuple * numComps + index];
}
if(index != maxLine - 1)
{
Expand Down

0 comments on commit 7d13d2f

Please sign in to comment.