Skip to content

Commit

Permalink
Merge pull request #236 from 3MFConsortium/release/2.1.0
Browse files Browse the repository at this point in the history
release/2.1.0
  • Loading branch information
martinweismann authored Jan 12, 2021
2 parents fd07e57 + 8a1cf5b commit cc19da4
Show file tree
Hide file tree
Showing 373 changed files with 13,430 additions and 1,235 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "Tests/googletest"]
path = Tests/googletest
url = https://github.com/google/googletest.git
[submodule "Tests/libressl"]
path = Tests/libressl
url = https://github.com/3MFConsortium/forks-libressl-distribution.git
33 changes: 19 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,21 @@ services:
matrix:
include:
- os: linux
dist: bionic
compiler: gcc
env: BUILDMODE=cmake-make
env: BUILDMODE=cmake-make-linux
addons:
apt:
packages:
- valgrind
- os: osx
osx_image: xcode10.1
env: BUILDMODE=cmake-make-osx
- os: osx
osx_image: xcode7.2
env: BUILDMODE=cmake-make
- os: linux
env: BUILDMODE=ppcxenial
env: BUILDMODE=cmake-make-osx
- os: windows
env: BUILDMODE=windows
- os: linux
dist: trusty
compiler: x86_64-w64-mingw32-g++
Expand All @@ -33,15 +41,12 @@ matrix:

before_script:
- if [[ "$BUILDMODE" = "cmake-mingw32" ]]; then sh cmake/GenerateMinGW.sh; cd build; fi
- if [[ "$BUILDMODE" = "cmake-make" ]]; then sh cmake/GenerateMake.sh; cd build; fi
- if [[ "$BUILDMODE" = "ppcxenial" ]]; then
docker pull multiarch/qemu-user-static ;
docker pull multiarch/ubuntu-debootstrap:powerpc-xenial ;
docker run --rm --privileged multiarch/qemu-user-static --reset -p y ;
docker build -t ppc-xenial -f CI/Dockerfile . ;
fi
- if [[ "$BUILDMODE" = "cmake-make-linux" ]]; then sh cmake/GenerateMake.sh; cd build; fi
- if [[ "$BUILDMODE" = "cmake-make-osx" ]]; then sh cmake/GenerateMake.sh; cd build; fi
- if [[ "$BUILDMODE" = "windows" ]]; then cmake/GenerateVS2017.bat; cd build; fi

script:
- if [[ "$BUILDMODE" != "ppcxenial" ]]; then cmake --build . ; fi
- if [[ "$BUILDMODE" == "cmake-make" ]]; then ctest -V ; fi
- if [[ "$BUILDMODE" == "ppcxenial" ]]; then docker run ppc-xenial; fi
- if [[ "$BUILDMODE" != "ppcxenial" ]]; then cmake --build .; fi
- if [[ "$BUILDMODE" == "cmake-make-linux" ]]; then ctest -V; cmake --build . --target lib3mf_memcheck; fi
- if [[ "$BUILDMODE" == "cmake-make-osx" ]]; then ctest -V; fi
- if [[ "$BUILDMODE" == "windows" ]]; then ctest -V ; fi
409 changes: 370 additions & 39 deletions AutomaticComponentToolkit/lib3mf.xml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions CI/script.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

cd lib3mf-repo
sh cmake/GenerateMake.sh
sh cmake/GenerateMakeFast.sh
cd build
make -j2
make -j1
ctest -V .
29 changes: 23 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,26 @@ cmake_policy(SET CMP0048 NEW)

set_property(GLOBAL PROPERTY USE_FOLDERS ON)

project(lib3mf)


include(GNUInstallDirs)

# Define Version
set(LIB3MF_VERSION_MAJOR 2) # increase on every backward-compatibility breaking change of the API
set(LIB3MF_VERSION_MINOR 0) # increase on every backward compatible change of the API
set(LIB3MF_VERSION_MINOR 1) # increase on every backward compatible change of the API
set(LIB3MF_VERSION_MICRO 0) # increase on on every change that does not alter the API
set(LIB3MF_VERSION_PRERELEASE "") # denotes pre-release information of a version of lib3mf

