diff --git a/src/Plugins/ComplexCore/src/ComplexCore/Filters/Algorithms/WriteStlFile.cpp b/src/Plugins/ComplexCore/src/ComplexCore/Filters/Algorithms/WriteStlFile.cpp index 8231cbeeeb..b00aa33c4f 100644 --- a/src/Plugins/ComplexCore/src/ComplexCore/Filters/Algorithms/WriteStlFile.cpp +++ b/src/Plugins/ComplexCore/src/ComplexCore/Filters/Algorithms/WriteStlFile.cpp @@ -7,32 +7,6 @@ using namespace complex; -namespace -{ -int32_t writeHeader(FILE* f, const std::string& header, int32_t triCount) -{ - if(nullptr == f) - { - return -1; - } - - char h[80]; - size_t headLength = 80; - if(header.length() < 80) - { - headLength = static_cast(header.length()); - } - - std::string c_str = header; - ::memset(h, 0, 80); - ::memcpy(h, c_str.data(), headLength); - // Return the number of bytes written - which should be 80 - fwrite(h, 1, 80, f); - fwrite(&triCount, 1, 4, f); - return 0; -} -} // namespace - // ----------------------------------------------------------------------------- WriteStlFile::WriteStlFile(DataStructure& dataStructure, const IFilter::MessageHandler& mesgHandler, const std::atomic_bool& shouldCancel, WriteStlFileInputValues* inputValues) : m_DataStructure(dataStructure) @@ -142,7 +116,19 @@ Result<> WriteStlFile::operator()() return {MakeWarningVoidResult(-27874, fmt::format("Error Writing STL File '{}'. Header was over the 80 characters supported by STL. Length of header: {}.", filename, header.length()))}; } - writeHeader(f, header, 0); + char h[80]; + size_t headLength = 80; + if(header.length() < 80) + { + headLength = static_cast(header.length()); + } + + std::string c_str = header; + ::memset(h, 0, 80); + ::memcpy(h, c_str.data(), headLength); + // Return the number of bytes written - which should be 80 + fwrite(h, 1, 80, f); + fwrite(&triCount, 1, 4, f); triCount = 0; // Reset this to Zero. Increment for every triangle written // Loop over all the triangles for this spin diff --git a/src/Plugins/ComplexCore/src/ComplexCore/Filters/WriteDREAM3DFilter.cpp b/src/Plugins/ComplexCore/src/ComplexCore/Filters/WriteDREAM3DFilter.cpp index ca598597d6..96f8a5cbb0 100644 --- a/src/Plugins/ComplexCore/src/ComplexCore/Filters/WriteDREAM3DFilter.cpp +++ b/src/Plugins/ComplexCore/src/ComplexCore/Filters/WriteDREAM3DFilter.cpp @@ -7,8 +7,8 @@ #include "complex/Pipeline/Pipeline.hpp" #include "complex/Pipeline/PipelineFilter.hpp" #include "complex/Utilities/Parsing/DREAM3D/Dream3dIO.hpp" -#include "complex/Utilities/SIMPLConversion.hpp" #include "complex/Utilities/Parsing/HDF5/Writers/FileWriter.hpp" +#include "complex/Utilities/SIMPLConversion.hpp" #include namespace fs = std::filesystem;