From 21aa85619f586be9e4674b374090e901badb2e96 Mon Sep 17 00:00:00 2001 From: Alexander Oster Date: Thu, 18 Jul 2024 18:20:20 +0200 Subject: [PATCH] Lib3MF Linux fixes --- CMakeLists.txt | 1 - Source/CMakeLists.txt | 3 -- .../NMR_ChunkedBinaryStreamWriter.cpp | 30 ++----------------- Source/Model/Classes/NMR_CustomXMLNode.cpp | 2 ++ Source/Model/Classes/NMR_CustomXMLTree.cpp | 2 +- .../NMR_ModelToolpathLayerReadData.cpp | 2 +- 6 files changed, 7 insertions(+), 33 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f0c72ce1..4d92e3c70 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -118,7 +118,6 @@ SOURCE_GROUP("Source Files\\Autogenerated" FILES ${ACT_GENERATED_SOURCE}) target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR_AUTOGENERATED}/Source) target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Include/API) target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Include) -target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Include/Libraries/lzma) if (USE_INCLUDED_LIBZIP) diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 831805f39..64fa06819 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -9,8 +9,6 @@ if (USE_INCLUDED_LIBZIP) endif() -file(GLOB LIBLZMA_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "Source/Libraries/lzma/*.c") - if (USE_INCLUDED_ZLIB) file(GLOB ZLIB_FILES ./Source/Libraries/zlib/*.c) endif() @@ -21,7 +19,6 @@ file (GLOB CPPBASE64_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "Source/Librarie set(SRCS_PLATFORM ${LIBZIP_FILES} ${LIBZIP_FILES_PLATFORM} - ${LIBLZMA_FILES} Source/Common/Platform/NMR_Platform.cpp Source/Common/Platform/NMR_ImportStream_Native.cpp Source/Common/Platform/NMR_ExportStream_Native.cpp diff --git a/Source/Common/ChunkedBinaryStream/NMR_ChunkedBinaryStreamWriter.cpp b/Source/Common/ChunkedBinaryStream/NMR_ChunkedBinaryStreamWriter.cpp index c31601e0c..cd67dd483 100644 --- a/Source/Common/ChunkedBinaryStream/NMR_ChunkedBinaryStreamWriter.cpp +++ b/Source/Common/ChunkedBinaryStream/NMR_ChunkedBinaryStreamWriter.cpp @@ -30,10 +30,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "Common/Platform/NMR_ImportStream_Shared_Memory.h" #include "Common/NMR_Exception.h" -#include "Libraries/lzma/LzmaLib.h" #include "Common/Platform/NMR_XmlWriter_Native.h" #include "Model/Classes/NMR_ModelConstants.h" #include +#include namespace NMR { @@ -120,32 +120,8 @@ namespace NMR { if (m_bEnableLZMA) { - int error; - error = LzmaCompress( - outBuffer.data(), &outBufferSize, - pInputBuffer, inputSize, - outProps.data(), &outPropsSize, - - // 7, /* 0 <= level <= 9, default = 5 */ - // 64 * 1024 * 1024, /* use (1 << N) or (3 << N). 4 KB < dictSize <= 128 MB */ - // 5, /* 0 <= lc <= 8, default = 3 */ - // 2, /* 0 <= lp <= 4, default = 0 */ - // 3, /* 0 <= pb <= 4, default = 2 */ - // 64, /* 5 <= fb <= 273, default = 32 */ - // 1 /* 1 or 2, default = 2 */ - - m_nLZMALevel, /* 0 <= level <= 9, default = 5 */ - 8 * 1024 * 1024, /* use (1 << N) or (3 << N). 4 KB < dictSize <= 128 MB */ - 5, /* 0 <= lc <= 8, default = 3 */ - 2, /* 0 <= lp <= 4, default = 0 */ - 3, /* 0 <= pb <= 4, default = 2 */ - 64, /* 5 <= fb <= 273, default = 32 */ - 1 /* 1 or 2, default = 2 */ - - ); - - if (error != SZ_OK) - throw CNMRException(NMR_ERROR_COULDNOTCOMPRESSDATA); + // TODO + throw CNMRException(NMR_ERROR_COULDNOTCOMPRESSDATA); } else { diff --git a/Source/Model/Classes/NMR_CustomXMLNode.cpp b/Source/Model/Classes/NMR_CustomXMLNode.cpp index d5e7764a7..dd0df9557 100644 --- a/Source/Model/Classes/NMR_CustomXMLNode.cpp +++ b/Source/Model/Classes/NMR_CustomXMLNode.cpp @@ -31,6 +31,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "Common/NMR_Exception.h" #include "Common/NMR_StringUtils.h" +#include + namespace NMR { CCustomXMLNode::CCustomXMLNode(CCustomXMLNode * pParentNode, const std::string& sName) diff --git a/Source/Model/Classes/NMR_CustomXMLTree.cpp b/Source/Model/Classes/NMR_CustomXMLTree.cpp index c338907ea..589b8e912 100644 --- a/Source/Model/Classes/NMR_CustomXMLTree.cpp +++ b/Source/Model/Classes/NMR_CustomXMLTree.cpp @@ -30,7 +30,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "Model/Classes/NMR_CustomXMLNode.h" #include "Model/Classes/NMR_ModelConstants.h" #include "Common/NMR_Exception.h" -#include "Common/Platform/NMR_XMLWriter_Native.h" +#include "Common/Platform/NMR_XmlWriter_Native.h" #include "Common/Platform/NMR_ExportStream_Memory.h" namespace NMR { diff --git a/Source/Model/Classes/NMR_ModelToolpathLayerReadData.cpp b/Source/Model/Classes/NMR_ModelToolpathLayerReadData.cpp index 9d020e04a..c557b8698 100644 --- a/Source/Model/Classes/NMR_ModelToolpathLayerReadData.cpp +++ b/Source/Model/Classes/NMR_ModelToolpathLayerReadData.cpp @@ -76,7 +76,7 @@ namespace NMR { size_t nNumberOfAttributes = m_SegmentAttributeDefinitions.size(); - m_pCurrentSegment->m_pAttributeData = allocAttributeBuffer((uint32_t)(nNumberOfAttributes)); + m_pCurrentSegment->m_pAttributeData = (NMR::nfInt64*) allocAttributeBuffer((uint32_t)(nNumberOfAttributes)); for (size_t nIndex = 0; nIndex < nNumberOfAttributes; nIndex++) m_pCurrentSegment->m_pAttributeData[nIndex] = m_AttributesOfNextSegment.at(nIndex);