project(lib3mf
VERSION ${LIB3MF_VERSION_MAJOR}.${LIB3MF_VERSION_MINOR}.${LIB3MF_VERSION_MICRO}
DESCRIPTION "An implementation of the 3D Manufacturing Format file standard")

set(CMAKE_INSTALL_BINDIR bin CACHE PATH "directory for installing binary files")
set(CMAKE_INSTALL_LIBDIR lib CACHE PATH "directory for installing library files")
set(CMAKE_INSTALL_INCLUDEDIR include/lib3mf CACHE PATH "directory for installing header files")

option(USE_INCLUDED_ZLIB "Use included zlib" ON)
option(USE_INCLUDED_LIBZIP "Use included libzip" ON)
option(USE_INCLUDED_GTEST "Used included gtest" ON)
option(USE_INCLUDED_SSL "Use included libressl" ON)

if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
# using GCC
Expand Down Expand Up @@ -50,13 +53,13 @@ if (${MSVC})
endif()

### The API generation target
if(UNIX OR MINGW)
if(CMAKE_HOST_UNIX)
if(APPLE)
set(ACT_COMMANDENDING darwin)
else()
set(ACT_COMMANDENDING linux)
endif()
elseif(WIN32)
elseif(CMAKE_HOST_WIN32)
set(ACT_COMMANDENDING exe)
endif()

Expand Down Expand Up @@ -152,6 +155,18 @@ target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_BINARY_DIR_AU
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Include/API)
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Include)

if (NOT USE_INCLUDED_LIBZIP)
find_package(PkgConfig REQUIRED)
pkg_check_modules(LIBZIP REQUIRED libzip)
target_link_libraries(${PROJECT_NAME} ${LIBZIP_LIBRARIES})
endif()
if (NOT USE_INCLUDED_ZLIB)
find_package(PkgConfig REQUIRED)
pkg_check_modules(ZLIB REQUIRED zlib)
target_link_libraries(${PROJECT_NAME} ${ZLIB_LIBRARIES})
endif()


set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "" IMPORT_PREFIX "" )
# This makes sure symbols are exported
target_compile_options(${PROJECT_NAME} PRIVATE "-D__LIB3MF_EXPORTS")
Expand All @@ -176,6 +191,8 @@ else()
target_compile_options(${PROJECT_NAME} PUBLIC "$<$<CONFIG:RELEASE>:/O2;/sdl;/WX;/Oi;/Gy;/FC;/wd4996>")
endif()

