Types used in the 3MF Library¶
Simple types¶
- typedef uint8_t
Lib3MF_uint8
¶
- typedef uint16_t
Lib3MF_uint16
¶
- typedef uint32_t
Lib3MF_uint32
¶
- typedef uint64_t
Lib3MF_uint64
¶
- typedef int8_t
Lib3MF_int8
¶
- typedef int16_t
Lib3MF_int16
¶
- typedef int32_t
Lib3MF_int32
¶
- typedef int64_t
Lib3MF_int64
¶
- typedef float
Lib3MF_single
¶
- typedef double
Lib3MF_double
¶
- using
Lib3MF_pvoid
= void*¶
- using
Lib3MFResult
= Lib3MF_int32¶
Enumerations¶
- enum class
ePropertyType
: Lib3MF_int32¶
- enumerator
NoPropertyType
= 0¶
- enumerator
BaseMaterial
= 1¶
- enumerator
TexCoord
= 2¶
- enumerator
Colors
= 3¶
- enumerator
Composite
= 4¶
- enumerator
Multi
= 5¶
- enum class
eSlicesMeshResolution
: Lib3MF_int32¶
- enumerator
Fullres
= 0¶
- enumerator
Lowres
= 1¶
- enum class
eModelUnit
: Lib3MF_int32¶
- enumerator
MicroMeter
= 0¶
- enumerator
MilliMeter
= 1¶
- enumerator
CentiMeter
= 2¶
- enumerator
Inch
= 3¶
- enumerator
Foot
= 4¶
- enumerator
Meter
= 5¶
- enum class
eObjectType
: Lib3MF_int32¶
- enumerator
Other
= 0¶
- enumerator
Model
= 1¶
- enumerator
Support
= 2¶
- enumerator
SolidSupport
= 3¶
- enum class
eTextureType
: Lib3MF_int32¶
- enumerator
Unknown
= 0¶
- enumerator
PNG
= 1¶
- enumerator
JPEG
= 2¶
- enum class
eTextureTileStyle
: Lib3MF_int32¶
- enumerator
Wrap
= 0¶
- enumerator
Mirror
= 1¶
- enumerator
Clamp
= 2¶
- enumerator
NoTileStyle
= 3¶
- enum class
eTextureFilter
: Lib3MF_int32¶
- enumerator
Auto
= 0¶
- enumerator
Linear
= 1¶
- enumerator
Nearest
= 2¶
- enum class
eBeamLatticeCapMode
: Lib3MF_int32¶
- enumerator
Sphere
= 0¶
- enumerator
HemiSphere
= 1¶
- enumerator
Butt
= 2¶
- enum class
eBeamLatticeClipMode
: Lib3MF_int32¶
- enumerator
NoClipMode
= 0¶
- enumerator
Inside
= 1¶
- enumerator
Outside
= 2¶
- enum class
eBeamLatticeBallMode
: Lib3MF_int32¶
- enum class
eProgressIdentifier
: Lib3MF_int32¶
- enumerator
QUERYCANCELED
= 0¶
- enumerator
DONE
= 1¶
- enumerator
CLEANUP
= 2¶
- enumerator
READSTREAM
= 3¶
- enumerator
EXTRACTOPCPACKAGE
= 4¶
- enumerator
READNONROOTMODELS
= 5¶
- enumerator
READROOTMODEL
= 6¶
- enumerator
READRESOURCES
= 7¶
- enumerator
READMESH
= 8¶
- enumerator
READSLICES
= 9¶
- enumerator
READBUILD
= 10¶
- enumerator
READCUSTOMATTACHMENT
= 11¶
- enumerator
READTEXTURETACHMENTS
= 12¶
- enumerator
CREATEOPCPACKAGE
= 13¶
- enumerator
WRITEMODELSTOSTREAM
= 14¶
- enumerator
WRITEROOTMODEL
= 15¶
- enumerator
WRITENONROOTMODELS
= 16¶
- enumerator
WRITEATTACHMENTS
= 17¶
- enumerator
WRITECONTENTTYPES
= 18¶
- enumerator
WRITENOBJECTS
= 19¶
- enumerator
WRITENODES
= 20¶
- enumerator
WRITETRIANGLES
= 21¶
- enumerator
WRITESLICES
= 22¶
- enumerator
WRITEKEYSTORE
= 23¶
- enum class
eBlendMethod
: Lib3MF_int32¶
- enumerator
NoBlendMethod
= 0¶
- enumerator
Mix
= 1¶
- enumerator
Multiply
= 2¶
- enum class
eEncryptionAlgorithm
: Lib3MF_int32¶
- enumerator
AES256_GCM
= 1¶
- enum class
eWrappingAlgorithm
: Lib3MF_int32¶
- enumerator
RSA_OAEP
= 0¶
- enum class
eMgfAlgorithm
: Lib3MF_int32¶
- enumerator
MGF1_SHA1
= 160¶
- enumerator
MGF1_SHA224
= 224¶
- enumerator
MGF1_SHA256
= 256¶
- enumerator
MGF1_SHA384
= 384¶
- enumerator
MGF1_SHA512
= 512¶
- enum class
eDigestMethod
: Lib3MF_int32¶
- enumerator
SHA1
= 160¶
- enumerator
SHA256
= 256¶
- enum class
eCompression
: Lib3MF_int32¶
- enumerator
NoCompression
= 0¶
- enumerator
Deflate
= 1¶
Structs¶
All structs are defined as packed, i.e. with the
#pragma pack (1)
- struct
sTriangle
¶
- Lib3MF_uint32
m_Indices
[3]¶
- struct
sTriangleProperties
¶
- Lib3MF_uint32
m_ResourceID
¶
- Lib3MF_uint32
m_PropertyIDs
[3]¶
- struct
sPosition
¶
- Lib3MF_single
m_Coordinates
[3]¶
- struct
sPosition2D
¶
- Lib3MF_single
m_Coordinates
[2]¶
- struct
sCompositeConstituent
¶
- Lib3MF_uint32
m_PropertyID
¶
- Lib3MF_double
m_MixingRatio
¶
- struct
sMultiPropertyLayer
¶
- Lib3MF_uint32
m_ResourceID
¶
- eBlendMethod
m_TheBlendMethod
¶
- struct
sTex2Coord
¶
- Lib3MF_double
m_U
¶
- Lib3MF_double
m_V
¶
- struct
sTransform
¶
- Lib3MF_single
m_Fields
[4][3]¶
- struct
sBox
¶
- Lib3MF_single
m_MinCoordinate
[3]¶
- Lib3MF_single
m_MaxCoordinate
[3]¶
- struct
sColor
¶
- Lib3MF_uint8
m_Red
¶
- Lib3MF_uint8
m_Green
¶
- Lib3MF_uint8
m_Blue
¶
- Lib3MF_uint8
m_Alpha
¶
- struct
sBeam
¶
- Lib3MF_uint32
m_Indices
[2]¶
- Lib3MF_double
m_Radii
[2]¶
- eBeamLatticeCapMode
m_CapModes
[2]¶
- struct
sBall
¶
- Lib3MF_uint32
m_Index
¶
- Lib3MF_double
m_Radius
¶
Function types¶
- using
ProgressCallback
= void (*)(bool*, Lib3MF_double, Lib3MF::eProgressIdentifier, Lib3MF_pvoid)¶A callback function
- Returns
Returns whether the calculation should be aborted
- Parameters
dProgressValue – The value of the progress function: values in the interval [0,1] are progress; < mean no progress update
eProgressIdentifier – An identifier of progress
pUserData – Userdata that is passed to the callback function
- using
WriteCallback
= void (*)(Lib3MF_uint64, Lib3MF_uint64, Lib3MF_pvoid)¶Callback to call for writing a data chunk
- Parameters
nByteData – Pointer to the data to be written
nNumBytes – Number of bytes to write
pUserData – Userdata that is passed to the callback function
- using
ReadCallback
= void (*)(Lib3MF_uint64, Lib3MF_uint64, Lib3MF_pvoid)¶Callback to call for reading a data chunk
- Parameters
nByteData – Pointer to a buffer to read data into
nNumBytes – Number of bytes to read
pUserData – Userdata that is passed to the callback function
- using
SeekCallback
= void (*)(Lib3MF_uint64, Lib3MF_pvoid)¶Callback to call for seeking in the stream
- Parameters
nPosition – Position in the stream to move to
pUserData – Userdata that is passed to the callback function
- using
RandomNumberCallback
= void (*)(Lib3MF_uint64, Lib3MF_uint64, Lib3MF_pvoid, Lib3MF_uint64*)¶Callback to generate random numbers
- Parameters
nByteData – Pointer to a buffer to read data into
nNumBytes – Size of available bytes in the buffer
pUserData – Userdata that is passed to the callback function
- Returns
Number of bytes generated when succeed. 0 or less if failed.
- using
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
- Parameters
pKEKParams – The information about the parameters used used to wrap the key to the contents
nInBufferBufferSize – Buffer to the input value. When encrypting, this should be the plain key. When decrypting, this should be the key cipher.
nInBufferBufferSize – buffer of Buffer to the input value. When encrypting, this should be the plain key. When decrypting, this should be the key cipher.
nOutBufferBufferSize – Number of elements in buffer
pOutBufferNeededCount – will be filled with the count of the written elements, or needed buffer size.
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.
pUserData – Userdata that is passed to the callback function
- Returns
The needed/encrypted/decrypted bytes when succeed or zero when error.
- using
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.
- Parameters
pCEKParams – The params of the encryption process. Client must set/check AuthenticationTag when closing the encryption/decryption process.
nInputBufferSize – Buffer to the original data. In encrypting, this will be the plain data. If decrypting, this will be the cipher data
nInputBufferSize – buffer of Buffer to the original data. In encrypting, this will be the plain data. If decrypting, this will be the cipher data
nOutputBufferSize – Number of elements in buffer
pOutputNeededCount – will be filled with the count of the written elements, or needed buffer size.
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.
pUserData – Userdata that is passed to the callback function
- Returns
The needed/encrypted/decrypted/verified bytes when succeed or zero when error.
ELib3MFException: The standard exception class of the 3MF Library¶
Errors in the 3MF Library are reported as Exceptions. It is recommended to not throw these exceptions in your client code.
- class
Lib3MF
::
ELib3MFException
¶
- void
ELib3MFException
::
what
() const noexcept¶Returns error message
- Returns
the error message of this exception
- Lib3MFResult
ELib3MFException
::
getErrorCode
() const noexcept¶Returns error code
- Returns
the error code of this exception
CInputVector: Adapter for passing arrays as input for functions¶
Several functions of the 3MF Library expect arrays of integral types or structs as input parameters. To not restrict the interface to, say, std::vector<type>, and to have a more abstract interface than a location in memory and the number of elements to input to a function the 3MF Library provides a templated adapter class to pass arrays as input for functions.
Usually, instances of CInputVector are generated anonymously (or even implicitly) in the call to a function that expects an input array.
- template<typename
T
>
classLib3MF
::
CInputVector
¶
CInputVector
(const T *in_data, size_t in_size)¶Constructs of a CInputVector from a memory address and a given number of elements
- const T *
CInputVector
::
data
() const¶returns the start address of the data captured by this CInputVector
- size_t
CInputVector
::
size
() const¶returns the number of elements captured by this CInputVector