configure_file(lib3mf.pc.in lib3mf.pc @ONLY)
install(FILES ${CMAKE_BINARY_DIR}/lib3mf.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
install(TARGETS ${PROJECT_NAME}
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
Expand Down
2 changes: 1 addition & 1 deletion Documentation/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
author = '3MF Consortium'

# The full version, including alpha/beta/rc tags
release = 'v2.0.0'
release = 'v2.1.0'

master_doc = 'index'

Expand Down
6 changes: 3 additions & 3 deletions Documentation/index.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. lib3mf documentation master file
*********************************************
lib3mf v2.0.0 documentation
lib3mf v2.1.0 documentation
*********************************************

.. image:: https://travis-ci.org/3MFConsortium/lib3mf.svg?branch=master
Expand All @@ -12,7 +12,7 @@ lib3mf v2.0.0 documentation
:target: https://readthedocs.org/projects/lib3mf/
:alt: Documentation Status

.. image:: https://img.shields.io/static/v1.svg?label=lib3mf&message=v2.0.0&color=green
.. image:: https://img.shields.io/static/v1.svg?label=lib3mf&message=v2.1.0&color=green
:alt: Version

.. image:: https://img.shields.io/static/v1.svg?label=platform&message=windows%20%7C%20macos%20%7C%20linux&color=lightgrey
Expand All @@ -27,7 +27,7 @@ lib3mf v2.0.0 documentation
:language: bash


Welcome! This is the documentation for lib3mf v2.0.0.
Welcome! This is the documentation for lib3mf v2.1.0.

lib3mf is an implementation of the 3D Manufacturing Format file standard.

Expand Down
74 changes: 74 additions & 0 deletions Documentation/source/Cpp/lib3mf-types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ Enumerations
.. cpp:enumerator:: Inside = 1
.. cpp:enumerator:: Outside = 2
.. cpp:enum-class:: eBeamLatticeBallMode : Lib3MF_int32
.. cpp:enumerator:: None = 0
.. cpp:enumerator:: Mixed = 1
.. cpp:enumerator:: All = 2
.. cpp:enum-class:: eProgressIdentifier : Lib3MF_int32
.. cpp:enumerator:: QUERYCANCELED = 0
Expand All @@ -121,13 +127,40 @@ Enumerations
.. cpp:enumerator:: WRITENODES = 20
.. cpp:enumerator:: WRITETRIANGLES = 21
.. cpp:enumerator:: WRITESLICES = 22
.. cpp:enumerator:: WRITEKEYSTORE = 23
.. cpp:enum-class:: eBlendMethod : Lib3MF_int32
.. cpp:enumerator:: NoBlendMethod = 0
.. cpp:enumerator:: Mix = 1
.. cpp:enumerator:: Multiply = 2
.. cpp:enum-class:: eEncryptionAlgorithm : Lib3MF_int32
.. cpp:enumerator:: AES256_GCM = 1
.. cpp:enum-class:: eWrappingAlgorithm : Lib3MF_int32
.. cpp:enumerator:: RSA_OAEP = 0
.. cpp:enum-class:: eMgfAlgorithm : Lib3MF_int32
.. cpp:enumerator:: MGF1_SHA1 = 160
.. cpp:enumerator:: MGF1_SHA224 = 224
.. cpp:enumerator:: MGF1_SHA256 = 256
.. cpp:enumerator:: MGF1_SHA384 = 384
.. cpp:enumerator:: MGF1_SHA512 = 512
.. cpp:enum-class:: eDigestMethod : Lib3MF_int32
.. cpp:enumerator:: SHA1 = 160
.. cpp:enumerator:: SHA256 = 256
.. cpp:enum-class:: eCompression : Lib3MF_int32
.. cpp:enumerator:: NoCompression = 0
.. cpp:enumerator:: Deflate = 1

Structs
--------------
Expand Down Expand Up @@ -213,6 +246,12 @@ Structs
.. cpp:member:: eBeamLatticeCapMode m_CapModes[2]

.. cpp:struct:: sBall
.. cpp:member:: Lib3MF_uint32 m_Index
.. cpp:member:: Lib3MF_double m_Radius


Function types
---------------
Expand Down Expand Up @@ -250,6 +289,41 @@ Function types
:param nPosition: Position in the stream to move to
:param pUserData: Userdata that is passed to the callback function

.. cpp:type:: RandomNumberCallback = void(*)(Lib3MF_uint64, Lib3MF_uint64, Lib3MF_pvoid, Lib3MF_uint64*)
Callback to generate random numbers

:param nByteData: Pointer to a buffer to read data into
:param nNumBytes: Size of available bytes in the buffer
:param pUserData: Userdata that is passed to the callback function
:return: Number of bytes generated when succeed. 0 or less if failed.

.. cpp:type:: KeyWrappingCallback = void(*)(Lib3MF_AccessRight, Lib3MF_uint8 *, Lib3MF_uint8 **, Lib3MF_pvoid, Lib3MF_uint64*)
A callback used to wrap (encrypt) the content key available in keystore resource group

:param pKEKParams: The information about the parameters used used to wrap the key to the contents
:param nInBufferBufferSize: Buffer to the input value. When encrypting, this should be the plain key. When decrypting, this should be the key cipher.
:param nInBufferBufferSize: buffer of Buffer to the input value. When encrypting, this should be the plain key. When decrypting, this should be the key cipher.
:param nOutBufferBufferSize: Number of elements in buffer
:param pOutBufferNeededCount: will be filled with the count of the written elements, or needed buffer size.
:param pOutBufferBuffer: buffer of Buffer where the data will be placed. When encrypting, this will be the key cipher. When decrypting, this will be the plain key. When buffer is null, neededBytes contains the required bytes to run.
:param pUserData: Userdata that is passed to the callback function
:return: The needed/encrypted/decrypted bytes when succeed or zero when error.

.. cpp:type:: ContentEncryptionCallback = void(*)(Lib3MF_ContentEncryptionParams, Lib3MF_uint8 *, Lib3MF_uint8 **, Lib3MF_pvoid, Lib3MF_uint64*)
A callback to encrypt/decrypt content called on each resource encrypted. This might be called several times depending on content size. If Input is not available(either null or size is 0), clients must return the result of authenticated tag generation/validation.

:param pCEKParams: The params of the encryption process. Client must set/check AuthenticationTag when closing the encryption/decryption process.
:param nInputBufferSize: Buffer to the original data. In encrypting, this will be the plain data. If decrypting, this will be the cipher data
:param nInputBufferSize: buffer of Buffer to the original data. In encrypting, this will be the plain data. If decrypting, this will be the cipher data
:param nOutputBufferSize: Number of elements in buffer
:param pOutputNeededCount: will be filled with the count of the written elements, or needed buffer size.
:param pOutputBuffer: buffer of Buffer to hold the transformed data. When encrypting, this will be the cipher data. When decrypting, this shall be the plain data. If buffer is null, neededBytes return the necessary amount of bytes.
:param pUserData: Userdata that is passed to the callback function
:return: The needed/encrypted/decrypted/verified bytes when succeed or zero when error.



ELib3MFException: The standard exception class of the 3MF Library
Expand Down
44 changes: 44 additions & 0 deletions Documentation/source/Cpp/lib3mf_AccessRight.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@

CAccessRight
====================================================================================================


.. cpp:class:: Lib3MF::CAccessRight : public CBase





.. cpp:function:: PConsumer GetConsumer()

Gets the consumer associated with this access right

:returns: The consumer instance


.. cpp:function:: eWrappingAlgorithm GetWrappingAlgorithm()

Gets the associated encryption algorithm

:returns: The algorithm used for the key in this accessright


.. cpp:function:: eMgfAlgorithm GetMgfAlgorithm()

Gets the associated mask generation function algorithm

:returns: The MFG1 algorithm


.. cpp:function:: eDigestMethod GetDigestMethod()

Gets the digest method assoicated

:returns: The digest method for this accessright


.. cpp:type:: std::shared_ptr<CAccessRight> Lib3MF::PAccessRight

Shared pointer to CAccessRight to easily allow reference counting.

11 changes: 9 additions & 2 deletions Documentation/source/Cpp/lib3mf_Attachment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,25 @@ CAttachment

.. cpp:function:: std::string GetPath()

Retrieves an attachment's package path.
Retrieves an attachment's package path. This function will be removed in a later release.

:returns: returns the attachment's package path string


.. cpp:function:: void SetPath(const std::string & sPath)

Sets an attachment's package path.
Sets an attachment's package path. This function will be removed in a later release.

:param sPath: new path of the attachment.


.. cpp:function:: PPackagePart PackagePart()

Returns the PackagePart that is this attachment.

:returns: The PackagePart of this attachment.


.. cpp:function:: std::string GetRelationShipType()

Retrieves an attachment's relationship type
Expand Down
Loading

0 comments on commit cc19da4

Please sign in to comment.